Visitor (Germany), Laure-Anne Passelecq (lpa) mailing list archives

@api.model def create(self, [...]

by - 04/18/2016 05:54:30

@api.model def create(self, vals): print(self.env['ir.sequence'].next_by_code('code')) print(vals['function']) vals['function']=self.env['ir.sequence'].next_by_code('code') or 'New' if vals.get('kundennummer', 'New') == 'New': vals['kundennummer'] = self.env['ir.sequence'].next_by_code('code') or 'New' result = super(res_partner.Partner, self).create(vals) return result