Posts

Showing posts with the label company-dependent field

Company dependent field is not working in RECORD-RULE DOMAIN with multi-company configured system.

Problem Area: Scenario I want to write a  record rule  with  domain  based on the  company_dependent fields (means that field value is storing in ir.property Model).   Means, I have one field i.e.  x_company_dependent_field   in product.category Model and I want to write one record rule in product. In record-rule domain, I want to compare the product.category field's value with the User fields i.e.  x_any_field (normal field). so that domain on product.product / product.template Model can be like below. Like(domain),   [('categ_id.x_company_dependent_field', '=', user.x_any_field)] Issue with the User Company ID: When we work with multi-company scenario that means if user logged into their account system should show his company in code i.e. self.env.user.company_id . Instead of this everytime system takes ADMIN(2) user company. So that record-rule does not satisfied. Problem-statement Followings are the output from odoo files. file: od...