Skip to content
Extraits de code Groupes Projets
Valider eb2bd864 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

Update product name in invoice

parent b793d599
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
from . import res_partner from . import res_partner
from . import sale from . import sale
from . import account_invoice from . import account_invoice
from . import account_invoice_line
from . import product from . import product
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class AccountInvoiceLine(models.Model):
_inherit = "account.invoice.line"
def _get_invoice_line_name_from_product(self):
""" Returns the automatic name to give to the invoice line depending on
the product it is linked to.
"""
self.ensure_one()
if not self.product_id:
return ''
invoice_type = self.invoice_id.type
if invoice_type in ('in_invoice', 'in_refund'):
if self.product_id.description_purchase:
return self.product_id.description_purchase
else:
if self.product_id.description_sale:
return self.product_id.description_sale
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