Skip to content

Commit

Permalink
[MIG] account_invoice_merge_payment: Migration to 16.0 (from 12.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
louck committed Oct 18, 2024
1 parent 49a178c commit 8d412ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion account_invoice_merge_payment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"category": "Invoicing & Payments",
"version": "12.0.1.0.0",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": [
"account_invoice_merge",
Expand Down
2 changes: 1 addition & 1 deletion account_invoice_merge_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import account_invoice
from . import account_move
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
from odoo import api, models


class AccountInvoice(models.Model):
class AccountMove(models.Model):

_inherit = "account.invoice"
_inherit = "account.move"

@api.model
def _get_invoice_key_cols(self):
return super(AccountInvoice, self)._get_invoice_key_cols() + [
"payment_mode_id",
]
return super()._get_invoice_key_cols() + ["payment_mode_id"]

@api.model
def _get_first_invoice_fields(self, invoice):
res = super(AccountInvoice, self)._get_first_invoice_fields(invoice)
res = super()._get_first_invoice_fields(invoice)
res.update({"payment_mode_id": invoice.payment_mode_id.id})
return res
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def setUp(self):
self.par_model = self.env["res.partner"]
self.context = self.env["res.users"].context_get()
self.acc_model = self.env["account.account"]
self.inv_model = self.env["account.invoice"]
self.inv_line_model = self.env["account.invoice.line"]
self.inv_model = self.env["account.move"]
self.inv_line_model = self.env["account.move.line"]
self.wiz = self.env["invoice.merge"]
self.payment_mode_model = self.env["account.payment.mode"]
self.journal_model = self.env["account.journal"]
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_account_invoice_merge_same_payment_mode(self):

wiz_id = self.wiz.with_context(
active_ids=[self.invoice1.id, self.invoice2.id],
active_model="account.invoice",
active_model="account.move",
).create({})
wiz_id.fields_view_get()
wiz_id.merge_invoices()
Expand All @@ -105,7 +105,7 @@ def test_account_invoice_merge_diff_payment_mode(self):
)
wiz_id = self.wiz.with_context(
active_ids=[self.invoice1.id, self.invoice3.id],
active_model="account.invoice",
active_model="account.move",
).create({})
with self.assertRaises(UserError):
wiz_id.fields_view_get()

0 comments on commit 8d412ee

Please sign in to comment.