Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Factures(models.Model):
- 86
- 93
- 94
- 95 _name = 'myname'
- 96 _description = "Generation Factures"
- 98
- 99 client_id = fields.Many2one('res.partner', string="Client",
- 100 ondelete="cascade", index=True)
- 101 services = fields.One2many('serviceupdated', 'id', string="services")
- 102
- 103 description = fields.Text(string="test")
- 104
- 105 @api.onchange('client_id')
- 106 def check_change(self):
- 107 res = {}
- 112 if self.client_id:
- 113 r = []
- 114 r.append({'name': "lool", 'description': "lolbis"})
- 115 r.append({'name': "lool2", 'description': "lolbisibis"})
- 116
- 117 res = {
- 118 'value': {
- 119 'description': "test123",
- 120 'services': r
- 121 }
- 122 }
- 123 self.write(res)
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement