From 21f8ee011948d63d3e402f2f59d19a78ef076c58 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 28 Sep 2018 14:52:24 +0200 Subject: [PATCH] [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 f2b2d872360 to the _prepare_analytic_distribution_line method Fixes #27281 --- addons/account/models/account_move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c7c7326b788..a45c670150c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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,