mirror of
				https://github.com/brain-tec/account_ebics.git
				synced 2025-11-03 22:50:59 +00:00 
			
		
		
		
	[MIG] account_ebics_payment_order: Migration to 15.0
This commit is contained in:
		@@ -338,7 +338,22 @@ class EbicsXfer(models.TransientModel):
 | 
				
			|||||||
            OrderID = False
 | 
					            OrderID = False
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                order_type = self.order_type
 | 
					                order_type = self.order_type
 | 
				
			||||||
                if order_type == "FUL":
 | 
					                if order_type == "BTU":
 | 
				
			||||||
 | 
					                    btf = BusinessTransactionFormat(
 | 
				
			||||||
 | 
					                        ef_format.btf_service,
 | 
				
			||||||
 | 
					                        ef_format.btf_message,
 | 
				
			||||||
 | 
					                        scope=ef_format.btf_scope or None,
 | 
				
			||||||
 | 
					                        option=ef_format.btf_option or None,
 | 
				
			||||||
 | 
					                        container=ef_format.btf_container or None,
 | 
				
			||||||
 | 
					                        version=ef_format.btf_version or None,
 | 
				
			||||||
 | 
					                        variant=ef_format.btf_variant or None,
 | 
				
			||||||
 | 
					                        format=ef_format.btf_format or None,
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                    kwargs = {}
 | 
				
			||||||
 | 
					                    if self.test_mode:
 | 
				
			||||||
 | 
					                        kwargs["TEST"] = "TRUE"
 | 
				
			||||||
 | 
					                    client.BTU(btf, upload_data, **kwargs)
 | 
				
			||||||
 | 
					                elif order_type == "FUL":
 | 
				
			||||||
                    kwargs = {}
 | 
					                    kwargs = {}
 | 
				
			||||||
                    bank = self.ebics_config_id.journal_ids[0].bank_id
 | 
					                    bank = self.ebics_config_id.journal_ids[0].bank_id
 | 
				
			||||||
                    cc = bank.country.code
 | 
					                    cc = bank.country.code
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -74,7 +74,7 @@
 | 
				
			|||||||
          <field name="order_type" />
 | 
					          <field name="order_type" />
 | 
				
			||||||
          <field
 | 
					          <field
 | 
				
			||||||
                        name="test_mode"
 | 
					                        name="test_mode"
 | 
				
			||||||
                        attrs="{'invisible': [('order_type', '!=', 'FUL')]}"
 | 
					                        attrs="{'invisible': [('order_type', 'not in', ('FUL', 'BTU'))]}"
 | 
				
			||||||
                    />
 | 
					                    />
 | 
				
			||||||
          <field name="allowed_format_ids" invisible="1" />
 | 
					          <field name="allowed_format_ids" invisible="1" />
 | 
				
			||||||
        </group>
 | 
					        </group>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,15 +1,16 @@
 | 
				
			|||||||
# Copyright 2009-2021 Noviat.
 | 
					# Copyright 2009-2022 Noviat.
 | 
				
			||||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
 | 
					# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    "name": "Upload Payment Order via EBICS",
 | 
					    "name": "Upload Payment Order via EBICS",
 | 
				
			||||||
    "version": "14.0.1.0.0",
 | 
					    "version": "15.0.1.0.0",
 | 
				
			||||||
    "license": "LGPL-3",
 | 
					    "license": "LGPL-3",
 | 
				
			||||||
    "author": "Noviat",
 | 
					    "author": "Noviat",
 | 
				
			||||||
 | 
					    "website": "https://www.noviat.com",
 | 
				
			||||||
    "category": "Accounting & Finance",
 | 
					    "category": "Accounting & Finance",
 | 
				
			||||||
    "depends": ["account_ebics", "account_payment_order"],
 | 
					    "depends": ["account_ebics", "account_payment_order"],
 | 
				
			||||||
    "data": [
 | 
					    "data": [
 | 
				
			||||||
        "views/account_payment_order.xml",
 | 
					        "views/account_payment_order_views.xml",
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "installable": True,
 | 
					    "installable": True,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
# Copyright 2009-2021 Noviat.
 | 
					# Copyright 2009-2022 Noviat.
 | 
				
			||||||
# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
 | 
					# License LGPL-3 or later (http://www.gnu.org/licenses/lpgl).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from odoo import _, models
 | 
					from odoo import _, models
 | 
				
			||||||
@@ -10,7 +10,6 @@ class AccountPaymentOrder(models.Model):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def ebics_upload(self):
 | 
					    def ebics_upload(self):
 | 
				
			||||||
        self.ensure_one()
 | 
					        self.ensure_one()
 | 
				
			||||||
        ctx = self._context.copy()
 | 
					 | 
				
			||||||
        attach = self.env["ir.attachment"].search(
 | 
					        attach = self.env["ir.attachment"].search(
 | 
				
			||||||
            [("res_model", "=", self._name), ("res_id", "=", self.id)]
 | 
					            [("res_model", "=", self._name), ("res_id", "=", self.id)]
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
@@ -45,6 +44,7 @@ class AccountPaymentOrder(models.Model):
 | 
				
			|||||||
                        "for the selected bank."
 | 
					                        "for the selected bank."
 | 
				
			||||||
                    )
 | 
					                    )
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
 | 
					            ctx = self.env.context.copy()
 | 
				
			||||||
            if len(ebics_config) == 1:
 | 
					            if len(ebics_config) == 1:
 | 
				
			||||||
                ctx["default_ebics_config_id"] = ebics_config.id
 | 
					                ctx["default_ebics_config_id"] = ebics_config.id
 | 
				
			||||||
            ctx.update(
 | 
					            ctx.update(
 | 
				
			||||||
@@ -55,7 +55,7 @@ class AccountPaymentOrder(models.Model):
 | 
				
			|||||||
                    "force_comany": self.company_id.id,
 | 
					                    "force_comany": self.company_id.id,
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            ebics_xfer = self.env["ebics.xfer"].with_context(ctx).create({})
 | 
					            ebics_xfer = self.env["ebics.xfer"].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()
 | 
				
			||||||
            ebics_xfer._onchange_format_id()
 | 
					            ebics_xfer._onchange_format_id()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,5 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="utf-8" ?>
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
<odoo>
 | 
					<odoo>
 | 
				
			||||||
  <data>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <record id="account_payment_order_form" model="ir.ui.view">
 | 
					    <record id="account_payment_order_form" model="ir.ui.view">
 | 
				
			||||||
      <field name="name">account.payment.order.form</field>
 | 
					      <field name="name">account.payment.order.form</field>
 | 
				
			||||||
@@ -9,15 +8,14 @@
 | 
				
			|||||||
      <field name="arch" type="xml">
 | 
					      <field name="arch" type="xml">
 | 
				
			||||||
        <button name="open2generated" position="after">
 | 
					        <button name="open2generated" position="after">
 | 
				
			||||||
          <button
 | 
					          <button
 | 
				
			||||||
                        name="ebics_upload"
 | 
					                    name="ebics_upload"
 | 
				
			||||||
                        type="object"
 | 
					                    type="object"
 | 
				
			||||||
                        states="generated"
 | 
					                    states="generated"
 | 
				
			||||||
                        string="EBICS Upload"
 | 
					                    string="EBICS Upload"
 | 
				
			||||||
                        class="oe_highlight"
 | 
					                    class="oe_highlight"
 | 
				
			||||||
                    />
 | 
					                />
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
      </field>
 | 
					      </field>
 | 
				
			||||||
    </record>
 | 
					    </record>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  </data>
 | 
					 | 
				
			||||||
</odoo>
 | 
					</odoo>
 | 
				
			||||||
		Reference in New Issue
	
	Block a user