[IMP] sale_timesheet_work_entry_rate: compute billing amount, display

This commit is contained in:
Jared Kipe
2022-05-23 18:49:05 +00:00
parent cca3b6d632
commit 8c69cac537
5 changed files with 49 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="report_invoice_document_inherit" inherit_id="timesheet_invoice.report_invoice_document_inherit">
<xpath expr="//tr[@t-as='timesheet']/td[last()]" position="replace">
<td class="text-right" t-if="not timesheet.work_type_id or timesheet.work_billing_rate == 1.0">
<span t-field="timesheet.unit_amount" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
</td>
<td class="text-right" t-else="">
<del t-field="timesheet.unit_amount" class="text-muted" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
<br/>
<span t-field="timesheet.work_billing_amount" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
</td>
</xpath>
</template>
</odoo>

View File

@@ -6,17 +6,26 @@
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='name']" position="before">
<field name="work_type_id"
domain="[('allow_timesheet', '=', True)]"
context="{'default_allow_timesheet': True}" />
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']" position="after">
<field name="work_billing_amount" widget="timesheet_uom" />
</xpath>
<xpath expr="//field[@name='timesheet_ids']/form//field[@name='name']" position="before">
<field name="work_type_id"
domain="[('allow_timesheet', '=', True)]"
context="{'default_allow_timesheet': True}" />
<xpath expr="//field[@name='timesheet_ids']/form//field[@name='unit_amount']" position="after">
<field name="work_billing_amount" widget="timesheet_uom" />
</xpath>
</field>
</record>
<template id="portal_timesheet_table_inherit" inherit_id="hr_timesheet.portal_timesheet_table">
<xpath expr="//tr[@t-as='timesheet']/td[last()]" position="replace">
<td class="text-right" t-if="not timesheet.work_type_id or timesheet.work_billing_rate == 1.0">
<span t-field="timesheet.unit_amount" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
</td>
<td class="text-right" t-else="">
<del t-field="timesheet.unit_amount" class="text-muted" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
<br/>
<span t-field="timesheet.work_billing_amount" t-options="{&quot;widget&quot;: &quot;duration&quot;, &quot;unit&quot;: &quot;hour&quot;, &quot;round&quot;: &quot;minute&quot;}"/>
</td>
</xpath>
</template>
</odoo>