summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2019-05-22 14:44:35 +0000
committerRomainLibert <rli@odoo.com>2019-05-22 14:48:34 +0000
commitf01ec63249b46620e6a52066ca985646b28aef18 (patch)
treeaa543f10475c5c2e8cfcde6f83c5ab9720c48068
parent89de96410a1463bbafaa27f4c5bef0122ed747c1 (diff)
[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>
-rw-r--r--addons/lunch/models/lunch_order.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/lunch/models/lunch_order.py b/addons/lunch/models/lunch_order.py
index 8ad99e9f940..67d5dc182e9 100644
--- a/addons/lunch/models/lunch_order.py
+++ b/addons/lunch/models/lunch_order.py
@@ -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'})