Posts

Showing posts from February, 2021

Inherit Group to ADD Remove group implied (inherited) Groups from existing Group in Odoo

Image
We can add/remove implied  i.e. inherited groups in Odoo ERP System. Add remove group from existing group in odoo. Example: In below example, I have one Group i.e. Employee / Officer with inherited User Type / Internal User. Now we will remove Internal User from this group by using inherited code. But before that we have to check for noupdate status. we can check noupdate status by click on,  Button: Action-->Record Info-->XML ID   Action-->Record Info-->XML ID If noupdate boolean is check i.e. True. It means this will not update through the code. So we can set it False either manually or By Code itself then we can write code for add/remove new groups or existing groups. Code: 1. Delete existing group (3-use for delete): <record id ="hr.group_hr_user" model ="res.groups" >      <field name ="implied_ids" eval ="[(3, ref('base.group_user'))]" /> </record> 2. Add new group(4-use for append): <record id =...

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...