|
|
@ -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 |
|
|
|