[ADD] timesheet_exception: timesheet created should not exceed 8 in spent hours

H11047
This commit is contained in:
percyhibou
2022-10-01 04:11:39 +00:00
parent 58666c3806
commit 368770f814
12 changed files with 340 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="except_unit_amount_over_eight_hours" model="exception.rule">
<field name="name">Unit amount exceeds 8 hrs</field>
<field name="description">Unit amount over 8 hrs</field>
<field name="sequence">50</field>
<field name="model">account.analytic.line</field>
<field name="code">if timesheet.unit_amount > 8: failed=True</field>
<field name="active" eval="False"/>
</record>
<record id="except_unit_amount_over_ordered_quantity" model="exception.rule">
<field name="name">SO delivered qty plus unit amount exceeds ordered qty</field>
<field name="description">SO delivered qty plus unit amount exceeds ordered qty</field>
<field name="sequence">50</field>
<field name="model">account.analytic.line</field>
<field name="code">if timesheet.so_line.product_template_id.service_policy == 'ordered_timesheet' and timesheet.so_line.qty_delivered + timesheet.unit_amount > timesheet.so_line.product_uom_qty: failed=True</field>
<field name="active" eval="False"/>
</record>
</odoo>