From cae6c9686510ad659e1bbec4001bc70d16833e50 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 28 Sep 2018 11:53:41 +0200 Subject: [PATCH] [FIX] Travis is failing when test are creating orders via create_from_ui when pos_loyalty is installed --- pos_loyalty/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pos_loyalty/models/pos_order.py b/pos_loyalty/models/pos_order.py index f8eed30e..9645c789 100644 --- a/pos_loyalty/models/pos_order.py +++ b/pos_loyalty/models/pos_order.py @@ -24,7 +24,7 @@ class PosOrder(models.Model): res = super(PosOrder, self).create_from_ui(orders) for order in orders: order_partner = order['data']['partner_id'] - order_points = order['data']['loyalty_points'] + order_points = order['data'].get('loyalty_points', 0) if order_points != 0 and order_partner: partner = self.env['res.partner'].browse(order_partner) partner.loyalty_points += order_points