跳至内容
菜单
此问题已终结
3667 查看

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
1823
2
9月 22
9560
2
4月 22
4606
0
7月 21
7260
1
3月 21
5008