[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) <yti@odoo.com>
This commit is contained in:
jbm-odoo
2019-11-07 09:22:43 +00:00
committed by Yannick Tivisse
parent 596b3723f2
commit 6fcedce834
@@ -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'),