From b4da9536ec08961d28570a68403b5c9ba180cd75 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Wed, 29 Jan 2020 13:44:14 +0100 Subject: [PATCH] Recompute line data when do signal_login (taxes,...) #039916 --- galatea.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/galatea.py b/galatea.py index 237b0b9..9963fc4 100644 --- a/galatea.py +++ b/galatea.py @@ -86,6 +86,9 @@ class GalateaUser(metaclass=PoolMeta): to_save = [] with Transaction().set_context(context): for line in lines: + if not line.party: + line.party = user.party + prices = Product.get_sale_price([line.product], line.quantity or 0) price = prices[line.product.id] @@ -95,6 +98,9 @@ class GalateaUser(metaclass=PoolMeta): else: line.unit_price = price + # recalculate line data (taxes,...) + line.on_change_product() + to_save.append(line) if to_save: