[FIX] sale_coupon: can duplicate sale order lines

Fix the commit a42c27f99e0061b7c4f6597e4 which inverts the initial
filter. The change remove all sale order lines for the simple order
create in the backend.

opw-1819977
This commit is contained in:
Christophe Matthieu
2018-03-13 12:53:31 +01:00
committed by Nicolas Martinelli
parent 48a38e15ce
commit 75f39e07b2
+2 -3
View File
@@ -37,9 +37,8 @@ class SaleOrder(models.Model):
order._update_existing_reward_lines()
def copy(self, default=None):
order = super(SaleOrder, self).copy(dict(default or {}, order_line=False))
for line in self._get_reward_lines():
line.copy({'order_id': order.id})
order = super(SaleOrder, self).copy(default)
order._get_reward_lines().unlink()
order.with_context(sale_coupon_no_loop=False)._create_new_no_code_promo_reward_lines()
return order