From 13a9e4d93ad72beffbd165a2220b2c2ae9be6135 Mon Sep 17 00:00:00 2001 From: jem-odoo Date: Fri, 27 Apr 2018 11:51:38 +0200 Subject: [PATCH] [FIX] sale: missing triggers on invoice_ids As 'invoice_ids' on sale.order is a computed field, creating a refund should invalidate this field as 'invoice_ids' should contain invoices, refunds, ... When using the refund wizard, the credit note will be linked to the SO lines (see `_refund_cleanup_lines` override in sale). Without the new trigger, invoice_ids will not be recomputed, and executing 'sale_order.invoice_ids[1]' will not return the refund account.invoice. This commit fixes it. --- addons/sale/models/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 7a3861585dc..8fba994d6ba 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -39,7 +39,7 @@ class SaleOrder(models.Model): 'amount_total': amount_untaxed + amount_tax, }) - @api.depends('state', 'order_line.invoice_status') + @api.depends('state', 'order_line.invoice_status', 'order_line.invoice_lines') def _get_invoiced(self): """ Compute the invoice status of a SO. Possible statuses: