Odoo Help
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.
Create a related filed from res.company to hr.employee !
Hello,
I have created a boolean filed in Res.company and I want to use the same filed of hr.employee.
Thanks
Hello el mehdi,
First You can add field in res.company using _inherit
You can inherit the hr.employee model and add boolean field which is related to company.
Ex:-
class Company(models.Model):
_inherit = 'res.company'
boolean_field_com = fields.Boolean('Boolean String Company')
class Employees(models.Model):
_inherit = 'hr.employee'
boolean_field_emp = fields.Boolean('Boolean String Employee', related='company_id.boolean_field_com')
Hope it works for you.
Thanks,
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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 11/11/16, 7:44 AM |
Seen: 662 times |
Last updated: 11/15/16, 7:57 AM |
Hello Mehta,
Thanks for the answer.
I try your code
i only have another boolean filed, the fields are not related.Thanks