From ceeee8e6e2f680c4bcc60e3b925d6f5eaea5730b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 2 May 2017 14:21:34 +0200 Subject: [PATCH] [FIX] sale: avoid updating layout sequence at creation When a invoice line is create a default layout_category_sequence was created with a value of 0, updating the value of layout_category_id.sequence instead of fetching it. This operation was very slow on the invoice creation wizard opw-741517 --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index d7e3380b595..d625f41fe8c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -964,7 +964,7 @@ class AccountInvoiceLine(models.Model): sale_line_ids = fields.Many2many('sale.order.line', 'sale_order_line_invoice_rel', 'invoice_line_id', 'order_line_id', string='Sale Order Lines', readonly=True, copy=False) layout_category_id = fields.Many2one('sale.layout_category', string='Section') - layout_category_sequence = fields.Integer(related='layout_category_id.sequence', string='Layout Sequence', store=True, default=0) + layout_category_sequence = fields.Integer(related='layout_category_id.sequence', string='Layout Sequence', store=True) class ProcurementOrder(models.Model):