I am using odoo community version 12
I tried creating two different Id's using two different create functions in a single model. But, it generates only one of them at a time.
bill_num=fields.Char(string='Bill Id',Translate=True, readonly=True)
class orders(models.Model):
@api.model
def create(self, vals):
x = self.env['ir.sequence'].next_by_code('pickabite.orders') or '/'
vals['bill_num'] = x
return super(orders,self).create(vals)
#order id generation
order_id = fields.Char(string='Order Id', Translate= True ,
readonly = True)
@api.model
def create(self, vals):
x = self.env['ir.sequence'].next_by_code('pickabite.orders') or '/'
vals['order_id'] = x
return super(orders,self).create(vals)
Why would you want to do that? You can do all your logic in one create function, no?