mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[REF] account_banking_pain_base: Adapt module to native payment refactoring
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Copyright 2013-2016 Akretion - Alexis de Lattre
|
||||
# Copyright 2014-2017 Tecnativa - Pedro M. Baeza
|
||||
# Copyright 2016 Tecnativa - Antonio Espinosa
|
||||
# Copyright 2021 Tecnativa - Carlos Roca
|
||||
# Copyright 2014-2022 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
@@ -18,7 +18,6 @@
|
||||
"security/security.xml",
|
||||
"views/account_payment_line.xml",
|
||||
"views/account_payment_order.xml",
|
||||
"views/bank_payment_line_view.xml",
|
||||
"views/account_payment_mode.xml",
|
||||
"views/res_config_settings.xml",
|
||||
"views/account_payment_method.xml",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from . import account_payment_line
|
||||
from . import account_payment_order
|
||||
from . import bank_payment_line
|
||||
from . import account_payment_mode
|
||||
from . import res_company
|
||||
from . import res_config_settings
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Copyright 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2021 Tecnativa - Carlos Roca
|
||||
# Copyright 2014-2022 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountPaymentLine(models.Model):
|
||||
@@ -173,3 +173,10 @@ class AccountPaymentLine(models.Model):
|
||||
communication_type = fields.Selection(
|
||||
selection_add=[("ISO", "ISO")], ondelete={"ISO": "cascade"}
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _get_payment_line_grouping_fields(self):
|
||||
"""Add specific PAIN fields to the grouping criteria."""
|
||||
res = super()._get_payment_line_grouping_fields()
|
||||
res += ["priority", "local_instrument", "category_purpose", "purpose"]
|
||||
return res
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
|
||||
# Copyright 2016 Antiun Ingenieria S.L. - Antonio Espinosa
|
||||
# Copyright 2021 Tecnativa - Carlos Roca
|
||||
# Copyright 2014-2022 Tecnativa - Pedro M. Baeza
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
import logging
|
||||
@@ -610,11 +610,12 @@ class AccountPaymentOrder(models.Model):
|
||||
@api.model
|
||||
def generate_remittance_info_block(self, parent_node, line, gen_args):
|
||||
remittance_info = etree.SubElement(parent_node, "RmtInf")
|
||||
if line.communication_type == "normal":
|
||||
communication_type = line.payment_line_ids[:1].communication_type
|
||||
if communication_type == "normal":
|
||||
remittance_info_unstructured = etree.SubElement(remittance_info, "Ustrd")
|
||||
remittance_info_unstructured.text = self._prepare_field(
|
||||
"Remittance Unstructured Information",
|
||||
"line.communication",
|
||||
"line.payment_reference",
|
||||
{"line": line},
|
||||
140,
|
||||
gen_args=gen_args,
|
||||
@@ -636,7 +637,7 @@ class AccountPaymentOrder(models.Model):
|
||||
creditor_ref_info_type_issuer = etree.SubElement(
|
||||
creditor_ref_info_type, "Issr"
|
||||
)
|
||||
creditor_ref_info_type_issuer.text = line.communication_type
|
||||
creditor_ref_info_type_issuer.text = communication_type
|
||||
creditor_reference = etree.SubElement(
|
||||
creditor_ref_information, "CdtrRef"
|
||||
)
|
||||
@@ -655,13 +656,13 @@ class AccountPaymentOrder(models.Model):
|
||||
creditor_ref_info_type_issuer = etree.SubElement(
|
||||
creditor_ref_info_type, "Issr"
|
||||
)
|
||||
creditor_ref_info_type_issuer.text = line.communication_type
|
||||
creditor_ref_info_type_issuer.text = communication_type
|
||||
|
||||
creditor_reference = etree.SubElement(creditor_ref_information, "Ref")
|
||||
|
||||
creditor_reference.text = self._prepare_field(
|
||||
"Creditor Structured Reference",
|
||||
"line.communication",
|
||||
"line.payment_reference",
|
||||
{"line": line},
|
||||
35,
|
||||
gen_args=gen_args,
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Copyright 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2021 Tecnativa - Carlos Roca
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class BankPaymentLine(models.Model):
|
||||
_inherit = "bank.payment.line"
|
||||
|
||||
priority = fields.Selection(related="payment_line_ids.priority", string="Priority")
|
||||
local_instrument = fields.Selection(
|
||||
related="payment_line_ids.local_instrument", string="Local Instrument"
|
||||
)
|
||||
category_purpose = fields.Selection(
|
||||
related="payment_line_ids.category_purpose", string="Category Purpose"
|
||||
)
|
||||
purpose = fields.Selection(related="payment_line_ids.purpose")
|
||||
|
||||
@api.model
|
||||
def same_fields_payment_line_and_bank_payment_line(self):
|
||||
res = super().same_fields_payment_line_and_bank_payment_line()
|
||||
res += ["priority", "local_instrument", "category_purpose", "purpose"]
|
||||
return res
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="bank_payment_line_form" model="ir.ui.view">
|
||||
<field name="name">pain.base.bank.payment.line.form</field>
|
||||
<field name="model">bank.payment.line</field>
|
||||
<field name="inherit_id" ref="account_payment_order.bank_payment_line_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_bank_id" position="after">
|
||||
<field name="priority" />
|
||||
<field name="local_instrument" />
|
||||
<field name="category_purpose" />
|
||||
<field name="purpose" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
<record id="bank_payment_line_tree" model="ir.ui.view">
|
||||
<field name="name">pain.base.bank.payment.line.tree</field>
|
||||
<field name="model">bank.payment.line</field>
|
||||
<field name="inherit_id" ref="account_payment_order.bank_payment_line_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="communication" position="after">
|
||||
<field name="priority" optional="hide" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user