Skip to content
Extraits de code Groupes Projets
Valider 1ffecaef rédigé par Benjamin - Le Filament's avatar Benjamin - Le Filament
Parcourir les fichiers

[update] inherit onchange product_id on invoice lines

parent 358f03ed
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -24,3 +24,13 @@ class AccountInvoiceLine(models.Model): ...@@ -24,3 +24,13 @@ class AccountInvoiceLine(models.Model):
line.is_downpayment = True line.is_downpayment = True
else: else:
line.is_downpayment = False line.is_downpayment = False
@api.onchange('product_id')
def _onchange_product_id(self):
res = super(AccountInvoiceLine, self)._onchange_product_id()
if not self.product_id:
return res
product = self.product_id
description = "\n" + product.description_sale if product.description_sale else ""
self.name = product.name + description
return res
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter