mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'new/15.0/H11047_timesheet_exception__add_eceptions' into '15.0-test'
new/15.0/H11047_timesheet_exception__add_eceptions into 15.0-test See merge request hibou-io/hibou-odoo/suite!1500
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<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 self.unit_amount > 8: failed=True</field>
|
||||
<field name="code">failed = self._context.get("newVals", {}).get("validated", False) == True and self.unit_amount > 8</field>
|
||||
<field name="active" eval="True"/>
|
||||
</record>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<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 self.so_line.product_template_id.service_policy == 'ordered_timesheet' and self.so_line.qty_delivered + self.unit_amount > self.so_line.product_uom_qty: failed=True</field>
|
||||
<field name="code">failed = self._context.get("newVals", {}).get("validated", False) == True and (self.so_line.product_template_id.service_policy == 'ordered_timesheet' and self.so_line.qty_delivered + self.unit_amount > self.so_line.product_uom_qty)</field>
|
||||
<field name="active" eval="True"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ class AnalyticLine(models.Model):
|
||||
def _reverse_field(self):
|
||||
return 'timesheet_ids'
|
||||
|
||||
def write(self, vals):
|
||||
def write(self, vals):
|
||||
if not vals.get('ignore_exception'):
|
||||
for timesheet in self:
|
||||
if timesheet.detect_exceptions() and 'stage_id' in vals:
|
||||
for timesheet in self:
|
||||
if timesheet.with_context(newVals=vals).detect_exceptions():
|
||||
return self._popup_exceptions()
|
||||
return super().write(vals)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user