From cd77219cbd14929c8035de0a795ffd75c625cb4c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 12 Oct 2017 11:22:03 +0200 Subject: [PATCH] [FIX] account: Duplicating journal entries When duplictating a Journal Entry that has been created from a new payment (accounting/purchases/payments/create), the new copy of the Journal Entry also duplicated the already existent relationship (link) to the payment, causing possible future conflicts in functionalities like reports, payments, reconciliations, among others. opw:775151 --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 4458152f940..2c04fcd283f 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -385,7 +385,7 @@ class AccountMoveLine(models.Model): help="The move of this entry line.", index=True, required=True, auto_join=True) narration = fields.Text(related='move_id.narration', string='Narration') ref = fields.Char(related='move_id.ref', string='Reference', store=True, copy=False, index=True) - payment_id = fields.Many2one('account.payment', string="Originator Payment", help="Payment that created this entry") + payment_id = fields.Many2one('account.payment', string="Originator Payment", help="Payment that created this entry", copy=False) statement_id = fields.Many2one('account.bank.statement', string='Statement', help="The bank statement used for bank reconciliation", index=True, copy=False) reconciled = fields.Boolean(compute='_amount_residual', store=True)