From afba8cec23bd5f803d26c196beeb73467c7743aa Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 11 Apr 2016 13:39:22 +0200 Subject: [PATCH] [FIX] account: partner_id field in account.move From 94ed4ce8c8354b432d9d5c90c2f4631347fb4398 The original issue is the following: - Go to the journal item creation - Choose a partner - Add a line => the partner on the journal item is removed This is because `partner_id` on the account move is a related to `partner_id` on the account move lines. This is likely to cause errors during the manual encoding of a journal item, since the relation will link the partner of the account move to the partner of the first account move line only. opw:672354 --- addons/account/models/account_move.py | 2 +- addons/account/views/account_view.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index fcc0460691a..042264b5959 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -85,7 +85,7 @@ class AccountMove(models.Model): 'in \'Posted\' status.') line_ids = fields.One2many('account.move.line', 'move_id', string='Journal Items', states={'posted': [('readonly', True)]}, copy=True) - partner_id = fields.Many2one('res.partner', related='line_ids.partner_id', string="Partner", store=True, states={'posted': [('readonly', True)]}) + partner_id = fields.Many2one('res.partner', related='line_ids.partner_id', string="Partner", store=True, readonly=True) amount = fields.Monetary(compute='_amount_compute', store=True) narration = fields.Text(string='Internal Note') company_id = fields.Many2one('res.company', related='journal_id.company_id', string='Company', store=True, readonly=True, diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 1f681256ef2..4c3ef0eb1c5 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1262,6 +1262,7 @@ +