[IMP]EBICS File Format on Payment Mode

This commit is contained in:
Luc De Meyer 2024-05-12 17:04:49 +02:00
parent d8498ee0c2
commit 8892cc71cf
6 changed files with 30 additions and 8 deletions

View File

@ -16,9 +16,13 @@ This module depends upon the following modules (cf. apps.odoo.com):
- account_ebics - account_ebics
- account_payment_order - account_payment_order
Configuration
=============
Set the EBICS File Format on your Payment Modes.
Usage Usage
===== =====
Create your Payment Order and generate the bank file. Create your Payment Order and generate the bank file.
Upload the generated file via the 'EBICS Upload' button on the payment order. Upload the generated file via the 'EBICS Upload' button on the payment order.

View File

@ -3,7 +3,7 @@
{ {
"name": "Upload Payment Order via EBICS", "name": "Upload Payment Order via EBICS",
"version": "17.0.1.0.1", "version": "17.0.1.1.0",
"license": "LGPL-3", "license": "LGPL-3",
"author": "Noviat", "author": "Noviat",
"website": "https://www.noviat.com", "website": "https://www.noviat.com",
@ -11,6 +11,7 @@
"depends": ["account_ebics", "account_payment_order"], "depends": ["account_ebics", "account_payment_order"],
"data": [ "data": [
"views/account_payment_order_views.xml", "views/account_payment_order_views.xml",
"views/account_payment_mode_views.xml",
], ],
"images": ["static/description/cover.png"], "images": ["static/description/cover.png"],
"installable": True, "installable": True,

View File

@ -1 +1,2 @@
from . import account_payment_mode
from . import account_payment_order from . import account_payment_order

View File

@ -0,0 +1,15 @@
# Copyright 2009-2024 Noviat.
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
from odoo import fields, models
class AccountPaymentMode(models.Model):
_inherit = "account.payment.mode"
ebics_format_id = fields.Many2one(
comodel_name="ebics.file.format",
string="EBICS File Format",
domain="[('type', '=', 'up')]",
help="Select EBICS File Format to upload.",
)

View File

@ -63,10 +63,14 @@ class AccountPaymentOrder(models.Model):
"default_upload_data": attach.datas, "default_upload_data": attach.datas,
"default_upload_fname": attach.name, "default_upload_fname": attach.name,
"origin": origin, "origin": origin,
"force_company": self.company_id.id,
} }
) )
ebics_xfer = self.env["ebics.xfer"].with_context(**ctx).create({}) ebics_xfer = (
self.env["ebics.xfer"]
.with_company(self.company_id)
.with_context(**ctx)
.create({})
)
ebics_xfer._onchange_ebics_config_id() ebics_xfer._onchange_ebics_config_id()
ebics_xfer._onchange_upload_data() ebics_xfer._onchange_upload_data()
view = self.env.ref("account_ebics.ebics_xfer_view_form_upload") view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")

View File

@ -7,10 +7,7 @@
<field name="inherit_id" ref="account_payment_mode.account_payment_mode_form" /> <field name="inherit_id" ref="account_payment_mode.account_payment_mode_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="payment_type" position="after"> <field name="payment_type" position="after">
<field <field name="ebics_format_id" invisible="not payment_order_ok" />
name="ebics_format_id"
attrs="{'invisible': [('payment_order_ok', '=', False)]}"
/>
</field> </field>
</field> </field>
</record> </record>