[FIX] account: incorrect Payment Reference

- Create a customer invoice.
- Validate it.
- A payment reference (`invoice_payment_ref`) is given.
- Refund with option 'Full refund and new draft invoice'

The `invoice_payment_ref` field is kept on the draft invoice, while we
want a new reference since it is a new invoice.

opw-2159166

closes odoo/odoo#42832

X-original-commit: 77c28421e6c7711e3d3c39dbece4e2bfa0b26b5c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-01-07 10:53:02 +00:00
parent 2e861cc8ee
commit 8f71f772c7
@@ -73,7 +73,6 @@ class AccountMoveReversal(models.TransientModel):
moves_vals_list = []
for move in moves.with_context(include_business_fields=True):
moves_vals_list.append(move.copy_data({
'invoice_payment_ref': move.name,
'date': self.date or move.date,
})[0])
new_moves = self.env['account.move'].create(moves_vals_list)