From c61a1a4789c2e85f72871bcbaf4d8d8e84551a45 Mon Sep 17 00:00:00 2001 From: "Thomas Lefebvre (thle)" Date: Wed, 14 Dec 2022 08:13:15 +0000 Subject: [PATCH] [FIX] base: inherit the industry field from parent Steps to reproduce: - install "contacts" and "sale_management" module; - create a company contact with a value for "Industry" (Sales & Purchase tab); - create an employee who works in this company; - create two orders (one with the company and one with the employee); - go to sales reporting tab and select the pivot view; - filter by "Customer Industry" and then by "Customer"; Issue: The employee is not placed in the right category of industry. He should be in the same category as the company he works in. Cause: When creating a contact, the `industry_id` field is not passed from parent to children. (Moreover, this field being invisible for an "individual" contact, it is not possible to give it a value without using the studio application.) Solution: Add `industry_id` to `_commercial_fields`. opw-3085032 closes odoo/odoo#109313 X-original-commit: 60962062aefd34c911385f671c56b03836b3025a Signed-off-by: Yannick Tivisse (yti) Signed-off-by: Lefebvre Thomas (thle) --- odoo/addons/base/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py index b67607ced10..f3ce9d1870e 100644 --- a/odoo/addons/base/models/res_partner.py +++ b/odoo/addons/base/models/res_partner.py @@ -526,7 +526,7 @@ class Partner(models.Model): partners that aren't `commercial entities` themselves, and will be delegated to the parent `commercial entity`. The list is meant to be extended by inheriting classes. """ - return ['vat', 'company_registry'] + return ['vat', 'company_registry', 'industry_id'] def _commercial_sync_from_company(self): """ Handle sync of commercial fields when a new parent commercial entity is set,