diff --git a/account_ebics_payment_order/README.rst b/account_ebics_payment_order/README.rst index 2bb94ee..571a0fc 100644 --- a/account_ebics_payment_order/README.rst +++ b/account_ebics_payment_order/README.rst @@ -16,9 +16,13 @@ This module depends upon the following modules (cf. apps.odoo.com): - account_ebics - account_payment_order +Configuration +============= + +Set the EBICS File Format on your Payment Modes. + Usage ===== Create your Payment Order and generate the bank file. Upload the generated file via the 'EBICS Upload' button on the payment order. - diff --git a/account_ebics_payment_order/__manifest__.py b/account_ebics_payment_order/__manifest__.py index 88c8fce..9e498ba 100644 --- a/account_ebics_payment_order/__manifest__.py +++ b/account_ebics_payment_order/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Upload Payment Order via EBICS", - "version": "17.0.1.0.1", + "version": "17.0.1.1.0", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com", @@ -11,6 +11,7 @@ "depends": ["account_ebics", "account_payment_order"], "data": [ "views/account_payment_order_views.xml", + "views/account_payment_mode_views.xml", ], "images": ["static/description/cover.png"], "installable": True, diff --git a/account_ebics_payment_order/models/__init__.py b/account_ebics_payment_order/models/__init__.py index 429f032..72b2653 100644 --- a/account_ebics_payment_order/models/__init__.py +++ b/account_ebics_payment_order/models/__init__.py @@ -1 +1,2 @@ +from . import account_payment_mode from . import account_payment_order diff --git a/account_ebics_payment_order/models/account_payment_mode.py b/account_ebics_payment_order/models/account_payment_mode.py new file mode 100644 index 0000000..92a9fc4 --- /dev/null +++ b/account_ebics_payment_order/models/account_payment_mode.py @@ -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.", + ) diff --git a/account_ebics_payment_order/models/account_payment_order.py b/account_ebics_payment_order/models/account_payment_order.py index 334cc4d..14bfa7d 100644 --- a/account_ebics_payment_order/models/account_payment_order.py +++ b/account_ebics_payment_order/models/account_payment_order.py @@ -63,10 +63,14 @@ class AccountPaymentOrder(models.Model): "default_upload_data": attach.datas, "default_upload_fname": attach.name, "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_upload_data() view = self.env.ref("account_ebics.ebics_xfer_view_form_upload") diff --git a/account_ebics_payment_order/views/account_payment_mode.xml b/account_ebics_payment_order/views/account_payment_mode_views.xml similarity index 74% rename from account_ebics_payment_order/views/account_payment_mode.xml rename to account_ebics_payment_order/views/account_payment_mode_views.xml index 76d66e5..9aeafa5 100644 --- a/account_ebics_payment_order/views/account_payment_mode.xml +++ b/account_ebics_payment_order/views/account_payment_mode_views.xml @@ -7,10 +7,7 @@ - +