my question is how to update the field until action button
Here's my code
if self.partner_id.credit_limit != 0.00 and self.is_checked == True:
if self.amount_total > available_credit:
self.write({'state_block':2})
msg = 'La commande ne peut pas être confirmée, le client a atteint sa limite de crédit.\
La commande ne peut être confirmée que suite à un payment ou dérogation par le responsable commerciale,\
Merci d"informer le responsable commerciale'
raise Warning(_(msg))
return False
else:
return True
You can raise warning when the user clicks the button (Front-end), using the confirm
attribute. In this case you can't do calculations and the warning is always raised.
check this question
if you need to do some calculations and decide if a warning should be raised or not, you must use a Wizard, your workflow should be as following:
Also check this question