Hello ,
I want to send and display a customer field in sale order line
Currently my field is correctly set in the sale order line by onchange but when I click on the save button of the order line the field becomes empty.
Here is my code below :
class Sale_order_line(models.Model):
_name = 'sale.order.line'
_inherit = 'sale.order.line'
myfield= fields.Char("taille")
@api.onchange('myfield')
def onchange_taille(self):
if self.order_partner_id.my_customerfield:
values = {
'myfield': self.order_partner_id.my_customerfield and self.order_partner_id.my_customerfield or False,
}
self.update(values)
Can anyone help me please?
Thank you
try to give as myfield= fields.Char("taille",store="True")
Thank you.I have already tried it without success