コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6046 ビュー

Hello, 

I have created a boolean filed in Res.company and I want to use the same filed of  hr.employee.

Thanks 

 

アバター
破棄

Hello Mehta,

 Thanks for the answer.

I try your code

my_filed_emp = fields.Boolean(string='  ',related='company_id.my_filed_com') 
i only have another boolean filed, the fields are not related.

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,



アバター
破棄
関連投稿 返信 ビュー 活動
1
6月 18
3817
1
10月 23
1708
1
3月 15
3559
3
5月 25
1644
1
4月 25
1241