mirror of
				https://github.com/brain-tec/account_ebics.git
				synced 2025-11-04 07:00:35 +00:00 
			
		
		
		
	[MIG] account_ebics_batch_payment: Migration to 14.0
This commit is contained in:
		@@ -22,8 +22,3 @@ Usage
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Create your Batch Payment and generate the bank file.
 | 
					Create your Batch Payment and generate the bank file.
 | 
				
			||||||
Upload the generated file via the 'EBICS Upload' button on the batch payment.
 | 
					Upload the generated file via the 'EBICS Upload' button on the batch payment.
 | 
				
			||||||
 | 
					 | 
				
			||||||
Known issues / Roadmap
 | 
					 | 
				
			||||||
======================
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 * Add support for multiple EBICS connections.
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
# Copyright 2009-2020 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 Batch Payment via EBICS",
 | 
					    "name": "Upload Batch Payment via EBICS",
 | 
				
			||||||
    "version": "13.0.1.1.0",
 | 
					    "version": "14.0.1.1.0",
 | 
				
			||||||
    "license": "LGPL-3",
 | 
					    "license": "LGPL-3",
 | 
				
			||||||
    "author": "Noviat",
 | 
					    "author": "Noviat",
 | 
				
			||||||
    "category": "Accounting & Finance",
 | 
					    "category": "Accounting & Finance",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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
 | 
				
			||||||
@@ -13,15 +13,16 @@ class AccountBatchPayment(models.Model):
 | 
				
			|||||||
        ctx = self.env.context.copy()
 | 
					        ctx = self.env.context.copy()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        origin = _("Batch Payment") + ": " + self.name
 | 
					        origin = _("Batch Payment") + ": " + self.name
 | 
				
			||||||
        ebics_config = self.env['ebics.config'].search([
 | 
					        ebics_config = self.env["ebics.config"].search(
 | 
				
			||||||
            ('journal_ids', '=', self.journal_id.id),
 | 
					            [
 | 
				
			||||||
            ('state', '=', 'confirm'),
 | 
					                ("journal_ids", "=", self.journal_id.id),
 | 
				
			||||||
        ])
 | 
					                ("state", "=", "confirm"),
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
        if not ebics_config:
 | 
					        if not ebics_config:
 | 
				
			||||||
            raise UserError(_(
 | 
					            raise UserError(
 | 
				
			||||||
                "No active EBICS configuration available "
 | 
					                _("No active EBICS configuration available " "for the selected bank.")
 | 
				
			||||||
                "for the selected bank."
 | 
					            )
 | 
				
			||||||
            ))
 | 
					 | 
				
			||||||
        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(
 | 
				
			||||||
@@ -29,7 +30,7 @@ class AccountBatchPayment(models.Model):
 | 
				
			|||||||
                "default_upload_data": self.export_file,
 | 
					                "default_upload_data": self.export_file,
 | 
				
			||||||
                "default_upload_fname": self.export_filename,
 | 
					                "default_upload_fname": self.export_filename,
 | 
				
			||||||
                "origin": origin,
 | 
					                "origin": origin,
 | 
				
			||||||
                'force_comany': self.journal_id.company_id.id,
 | 
					                "force_comany": self.journal_id.company_id.id,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,10 +7,13 @@
 | 
				
			|||||||
      <field name="model">account.batch.payment</field>
 | 
					      <field name="model">account.batch.payment</field>
 | 
				
			||||||
      <field name="inherit_id" ref="account_batch_payment.view_batch_payment_form" />
 | 
					      <field name="inherit_id" ref="account_batch_payment.view_batch_payment_form" />
 | 
				
			||||||
      <field name="arch" type="xml">
 | 
					      <field name="arch" type="xml">
 | 
				
			||||||
        <button name="validate_batch" position="after">
 | 
					        <button name="validate_batch_button" position="after">
 | 
				
			||||||
          <button name="ebics_upload" type="object"
 | 
					          <button
 | 
				
			||||||
 | 
					                        name="ebics_upload"
 | 
				
			||||||
 | 
					                        type="object"
 | 
				
			||||||
                        attrs="{'invisible': ['|', ('file_generation_enabled', '=', False), ('state', '!=', 'sent')]}"
 | 
					                        attrs="{'invisible': ['|', ('file_generation_enabled', '=', False), ('state', '!=', 'sent')]}"
 | 
				
			||||||
                  string="EBICS Upload"/>
 | 
					                        string="EBICS Upload"
 | 
				
			||||||
 | 
					                    />
 | 
				
			||||||
        </button>
 | 
					        </button>
 | 
				
			||||||
      </field>
 | 
					      </field>
 | 
				
			||||||
    </record>
 | 
					    </record>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user