[FIX] lunch: don't merge with other users' orders

1/ As admin, add Lunch Maki to your order
2/ As demo, add Lunch Maki to your order

Admin now has 2 Lunch Makis, demo has none.

closes odoo/odoo#33731

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit is contained in:
Joren Van Onder
2019-05-28 22:16:08 +00:00
parent 86f8be1466
commit decc1b3c1a
+1 -1
View File
@@ -86,7 +86,7 @@ class LunchOrderWizard(models.TransientModel):
sum((wizard.topping_ids_1 | wizard.topping_ids_2 | wizard.topping_ids_3).mapped('price')))
def _get_matching_lines(self):
domain = [('product_id', '=', self.product_id.id), ('date', '=', fields.Date.today()), ('note', '=', self._get_note())]
domain = [('user_id', '=', self.user_id.id), ('product_id', '=', self.product_id.id), ('date', '=', fields.Date.today()), ('note', '=', self._get_note())]
lines = self.env['lunch.order'].search(domain)
return lines.filtered(lambda line: (line.topping_ids_1 | line.topping_ids_2 | line.topping_ids_3) == self.topping_ids_1)