[FIX] purchase: correct triggers on computed fields
To be triggered on the fields that are used inside the computed field. Was not very problematic before as the fields were not stored and recomputed at each modification. It could be backported if needed. Next commit will store these fields for performance reason, fixing the trigger first is required. Linked to #15259
This commit is contained in:
@@ -57,7 +57,7 @@ class PurchaseOrder(models.Model):
|
||||
else:
|
||||
order.invoice_status = 'no'
|
||||
|
||||
@api.depends('order_line.invoice_lines.invoice_id.state')
|
||||
@api.depends('order_line.invoice_lines.invoice_id')
|
||||
def _compute_invoice(self):
|
||||
for order in self:
|
||||
invoices = self.env['account.invoice']
|
||||
@@ -75,7 +75,9 @@ class PurchaseOrder(models.Model):
|
||||
types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id', '=', False)])
|
||||
return types[:1]
|
||||
|
||||
@api.depends('order_line.move_ids')
|
||||
@api.depends('order_line.move_ids.returned_move_ids',
|
||||
'order_line.move_ids.state',
|
||||
'order_line.move_ids.picking_id')
|
||||
def _compute_picking(self):
|
||||
for order in self:
|
||||
pickings = self.env['stock.picking']
|
||||
|
||||
Reference in New Issue
Block a user