[FIX] sale: do not store invoice_count
Because reasons: - The field is only used in a stat button, so there is a limited number of accesses to it. - The field is computed in a method which is used to compute invoice_ids, which is not stored anyway. - If some refund_ids are found, invoice_count is not updated in the database. This is because the refunds are not linked in any way to the SO or to the original invoice, making impossible to find an appropriate @api.depends field to monitor.
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ class SaleOrder(models.Model):
|
||||
|
||||
order_line = fields.One2many('sale.order.line', 'order_id', string='Order Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True)
|
||||
|
||||
invoice_count = fields.Integer(string='# of Invoices', compute='_get_invoiced', store=True, readonly=True)
|
||||
invoice_count = fields.Integer(string='# of Invoices', compute='_get_invoiced', readonly=True)
|
||||
invoice_ids = fields.Many2many("account.invoice", string='Invoices', compute="_get_invoiced", readonly=True, copy=False)
|
||||
invoice_status = fields.Selection([
|
||||
('upselling', 'Upselling Opportunity'),
|
||||
|
||||
Reference in New Issue
Block a user