Recompute line data when do signal_login (taxes,...)

#039916
This commit is contained in:
Raimon Esteve 2020-01-29 13:44:14 +01:00
parent 8878661b14
commit b4da9536ec
1 changed files with 6 additions and 0 deletions

View File

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