Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
In recent versions of odoo we have the company_dependent attribute instead of the property definitions....
It seems not to work in One2Many and Many2Many fields.
I see no use of the company_dependent attribute in those kind of fields when I search into the code:
My question is:
Is that supposed to work ? Or should the code raise an Exception in those cases?
Which alternatives do we have ? Implement that by hand with domains ?
Maybe the ORM could check if the related entity has a company_id field and add the restriction to the domain automatically, also it could add the company_id field to the related model or comodel.
The fields marked as company_dependent are transformed internally into old fields.property that relays on ir.property model to store the values and that one only support this types of fields:
'type' : fields.selection([
],'Type', required=True, select=1),
As you see there is no support for One2many or Many2many fields. To do it you could use the combination of the a company_id field on the comodel and an ir.rule record that will restrict the values that you could use in the relation fields depending on the users companies. The record rules will restrict the records for all the users except for admin.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/8/16, 5:44 AM|
|Seen: 681 times|
|Last updated: 4/9/16, 5:27 AM|