From bb54e5ea1a4b0827f15ea33862e4dc6a9309b7b3 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 28 Jan 2021 09:51:45 +0000 Subject: [PATCH] [FIX] hr_expense: Create an expense product with vendor taxes Steps to reproduce the bug: When trying to import or create a expense product with supplier taxes, the supplier taxes were removed. PS: The field vendor taxes is available in the expense product view opw:2444551 closes odoo/odoo#65403 X-original-commit: 02d0591b73f5acd8c94e65cda3af1158c3a2254a Signed-off-by: Simon Goffin (sig) Signed-off-by: Yannick Tivisse (yti) --- addons/hr_expense/models/product_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/models/product_template.py b/addons/hr_expense/models/product_template.py index a9e81959b0d..d053a800313 100644 --- a/addons/hr_expense/models/product_template.py +++ b/addons/hr_expense/models/product_template.py @@ -15,7 +15,7 @@ class ProductTemplate(models.Model): for vals in vals_list: # When creating an expense product on the fly, you don't expect to # have taxes on it - if vals.get('can_be_expensed', False): + if vals.get('can_be_expensed', False) and not self.env.context.get('import_file'): vals.update({'supplier_taxes_id': False}) return super(ProductTemplate, self).create(vals_list)