[FIX] lunch: write on order before checking wallet
lunch.cashmove.report only take into account orders that are ordered or confirmed. That means that in action_order we have to set the state to ordered before checking the wallet content. This will then raise the error and rollback the value closes odoo/odoo#33583 Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit is contained in:
@@ -73,8 +73,8 @@ class LunchOrder(models.Model):
|
||||
'To add some money to your wallet, please contact your lunch manager.'))
|
||||
|
||||
def action_order(self):
|
||||
self._check_wallet()
|
||||
self.write({'state': 'ordered'})
|
||||
self._check_wallet()
|
||||
|
||||
def action_confirm(self):
|
||||
self.write({'state': 'confirmed'})
|
||||
|
||||
Reference in New Issue
Block a user