Skip to content
Snippets Groups Projects
  • Yannick Tivisse's avatar
    0b83dd9a
    [FIX] sale_timesheet: Set the account_id on the analytic entries from timesheets · 0b83dd9a
    Yannick Tivisse authored
    When we create a timesheet activity, it create an analytic line that allows to re-invoice the costs from the employee. If the account_id is not set on the analytic account line, the employee cost is not passed correctly on the Analytic Entries, which is not the behavior we should expect.
    
    This commit simply adds a account_id on the employee and this account is returned with the cost and the uom by the method `_get_timesheet_cost`
    0b83dd9a
    History
    [FIX] sale_timesheet: Set the account_id on the analytic entries from timesheets
    Yannick Tivisse authored
    When we create a timesheet activity, it create an analytic line that allows to re-invoice the costs from the employee. If the account_id is not set on the analytic account line, the employee cost is not passed correctly on the Analytic Entries, which is not the behavior we should expect.
    
    This commit simply adds a account_id on the employee and this account is returned with the cost and the uom by the method `_get_timesheet_cost`
hr_views.xml 634 B
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
        <field name="name">hr.timesheet.employee.extd_form</field>
        <field name="model">hr.employee</field>
        <field name="inherit_id" ref="hr.view_employee_form"/>
        <field name="arch" type="xml">
            <xpath expr="//group[@name='active_group']" position="before">
                <group string="Timesheets">
                    <field name="timesheet_cost"/>
                    <field name="account_id"/>
                </group>
            </xpath>
        </field>
    </record>
</odoo>