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

for example i have three model one is master & two is detail models 

Model A

Model B

Model C

Model A is master Model B & Model C is detail 

i hav filed in Model B type when i change type then i want to apply domain on Model C 
how i can do this any help 

アバター
破棄
最善の回答

Hi Usman,

Try following Code

class MasterClass(models.Model):
        _name = 'master.class'

         o2m_f1 = fields.One2Many('o2m.table1', 'field')
         o2m_f2 = fields.One2Many('o2m.table2', 'field')

Class O2mTable1(models.Model):
         _name = 'o2m.table1'

         name = fields.Char()
         field = fields.Many2one('master.class')

         @api.onchange('name')
         def trigger_o2m_change():
                # Your Function Info.


Class O2mTable2(models.Model):
         _name = 'o2m.table2'

         name = fields.Char()
         field = fields.Many2one('master.class')

         @api.onchange('name')
         def trigger_o2m_change():
            # Your Function Info.

Thanks

アバター
破棄
関連投稿 返信 ビュー 活動
7
3月 25
7533
3
5月 24
4302
3
11月 24
44510
1
4月 23
4477
7
4月 23
18521