[FIX] sale: avoid creating analytic lines for section & notes.

Currently, When we create an invoice from a sale order containing some notes or sections.
The analytic account from the sale order is set on the invoice/move line.
During the creation of analytic lines, a line is created from the section/note line.

This commit makes no analytic line is created for section/notes.

closes odoo/odoo#100989

X-original-commit: a1bff32113bb0b551cd62efea5030c8f3bd4d1de
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Adrien Peiffer
2022-09-23 14:37:12 +02:00
committed by Victor Feyens
parent 4ee367d6ef
commit 4ca7b89b31
+1 -1
View File
@@ -1079,7 +1079,7 @@ class SaleOrderLine(models.Model):
'is_downpayment': self.is_downpayment,
}
analytic_account_id = self.order_id.analytic_account_id.id
if analytic_account_id:
if analytic_account_id and not self.display_type:
res['analytic_distribution'] = res['analytic_distribution'] or {}
if self.analytic_distribution:
res['analytic_distribution'][analytic_account_id] = self.analytic_distribution.get(analytic_account_id, 0) + 100