mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[MIG] account_payment_order_transfer_journal: Migration to 16.0
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
# Copyright 2022 ACSONE SA/NV
|
||||
# Copyright 2023 Noviat
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Account Payement Order Transfer Journal",
|
||||
"summary": """
|
||||
Add the possibility to book payement order operations on a transfert journal.""",
|
||||
"version": "14.0.1.0.0",
|
||||
Add the possibility to book payment order operations on a transfert journal.""",
|
||||
"version": "16.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
|
||||
"author": "ACSONE SA/NV,Noviat,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/bank-payment",
|
||||
"depends": ["account_payment_order"],
|
||||
"data": [
|
||||
"views/account_journal.xml",
|
||||
"views/account_journal_views.xml",
|
||||
],
|
||||
"demo": [],
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from . import account_journal
|
||||
from . import account_payment_order
|
||||
from . import account_payment_line
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Copyright 2023 Noviat
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountPaymentLine(models.Model):
|
||||
_inherit = "account.payment.line"
|
||||
|
||||
def _prepare_account_payment_vals(self):
|
||||
vals = super()._prepare_account_payment_vals()
|
||||
if self.order_id.journal_id.transfer_journal_id:
|
||||
vals["journal_id"] = self.order_id.journal_id.transfer_journal_id.id
|
||||
return vals
|
||||
@@ -1,15 +0,0 @@
|
||||
# Copyright 2022 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountPaymentOrder(models.Model):
|
||||
|
||||
_inherit = "account.payment.order"
|
||||
|
||||
def _prepare_move(self, bank_lines=None):
|
||||
res = super()._prepare_move(bank_lines=bank_lines)
|
||||
if self.journal_id.transfer_journal_id:
|
||||
res["journal_id"] = self.journal_id.transfer_journal_id.id
|
||||
return res
|
||||
@@ -1 +1,2 @@
|
||||
* Adrien Peiffer <adrien.peiffer@acsone.eu> (https://acsone.eu)
|
||||
* Luc De Meyer <luc.demeyer@noviat.com> (https://noviat.com)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2022 ACSONE SA/NV
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
|
||||
<record model="ir.ui.view" id="account_journal_form_view">
|
||||
<field
|
||||
name="name"
|
||||
>account.journal.form (in account_payment_order_transfer_journal)</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='journal_entries']/group/group" position="before">
|
||||
<group>
|
||||
<field name="transfer_journal_id" />
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>account.journal.form (in account_payment_order_transfer_journal)</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="payment_sequence" position="after">
|
||||
<field name="transfer_journal_id" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user