_name = "confirm.auction"
product_id = fields.Char("Product",readonly= True)
customer_auc_id = fields.Many2one("res.user","Customer", readonly = True)
date_bid = fields.Date("Bid Date", readonly = True)
amt_bid = fields.Float("Bid Amount", readonly = True)
conf_auc_id = fields.Many2one("auction","Auction")
---------------------------------------------------------------------------------------------------------
_name = "bid"
auc_id = fields.Char("Auction Id", readonly = True)
product_id = fields.Char("Product",readonly= True)
amount_auc = fields.Float("Amount")
state= fields.Selection([('publish','Publish'), ('cancel','Cancel'), ('done','Done') ],'Status',readonly=True,copy=False,select=True,default='draft')
@api.one
def bid_confirm(self):
date = time.strftime("%Y-%m-%d")
auc = self.env['auction'].search([('auction_id','=',self.auc_id)])
res = self.env['confirm.auction'].create({
'conf_auc_id':auc.id,
'product_id':self.product_id,
'customer_auc_id.id':self.write_uid.id,
'date_bid':date,
'amt_bid':self.amount_auc
})
and if i remove id [ 'customer_auc_id':self.write_uid.id, ] so it is assign [ _unknown ,1 ]
i want to store customer name in m2o field customer_auc_id but it's not assigning correctly.
how to solve this issue?