[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:
RomainLibert
2019-05-22 14:48:34 +00:00
parent 89de96410a
commit f01ec63249
+1 -1
View File
@@ -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'})