[OU-ADD] account_payment_order: Migration scripts to native payment ref

This adapts the old bank.payment.line records to account.payment records
according the new approach, taking into account if you come from v14
with the refactoring applied.
This commit is contained in:
Pedro M. Baeza
2022-11-07 13:29:45 +01:00
parent ee6b97b665
commit 25533267f4
3 changed files with 181 additions and 10 deletions

View File

@@ -10,6 +10,8 @@ class AccountPayment(models.Model):
payment_order_id = fields.Many2one(comodel_name="account.payment.order")
payment_line_ids = fields.Many2many(comodel_name="account.payment.line")
# Compatibility with previous approach for returns - To be removed on v16
old_bank_payment_line_name = fields.Char()
def _get_default_journal(self):
res = super()._get_default_journal()