From 493b4c5a40c43f5b5ea0346855f6f44ca1f08f9e Mon Sep 17 00:00:00 2001 From: nda-odoo Date: Thu, 5 Jan 2023 21:55:51 +0000 Subject: [PATCH] [FIX] sale: avoid ensure_one error during import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tax_id on sale.order.line is a many2many field. Using ".id" means you cannot import sales orders/quotations because it raises an expected singleton error. However, the initial bug fixed by 54c828b does not exist anymore on 13.0. So it has been decided to remove this code instead. opw-3091663 closes odoo/odoo#110639 X-original-commit: 58deebcfdf797f7dd3ab767e7c7db68b4c00b0f9 Signed-off-by: William André (wan) --- addons/sale/models/sale_order_line.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/sale/models/sale_order_line.py b/addons/sale/models/sale_order_line.py index 3c377948137..b1d6c2fd2ff 100644 --- a/addons/sale/models/sale_order_line.py +++ b/addons/sale/models/sale_order_line.py @@ -595,8 +595,6 @@ class SaleOrderLine(models.Model): 'price_tax': amount_tax, 'price_total': amount_untaxed + amount_tax, }) - if self.env.context.get('import_file', False) and not self.env.user.user_has_groups('account.group_account_manager'): - line.tax_id.invalidate_recordset(['invoice_repartition_line_ids']) @api.depends('price_subtotal', 'product_uom_qty') def _compute_price_reduce_taxexcl(self):