mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-11-06 10:00:39 +00:00
[18.0][IMP] pre-commit updates
This commit is contained in:
1 parent
c29b3fd1a1
commit
94538825e1
35 files changed
+85
-100
No files matched your search
@@ -26,7 +26,6 @@
|
|||||||
"wizards/ebics_admin_order.xml",
|
"wizards/ebics_admin_order.xml",
|
||||||
"views/menu.xml",
|
"views/menu.xml",
|
||||||
],
|
],
|
||||||
"installable": True,
|
|
||||||
"application": True,
|
"application": True,
|
||||||
"external_dependencies": {
|
"external_dependencies": {
|
||||||
"python": [
|
"python": [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo noupdate="1">
|
<odoo noupdate="1">
|
||||||
<!-- Download formats -->
|
<!-- Download formats -->
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from openupgradelib import openupgrade # pylint: disable=W7936
|
from openupgradelib import openupgrade # pylint: disable=E0401
|
||||||
|
|
||||||
|
|
||||||
@openupgrade.migrate()
|
@openupgrade.migrate()
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ class AccountJournal(models.Model):
|
|||||||
comodel_name="ebics.config",
|
comodel_name="ebics.config",
|
||||||
relation="account_journal_ebics_config_rel",
|
relation="account_journal_ebics_config_rel",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
string="Ebics Configs",
|
string="EBICS Configs",
|
||||||
)
|
)
|
||||||
ebics_config_id = fields.Many2one(
|
ebics_config_id = fields.Many2one(
|
||||||
comodel_name="ebics.config",
|
comodel_name="ebics.config",
|
||||||
compute="_compute_ebics_config_id",
|
compute="_compute_ebics_config_id",
|
||||||
compute_sudo=True,
|
compute_sudo=True,
|
||||||
string="Ebics Config",
|
string="EBICS Config",
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends("ebics_config_ids")
|
@api.depends("ebics_config_ids")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import re
|
|||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__) # lint-ignore=unused-logger
|
||||||
|
|
||||||
|
|
||||||
class EbicsConfig(models.Model):
|
class EbicsConfig(models.Model):
|
||||||
@@ -160,13 +160,12 @@ class EbicsConfig(models.Model):
|
|||||||
for rec in self:
|
for rec in self:
|
||||||
rec.company_ids = rec.journal_ids.mapped("company_id")
|
rec.company_ids = rec.journal_ids.mapped("company_id")
|
||||||
|
|
||||||
def unlink(self):
|
@api.ondelete(at_uninstall=False)
|
||||||
for ebics_config in self:
|
def _unlink_except_active(self):
|
||||||
if ebics_config.state == "active":
|
if any(rec.state == "active" for rec in self):
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._("You cannot remove active EBICS configurations.")
|
self.env._("You cannot remove active EBICS configurations.")
|
||||||
)
|
)
|
||||||
return super().unlink()
|
|
||||||
|
|
||||||
def set_to_draft(self):
|
def set_to_draft(self):
|
||||||
return self.write({"state": "draft"})
|
return self.write({"state": "draft"})
|
||||||
@@ -199,8 +198,8 @@ class EbicsConfig(models.Model):
|
|||||||
if not os.path.exists(dirname):
|
if not os.path.exists(dirname):
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._(
|
self.env._(
|
||||||
"EBICS Keys Root Directory %s is not available."
|
"EBICS Keys Root Directory %(dir)s is not available."
|
||||||
"\nPlease contact your system administrator."
|
"\nPlease contact your system administrator.",
|
||||||
|
dir=dirname,
|
||||||
)
|
)
|
||||||
% dirname
|
|
||||||
)
|
)
|
||||||
@@ -9,12 +9,12 @@ from traceback import format_exception
|
|||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
from odoo import fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
from odoo.addons.base.models.res_bank import sanitize_account_number
|
from odoo.addons.base.models.res_bank import sanitize_account_number
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__) # lint-ignore=unused-logger
|
||||||
|
|
||||||
DUP_CHECK_FORMATS = ["cfonb120", "camt053"]
|
DUP_CHECK_FORMATS = ["cfonb120", "camt053"]
|
||||||
|
|
||||||
@@ -63,7 +63,6 @@ class EbicsFile(models.Model):
|
|||||||
)
|
)
|
||||||
user_id = fields.Many2one(
|
user_id = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
string="User",
|
|
||||||
default=lambda self: self.env.user,
|
default=lambda self: self.env.user,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
)
|
)
|
||||||
@@ -91,13 +90,16 @@ class EbicsFile(models.Model):
|
|||||||
help="Companies sharing this EBICS file.",
|
help="Companies sharing this EBICS file.",
|
||||||
)
|
)
|
||||||
|
|
||||||
def unlink(self):
|
@api.ondelete(at_uninstall=False)
|
||||||
ff_methods = self._file_format_methods()
|
def _unlink_except_done(self):
|
||||||
for ebics_file in self:
|
if any(rec.state == "done" for rec in self):
|
||||||
if ebics_file.state == "done":
|
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._("You can only remove EBICS files in state 'Draft'.")
|
self.env._("You can only remove EBICS files in state 'Draft'.")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def unlink(self):
|
||||||
|
ff_methods = self._file_format_methods()
|
||||||
|
for ebics_file in self:
|
||||||
# execute format specific actions
|
# execute format specific actions
|
||||||
ff = ebics_file.format_id.download_process_method
|
ff = ebics_file.format_id.download_process_method
|
||||||
if ff in ff_methods:
|
if ff in ff_methods:
|
||||||
@@ -385,8 +387,7 @@ class EbicsFile(models.Model):
|
|||||||
file_data = base64.b64decode(self.data).replace(b"\n", b"").replace(b"\r", b"")
|
file_data = base64.b64decode(self.data).replace(b"\n", b"").replace(b"\r", b"")
|
||||||
if len(file_data) % 120:
|
if len(file_data) % 120:
|
||||||
message = self.env._(
|
message = self.env._(
|
||||||
"Incorrect CFONB120 file:\n"
|
"Incorrect CFONB120 file:\nthe file is not divisible in 120 char lines"
|
||||||
"the file is not divisible in 120 char lines"
|
|
||||||
)
|
)
|
||||||
res["notifications"].append({"type": "error", "message": message})
|
res["notifications"].append({"type": "error", "message": message})
|
||||||
return datas
|
return datas
|
||||||
@@ -650,7 +651,7 @@ class EbicsFile(models.Model):
|
|||||||
self.env._(
|
self.env._(
|
||||||
"The current version of the 'account_ebics' module "
|
"The current version of the 'account_ebics' module "
|
||||||
"has no support to automatically process EBICS files "
|
"has no support to automatically process EBICS files "
|
||||||
"with format %s."
|
"with format %s.",
|
||||||
|
self.format_id.name,
|
||||||
)
|
)
|
||||||
% self.format_id.name
|
|
||||||
)
|
)
|
||||||
@@ -69,8 +69,7 @@ class EbicsUserID(models.Model):
|
|||||||
string="Users",
|
string="Users",
|
||||||
required=True,
|
required=True,
|
||||||
domain=[("share", "=", False)],
|
domain=[("share", "=", False)],
|
||||||
help="Users who are allowed to use this EBICS UserID for "
|
help="Users who are allowed to use this EBICS UserID for bank transactions.",
|
||||||
" bank transactions.",
|
|
||||||
)
|
)
|
||||||
signature_class = fields.Selection(
|
signature_class = fields.Selection(
|
||||||
selection=[("E", "Single signature"), ("T", "Transport signature")],
|
selection=[("E", "Single signature"), ("T", "Transport signature")],
|
||||||
@@ -149,7 +148,7 @@ class EbicsUserID(models.Model):
|
|||||||
# create self-signed X.509 certificates
|
# create self-signed X.509 certificates
|
||||||
ebics_key_x509 = fields.Boolean(
|
ebics_key_x509 = fields.Boolean(
|
||||||
string="X509 support",
|
string="X509 support",
|
||||||
help="Set this flag in order to work with " "self-signed X.509 certificates",
|
help="Set this flag in order to work with self-signed X.509 certificates",
|
||||||
)
|
)
|
||||||
ebics_key_x509_dn_cn = fields.Char(
|
ebics_key_x509_dn_cn = fields.Char(
|
||||||
string="Common Name [CN]",
|
string="Common Name [CN]",
|
||||||
@@ -417,7 +416,7 @@ class EbicsUserID(models.Model):
|
|||||||
if not ebics_config_bank:
|
if not ebics_config_bank:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._(
|
self.env._(
|
||||||
"No bank defined for the financial journal " "of the EBICS Config"
|
"No bank defined for the financial journal of the EBICS Config"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
@@ -476,8 +475,7 @@ class EbicsUserID(models.Model):
|
|||||||
if cc in ["FR", "DE"]:
|
if cc in ["FR", "DE"]:
|
||||||
lang = cc
|
lang = cc
|
||||||
else:
|
else:
|
||||||
lang = self.env.user.lang or self.env["res.lang"].search([])[0].code
|
lang = self.env.user.lang[:2]
|
||||||
lang = lang[:2]
|
|
||||||
lang = lang.lower()
|
lang = lang.lower()
|
||||||
lang = lang if lang in INI_LETTER_LANGS else "en"
|
lang = lang if lang in INI_LETTER_LANGS else "en"
|
||||||
fn_date = fields.Date.today().isoformat()
|
fn_date = fields.Date.today().isoformat()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record model="res.groups" id="group_ebics_manager">
|
<record id="group_ebics_manager" model="res.groups">
|
||||||
<field name="name">EBICS Manager</field>
|
<field name="name">EBICS Manager</field>
|
||||||
<field name="category_id" ref="base.module_category_hidden" />
|
<field name="category_id" ref="base.module_category_hidden" />
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_config_view_list" model="ir.ui.view">
|
<record id="ebics_config_view_list" model="ir.ui.view">
|
||||||
<field name="name">ebics.config.list</field>
|
<field name="name">ebics.config.list</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_file_format_view_search" model="ir.ui.view">
|
<record id="ebics_file_format_view_search" model="ir.ui.view">
|
||||||
<field name="name">ebics.file.format.search</field>
|
<field name="name">ebics.file.format.search</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_file_view_search" model="ir.ui.view">
|
<record id="ebics_file_view_search" model="ir.ui.view">
|
||||||
<field name="name">ebics.file.search</field>
|
<field name="name">ebics.file.search</field>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<record id="ebics_file_view_form" model="ir.ui.view">
|
<record id="ebics_file_view_form" model="ir.ui.view">
|
||||||
<field name="name">ebics.file.form</field>
|
<field name="name">ebics.file.form</field>
|
||||||
<field name="model">ebics.file</field>
|
<field name="model">ebics.file</field>
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form create="false">
|
<form create="false">
|
||||||
<header>
|
<header>
|
||||||
@@ -177,7 +177,7 @@
|
|||||||
<record id="ebics_file_view_form_result" model="ir.ui.view">
|
<record id="ebics_file_view_form_result" model="ir.ui.view">
|
||||||
<field name="name">ebics.file.process.result</field>
|
<field name="name">ebics.file.process.result</field>
|
||||||
<field name="model">ebics.file</field>
|
<field name="model">ebics.file</field>
|
||||||
<field name="priority">100</field>
|
<field name="priority" eval="100" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Process EBICS File">
|
<form string="Process EBICS File">
|
||||||
<separator colspan="4" string="Results :" />
|
<separator colspan="4" string="Results :" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_userid_view_list" model="ir.ui.view">
|
<record id="ebics_userid_view_list" model="ir.ui.view">
|
||||||
<field name="name">ebics.userid.list</field>
|
<field name="name">ebics.userid.list</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="ebics_processing_menu"
|
id="ebics_processing_menu"
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ class EbicsAdminOrder(models.TransientModel):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
client = self._setup_client()
|
client = self._setup_client()
|
||||||
if not client:
|
if not client:
|
||||||
self.note += (
|
self.note += self.env._(
|
||||||
self.env._("EBICS client setup failed for connection '%s'")
|
"EBICS client setup failed for connection '%s'",
|
||||||
% self.ebics_config_id.name
|
self.ebics_config_id.name,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_admin_order_view_form" model="ir.ui.view">
|
<record id="ebics_admin_order_view_form" model="ir.ui.view">
|
||||||
<field name="name">EBICS Administrative Order</field>
|
<field name="name">EBICS Administrative Order</field>
|
||||||
<field name="model">ebics.admin.order</field>
|
<field name="model">ebics.admin.order</field>
|
||||||
<field name="inherit_id" ref="ebics_xfer_view_form_download" />
|
<field name="inherit_id" ref="ebics_xfer_view_form_download" />
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="date_from" position="attributes">
|
<field name="date_from" position="attributes">
|
||||||
<attribute name="invisible">1</attribute>
|
<attribute name="invisible">1</attribute>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<record id="ebics_admin_order_view_form_result" model="ir.ui.view">
|
<record id="ebics_admin_order_view_form_result" model="ir.ui.view">
|
||||||
<field name="name">EBICS Administrative Order result</field>
|
<field name="name">EBICS Administrative Order result</field>
|
||||||
<field name="model">ebics.admin.order</field>
|
<field name="model">ebics.admin.order</field>
|
||||||
<field name="priority">2</field>
|
<field name="priority" eval="2" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS Administrative Order result">
|
<form string="EBICS Administrative Order result">
|
||||||
<separator colspan="4" string="Results :" />
|
<separator colspan="4" string="Results :" />
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_change_passphrase_view_form" model="ir.ui.view">
|
<record id="ebics_change_passphrase_view_form" model="ir.ui.view">
|
||||||
<field name="name">EBICS Keys Change Passphrase</field>
|
<field name="name">EBICS Keys Change Passphrase</field>
|
||||||
<field name="model">ebics.change.passphrase</field>
|
<field name="model">ebics.change.passphrase</field>
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS Keys Change Passphrase">
|
<form string="EBICS Keys Change Passphrase">
|
||||||
<group>
|
<group>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<record id="ebics_change_passphrase_view_form_result" model="ir.ui.view">
|
<record id="ebics_change_passphrase_view_form_result" model="ir.ui.view">
|
||||||
<field name="name">EBICS Keys Change Passphrase</field>
|
<field name="name">EBICS Keys Change Passphrase</field>
|
||||||
<field name="model">ebics.change.passphrase</field>
|
<field name="model">ebics.change.passphrase</field>
|
||||||
<field name="priority">2</field>
|
<field name="priority" eval="2" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS Keys Change Passphrase">
|
<form string="EBICS Keys Change Passphrase">
|
||||||
<separator colspan="4" string="Results :" />
|
<separator colspan="4" string="Results :" />
|
||||||
|
|||||||
@@ -224,9 +224,9 @@ class EbicsXfer(models.TransientModel):
|
|||||||
client = self._setup_client()
|
client = self._setup_client()
|
||||||
if not client:
|
if not client:
|
||||||
err_cnt += 1
|
err_cnt += 1
|
||||||
self.note += (
|
self.note += self.env._(
|
||||||
self.env._("EBICS client setup failed for connection '%s'")
|
"EBICS client setup failed for connection '%s'",
|
||||||
% self.ebics_config_id.name
|
self.ebics_config_id.name,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
download_formats = (
|
download_formats = (
|
||||||
@@ -336,11 +336,8 @@ class EbicsXfer(models.TransientModel):
|
|||||||
if ebics_files:
|
if ebics_files:
|
||||||
self.note += "\n"
|
self.note += "\n"
|
||||||
for f in ebics_files:
|
for f in ebics_files:
|
||||||
self.note += (
|
self.note += self.env._(
|
||||||
self.env._(
|
"EBICS File '%s' is available for further processing.", f.name
|
||||||
"EBICS File '%s' is available for further processing."
|
|
||||||
)
|
|
||||||
% f.name
|
|
||||||
)
|
)
|
||||||
self.note += "\n"
|
self.note += "\n"
|
||||||
|
|
||||||
@@ -406,9 +403,8 @@ class EbicsXfer(models.TransientModel):
|
|||||||
OrderID = client.upload(order_type, upload_data)
|
OrderID = client.upload(order_type, upload_data)
|
||||||
if OrderID:
|
if OrderID:
|
||||||
self.note += "\n"
|
self.note += "\n"
|
||||||
self.note += (
|
self.note += self.env._(
|
||||||
self.env._("EBICS File has been uploaded (OrderID %s).")
|
"EBICS File has been uploaded (OrderID %s).", OrderID
|
||||||
% OrderID
|
|
||||||
)
|
)
|
||||||
ef_note = ""
|
ef_note = ""
|
||||||
if self.env.context.get("origin"):
|
if self.env.context.get("origin"):
|
||||||
@@ -619,9 +615,9 @@ class EbicsXfer(models.TransientModel):
|
|||||||
self.env._(
|
self.env._(
|
||||||
"EBICS File with name '%s' has already been downloaded."
|
"EBICS File with name '%s' has already been downloaded."
|
||||||
"\nPlease check this file and rename in case there is "
|
"\nPlease check this file and rename in case there is "
|
||||||
"no risk on duplicate transactions."
|
"no risk on duplicate transactions.",
|
||||||
|
fn,
|
||||||
)
|
)
|
||||||
% fn
|
|
||||||
)
|
)
|
||||||
data = base64.encodebytes(data)
|
data = base64.encodebytes(data)
|
||||||
ef_vals = {
|
ef_vals = {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_xfer_view_form_download" model="ir.ui.view">
|
<record id="ebics_xfer_view_form_download" model="ir.ui.view">
|
||||||
<field name="name">EBICS File Download</field>
|
<field name="name">EBICS File Download</field>
|
||||||
<field name="model">ebics.xfer</field>
|
<field name="model">ebics.xfer</field>
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS File Download">
|
<form string="EBICS File Download">
|
||||||
<group>
|
<group>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<record id="ebics_xfer_view_form_upload" model="ir.ui.view">
|
<record id="ebics_xfer_view_form_upload" model="ir.ui.view">
|
||||||
<field name="name">EBICS File Upload</field>
|
<field name="name">EBICS File Upload</field>
|
||||||
<field name="model">ebics.xfer</field>
|
<field name="model">ebics.xfer</field>
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS File Upload">
|
<form string="EBICS File Upload">
|
||||||
<group>
|
<group>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<record id="ebics_xfer_view_form_result" model="ir.ui.view">
|
<record id="ebics_xfer_view_form_result" model="ir.ui.view">
|
||||||
<field name="name">EBICS File Transfer</field>
|
<field name="name">EBICS File Transfer</field>
|
||||||
<field name="model">ebics.xfer</field>
|
<field name="model">ebics.xfer</field>
|
||||||
<field name="priority">2</field>
|
<field name="priority" eval="2" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS File Transfer">
|
<form string="EBICS File Transfer">
|
||||||
<separator colspan="4" string="Results :" />
|
<separator colspan="4" string="Results :" />
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
<record id="ebics_xfer_view_form_mark_as_downloaded" model="ir.ui.view">
|
<record id="ebics_xfer_view_form_mark_as_downloaded" model="ir.ui.view">
|
||||||
<field name="name">Mark EBICS files as Downloaded</field>
|
<field name="name">Mark EBICS files as Downloaded</field>
|
||||||
<field name="model">ebics.xfer</field>
|
<field name="model">ebics.xfer</field>
|
||||||
<field name="priority">1</field>
|
<field name="priority" eval="1" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="EBICS Mark as Downloaded">
|
<form string="EBICS Mark as Downloaded">
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "EBICS - Scheduled File Import",
|
"name": "EBICS - Scheduled File Import",
|
||||||
"version": "18.0.1.0.1",
|
"version": "18.0.1.0.2",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"author": "Noviat",
|
"author": "Noviat",
|
||||||
"website": "https://www.noviat.com/",
|
"website": "https://www.noviat.com/",
|
||||||
@@ -16,6 +16,5 @@
|
|||||||
"views/ebics_batch_log_views.xml",
|
"views/ebics_batch_log_views.xml",
|
||||||
"views/menu.xml",
|
"views/menu.xml",
|
||||||
],
|
],
|
||||||
"installable": True,
|
|
||||||
"images": ["static/description/banner.png"],
|
"images": ["static/description/banner.png"],
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<field name="state">code</field>
|
<field name="state">code</field>
|
||||||
<field name="code">model._batch_import()</field>
|
<field name="code">model._batch_import()</field>
|
||||||
<field name="user_id" ref="base.user_root" />
|
<field name="user_id" ref="base.user_root" />
|
||||||
<field name="interval_number">1</field>
|
<field name="interval_number" eval="1" />
|
||||||
<field name="interval_type">days</field>
|
<field name="interval_type">days</field>
|
||||||
<field name="active" eval="False" />
|
<field name="active" eval="False" />
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -46,13 +46,12 @@ class EbicsBatchLog(models.Model):
|
|||||||
rec.has_draft_files = "draft" in rec.file_ids.mapped("state")
|
rec.has_draft_files = "draft" in rec.file_ids.mapped("state")
|
||||||
rec.file_count = len(rec.file_ids)
|
rec.file_count = len(rec.file_ids)
|
||||||
|
|
||||||
def unlink(self):
|
@api.ondelete(at_uninstall=False)
|
||||||
for log in self:
|
def _unlink_except_draft(self):
|
||||||
if log.state != "draft":
|
if any(log.state != "draft" for log in self):
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._("Only log objects in state 'draft' can be deleted !")
|
self.env._("Only log objects in state 'draft' can be deleted !")
|
||||||
)
|
)
|
||||||
return super().unlink()
|
|
||||||
|
|
||||||
def button_draft(self):
|
def button_draft(self):
|
||||||
self.state = "draft"
|
self.state = "draft"
|
||||||
@@ -93,9 +92,8 @@ class EbicsBatchLog(models.Model):
|
|||||||
)
|
)
|
||||||
ebics_file_ids = []
|
ebics_file_ids = []
|
||||||
for config in configs:
|
for config in configs:
|
||||||
err_msg = (
|
err_msg = self.env._(
|
||||||
self.env._("Error while processing EBICS connection '%s' :\n")
|
"Error while processing EBICS connection '%s' :\n", config.name
|
||||||
% config.name
|
|
||||||
)
|
)
|
||||||
if config.state == "draft":
|
if config.state == "draft":
|
||||||
import_dict["errors"].append(
|
import_dict["errors"].append(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="ebics_batch_log_view_search" model="ir.ui.view">
|
<record id="ebics_batch_log_view_search" model="ir.ui.view">
|
||||||
<field name="name">ebics.batch.log.search</field>
|
<field name="name">ebics.batch.log.search</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="ebics_batch_log_menu"
|
id="ebics_batch_log_menu"
|
||||||
|
|||||||
@@ -14,6 +14,5 @@
|
|||||||
"views/account_journal_views.xml",
|
"views/account_journal_views.xml",
|
||||||
"views/account_batch_payment_views.xml",
|
"views/account_batch_payment_views.xml",
|
||||||
],
|
],
|
||||||
"installable": True,
|
|
||||||
"images": ["static/description/banner.png"],
|
"images": ["static/description/banner.png"],
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_batch_payment_form" model="ir.ui.view">
|
<record id="view_batch_payment_form" model="ir.ui.view">
|
||||||
<field name="name">account.batch.payment.form</field>
|
<field name="name">account.batch.payment.form</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_account_journal_form_ebics_payment_method" model="ir.ui.view">
|
<record id="view_account_journal_form_ebics_payment_method" model="ir.ui.view">
|
||||||
<field name="name">account.journal.form.ebics.payment.method</field>
|
<field name="name">account.journal.form.ebics.payment.method</field>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{
|
{
|
||||||
"name": "EBICS - Bank Statement Import (OCA)",
|
"name": "EBICS - Bank Statement Import (OCA)",
|
||||||
"summary": "Process EBICS statement files with the OCA bank statement import",
|
"summary": "Process EBICS statement files with the OCA bank statement import",
|
||||||
"version": "18.0.1.0.1",
|
"version": "18.0.1.0.2",
|
||||||
"author": "Noviat",
|
"author": "Noviat",
|
||||||
"website": "https://www.noviat.com/",
|
"website": "https://www.noviat.com/",
|
||||||
"category": "Hidden",
|
"category": "Hidden",
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
"account_ebics",
|
"account_ebics",
|
||||||
"account_statement_import_file",
|
"account_statement_import_file",
|
||||||
],
|
],
|
||||||
"installable": True,
|
|
||||||
"auto_install": True,
|
"auto_install": True,
|
||||||
"images": ["static/description/banner.png"],
|
"images": ["static/description/banner.png"],
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
|
|
||||||
from odoo import _, models
|
from odoo import models
|
||||||
|
|
||||||
from odoo.addons.base.models.res_bank import sanitize_account_number
|
from odoo.addons.base.models.res_bank import sanitize_account_number
|
||||||
|
|
||||||
@@ -39,8 +39,7 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
sanitized_number = sanitize_account_number(account_number)
|
sanitized_number = sanitize_account_number(account_number)
|
||||||
check_curr = sanitized_number[-3:]
|
check_curr = sanitized_number[-3:]
|
||||||
if check_curr.isalpha():
|
if check_curr.isalpha():
|
||||||
all_currencies = self.env["res.currency"].search([])
|
if self.env["res.currency"].search([("name", "=", check_curr)], limit=1):
|
||||||
if check_curr in all_currencies.mapped("name"):
|
|
||||||
sanitized_number = sanitized_number[:-3]
|
sanitized_number = sanitized_number[:-3]
|
||||||
return sanitized_number
|
return sanitized_number
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
if self.env.context.get("active_model") == "ebics.file":
|
if self.env.context.get("active_model") == "ebics.file":
|
||||||
message = False
|
message = False
|
||||||
if len(stmts_vals) == 0:
|
if len(stmts_vals) == 0:
|
||||||
message = _("This file doesn't contain any statement.")
|
message = self.env._("This file doesn't contain any statement.")
|
||||||
if not message:
|
if not message:
|
||||||
no_st_line = True
|
no_st_line = True
|
||||||
for vals in stmts_vals:
|
for vals in stmts_vals:
|
||||||
@@ -57,10 +56,10 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
no_st_line = False
|
no_st_line = False
|
||||||
break
|
break
|
||||||
if no_st_line:
|
if no_st_line:
|
||||||
message = _("This file doesn't contain any transaction.")
|
message = self.env._("This file doesn't contain any transaction.")
|
||||||
if message:
|
if message:
|
||||||
log_msg = (
|
log_msg = (
|
||||||
_("Error detected while processing an EBICS File")
|
self.env._("Error detected while processing an EBICS File")
|
||||||
+ ":\n"
|
+ ":\n"
|
||||||
+ message
|
+ message
|
||||||
)
|
)
|
||||||
@@ -99,7 +98,7 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
else:
|
else:
|
||||||
st_date = st_vals["date"]
|
st_date = st_vals["date"]
|
||||||
messages.append(
|
messages.append(
|
||||||
_(
|
self.env._(
|
||||||
"Statement %(st_name)s dated %(date)s "
|
"Statement %(st_name)s dated %(date)s "
|
||||||
"has already been imported.",
|
"has already been imported.",
|
||||||
st_name=st_vals["name"],
|
st_name=st_vals["name"],
|
||||||
@@ -108,7 +107,9 @@ class AccountStatementImport(models.TransientModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if not transactions:
|
if not transactions:
|
||||||
messages.append(_("This file doesn't contain any transaction."))
|
messages.append(
|
||||||
|
self.env._("This file doesn't contain any transaction.")
|
||||||
|
)
|
||||||
if messages:
|
if messages:
|
||||||
result["notifications"].append(
|
result["notifications"].append(
|
||||||
{"type": "warning", "message": "\n".join(messages)}
|
{"type": "warning", "message": "\n".join(messages)}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{
|
{
|
||||||
"name": "EBICS - Odoo Enterprise Integration",
|
"name": "EBICS - Odoo Enterprise Integration",
|
||||||
"summary": "Place the EBICS menus in the Odoo Enterprise accounting application",
|
"summary": "Place the EBICS menus in the Odoo Enterprise accounting application",
|
||||||
"version": "18.0.1.0.0",
|
"version": "18.0.1.0.1",
|
||||||
"author": "Noviat",
|
"author": "Noviat",
|
||||||
"website": "https://www.noviat.com/",
|
"website": "https://www.noviat.com/",
|
||||||
"category": "Hidden",
|
"category": "Hidden",
|
||||||
@@ -14,7 +14,6 @@
|
|||||||
"accountant",
|
"accountant",
|
||||||
],
|
],
|
||||||
"data": ["views/account_ebics_menu.xml"],
|
"data": ["views/account_ebics_menu.xml"],
|
||||||
"installable": True,
|
|
||||||
"auto_install": True,
|
"auto_install": True,
|
||||||
"images": ["static/description/banner.png"],
|
"images": ["static/description/banner.png"],
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="account_ebics.ebics_processing_menu" model="ir.ui.menu">
|
<record id="account_ebics.ebics_processing_menu" model="ir.ui.menu">
|
||||||
<field name="parent_id" eval="ref('accountant.menu_accounting')" />
|
<field name="parent_id" eval="ref('accountant.menu_accounting')" />
|
||||||
|
|||||||
@@ -15,5 +15,4 @@
|
|||||||
"views/account_payment_mode_views.xml",
|
"views/account_payment_mode_views.xml",
|
||||||
],
|
],
|
||||||
"images": ["static/description/banner.png"],
|
"images": ["static/description/banner.png"],
|
||||||
"installable": True,
|
|
||||||
}
|
}
|
||||||
@@ -73,8 +73,7 @@ class AccountPaymentOrder(models.Model):
|
|||||||
if not self.journal_id.ebics_config_id:
|
if not self.journal_id.ebics_config_id:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
self.env._(
|
self.env._(
|
||||||
"No active EBICS configuration available "
|
"No active EBICS configuration available for the selected bank."
|
||||||
"for the selected bank."
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
ctx.update(
|
ctx.update(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="account_payment_mode_form" model="ir.ui.view">
|
<record id="account_payment_mode_form" model="ir.ui.view">
|
||||||
<field name="name">account.payment.mode.form</field>
|
<field name="name">account.payment.mode.form</field>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<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>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
odoo-addon-module_change_auto_install
|
odoo-addon-module_change_auto_install
|
||||||
openupgradelib
|
openupgradelib
|
||||||
cryptography<37
|
|
||||||
lxml_html_clean
|
lxml_html_clean
|
||||||
Reference in new issue
Block a user