From fd1f00abf3120930db8ae64e9513e1dd1a2314d6 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 12 Jun 2024 17:06:06 +0200 Subject: [PATCH] [FIX]payment orders - fix context --- account_ebics_batch_payment/__manifest__.py | 2 +- .../models/account_batch_payment.py | 10 +++++++--- account_ebics_payment_order/__manifest__.py | 2 +- .../models/account_payment_order.py | 8 ++++++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/account_ebics_batch_payment/__manifest__.py b/account_ebics_batch_payment/__manifest__.py index cf42961..c8c316f 100644 --- a/account_ebics_batch_payment/__manifest__.py +++ b/account_ebics_batch_payment/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Upload Batch Payment via EBICS", - "version": "16.0.1.0.1", + "version": "16.0.1.0.2", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", diff --git a/account_ebics_batch_payment/models/account_batch_payment.py b/account_ebics_batch_payment/models/account_batch_payment.py index e5fc81a..a93e86e 100644 --- a/account_ebics_batch_payment/models/account_batch_payment.py +++ b/account_ebics_batch_payment/models/account_batch_payment.py @@ -1,4 +1,4 @@ -# Copyright 2009-2023 Noviat. +# Copyright 2009-2024 Noviat. # License LGPL-3 or later (http://www.gnu.org/licenses/lgpl). from odoo import _, models @@ -30,11 +30,15 @@ class AccountBatchPayment(models.Model): "default_upload_data": self.export_file, "default_upload_fname": self.export_filename, "origin": origin, - "force_comany": self.journal_id.company_id.id, } ) - ebics_xfer = self.env["ebics.xfer"].with_context(**ctx).create({}) + ebics_xfer = ( + self.env["ebics.xfer"] + .with_context(**ctx) + .with_company(self.journal_id.company_id) + .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/__manifest__.py b/account_ebics_payment_order/__manifest__.py index a278eaa..3b9b45e 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": "16.0.1.1.1", + "version": "16.0.1.1.2", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", diff --git a/account_ebics_payment_order/models/account_payment_order.py b/account_ebics_payment_order/models/account_payment_order.py index 334cc4d..117e282 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_context(**ctx) + .with_company(self.company_id) + .create({}) + ) ebics_xfer._onchange_ebics_config_id() ebics_xfer._onchange_upload_data() view = self.env.ref("account_ebics.ebics_xfer_view_form_upload")