class sales_auction(models.Model):
_name = "sales.auction"
auction_id = fields.Char("Auction Number")
product_auc_id = fields.Many2one("product.product","Product")
start_auc_date = fields.Date("Auction Start Date")
end_auc_date = fields.Date("Auction End Date")
product_auc_id = fields.Many2one("product.product","Product")
initial_price = fields.Float("Minimum Price")
buy_now_price = fields.Float("Maximum Price")
no_of_bids = fields.Integer("No. of Bids Receive")
seller_name = fields.Char("Seller Name")
bid_multiples = fields.Integer("Bid Multiples")
state= fields.Selection([('draft','Draft'), ('confirm','Confirm'), ('done','Done') ],'Status',readonly=True,copy=False,select=True) customer_bid_id = fields.One2many("customer.auction","product_id","Customer")
@api.model def create(self, vals):
vals['auction_id'] = self.env['ir.sequence'].get('sales.auction')
return super(sales_auction, self).create(vals)
here i want to create auction_id it's auto increment field when create a record
id like = AUC00001 , AUC00002. in this order