[FIX] account: fallback for entries with no name

The name of an account.move.line is not mandatory
If a line with no name but analytic tags is posted, the name for the analytic
line should be computed differently (the name of an anlytic line is required).

Apply changes from f2b2d87236 to the _prepare_analytic_distribution_line method

Fixes #27281
This commit is contained in:
Martin Trigaux
2018-09-28 14:55:13 +02:00
parent bedb3a1db0
commit 21f8ee0119
+2 -1
View File
@@ -1150,8 +1150,9 @@ class AccountMoveLine(models.Model):
"""
self.ensure_one()
amount = -self.balance * distribution.percentage / 100.0
default_name = self.name or (self.ref or '/' + ' -- ' + (self.partner_id and self.partner_id.name or '/'))
return {
'name': self.name,
'name': default_name,
'date': self.date,
'account_id': distribution.account_id.id,
'partner_id': self.partner_id.id,