From 6fcedce834bd204351bfc91da62a76618dd27f0a Mon Sep 17 00:00:00 2001 From: jbm-odoo Date: Wed, 30 Oct 2019 10:47:37 +0000 Subject: [PATCH] [IMP] account: add new move reversal line in wizard model Add new move reversal line in wizard model, those new_move_ids are usefull for the override in helpdesk. Currently, we return a form or a list view according to the number of generated reversed moves. Now, we link the generated moves on the wizard, so that we can link the invoice lines correctly to the helpdesk tickets. Now, the invoice lines are correctly linked only if there is 1 reversed line. id=2017554 closes odoo/odoo#39576 Signed-off-by: Yannick Tivisse (yti) --- addons/account/wizard/account_move_reversal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/wizard/account_move_reversal.py b/addons/account/wizard/account_move_reversal.py index 63208d6469b..d51de2a7e69 100644 --- a/addons/account/wizard/account_move_reversal.py +++ b/addons/account/wizard/account_move_reversal.py @@ -12,6 +12,7 @@ class AccountMoveReversal(models.TransientModel): move_id = fields.Many2one('account.move', string='Journal Entry', domain=[('state', '=', 'posted'), ('type', 'not in', ('out_refund', 'in_refund'))]) + new_move_ids = fields.Many2many('account.move') date = fields.Date(string='Reversal date', default=fields.Date.context_today, required=True) reason = fields.Char(string='Reason') refund_method = fields.Selection(selection=[ @@ -80,6 +81,8 @@ class AccountMoveReversal(models.TransientModel): else: return + self.new_move_ids = new_moves + # Create action. action = { 'name': _('Reverse Moves'),