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

Hello everybody, this is my code :

class model1(models.Model):

     _name ='model1'

    name = Char()    

class model2(models.Model):
     _name ='model2'
    name = Char()

class model3(models.Model):

    _name ='model2'

    name = Selection( [('value1', 'value2'), ('value2', 'value2')], required=True)  

     listing = One2many(comodel_name='model1', inverse_name='name')

     @api.onchange('name')

     def name_ongange(self):

         if self.name == 'value1'

             #I want to add all model1 records

         if self.name == 'value2'
             #I want to add all model2 records


If any one can tell me the solution of my code?? thank you

アバター
破棄
関連投稿 返信 ビュー 活動
1
1月 25
1819
2
9月 22
9556
2
4月 22
4603
0
7月 21
7253
1
3月 21
5006