Add module account_statement_import_base

The 2 modules account_statement_import_online and
account_statement_import depend on account_statement_import_base (and
not on each other) and share common code, in particular a hook to update
the statement line. So we can now have reconciliation modules that use
this hook and therefore work both on file import and online import. More
details on https://github.com/OCA/bank-statement-import/issues/481.

Improve bank statement line form view and journal form view.
This commit is contained in:
Alexis de Lattre
2022-08-08 00:05:18 +02:00
parent 84edaf5850
commit 6418bc396f
5 changed files with 6 additions and 83 deletions

View File

@@ -1,2 +1 @@
from . import account_journal
from . import account_bank_statement_line

View File

@@ -1,22 +0,0 @@
# Copyright 2004-2020 Odoo S.A.
# Copyright 2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# Licence LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0).
from odoo import fields, models
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"
# Ensure transactions can be imported only once
# (if the import format provides unique transaction ids)
unique_import_id = fields.Char(string="Import ID", readonly=True, copy=False)
_sql_constraints = [
(
"unique_import_id",
"unique(unique_import_id)",
"A bank account transaction can be imported only once!",
)
]