[ADD] module account_statement_import_file_reconciliation_widget

account_statement_import_file_reconciliation_widget is a glue
auto-install module between account_statement_import (will be renamed
account_statement_import_file in v16) and account_reconciliation_widget.
This commit is contained in:
Alexis de Lattre
2022-08-10 00:01:53 +02:00
committed by Miquel Raïch
parent 2fc266cb6c
commit 7b1269a246
10 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1 @@
Will be auto-generated from the readme subdir

View File

@@ -0,0 +1 @@
from . import wizards

View File

@@ -0,0 +1,19 @@
# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# Licence AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
{
"name": "Import Statement Files and Go Direct to Reconciliation",
"category": "Accounting",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"depends": ["account_statement_import", "account_reconciliation_widget"],
"author": "Akretion, Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/bank-statement-import",
"data": [
"wizards/account_statement_import_view.xml",
],
"installable": True,
"auto_install": True,
}

View File

@@ -0,0 +1 @@
* Alexis de Lattre <alexis.delattre@akretion.com>

View File

@@ -0,0 +1,9 @@
This module is a glue module between 2 modules:
* **account_statement_import** from `OCA/bank-statement-import <https://github.com/OCA/bank-statement-import>`_
* **account_reconciliation_widget** from `OCA/account-reconcile <https://github.com/OCA/account-reconcile>`_
This module adds a button **Import and Start to Reconcile** on the bank statement file import wizard. When you click on this button, Odoo will import the bank statement file and jump directly to the special reconciliation interface.
.. figure:: ../static/description/bank_statement_import_start_reconcile.png
:alt: Bank statement import wizard screenshot

View File

@@ -0,0 +1 @@
This module will be installed automatically by Odoo if the modules **account_statement_import** and **account_reconciliation_widget** are installed.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1 @@
from . import account_statement_import

View File

@@ -0,0 +1,26 @@
# Copyright 2022 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# Licence AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
from odoo import models
class AccountStatementImport(models.TransientModel):
_inherit = "account.statement.import"
def import_file_and_reconcile_button(self):
"""Process the file chosen in the wizard, create bank statement(s)
and jump directly to the reconcilition widget"""
result = self._import_file()
statements = self.env["account.bank.statement"].browse(result["statement_ids"])
statements.button_post()
action = {
"type": "ir.actions.client",
"tag": "bank_statement_reconciliation_view",
"context": {
"statement_line_ids": statements.line_ids.ids,
"company_ids": statements.company_id.ids,
"notifications": result["notifications"],
},
}
return action

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" ?>
<!--
Copyright 2022 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
Licence AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0).
-->
<odoo>
<record id="account_statement_import_form" model="ir.ui.view">
<field name="model">account.statement.import</field>
<field
name="inherit_id"
ref="account_statement_import.account_statement_import_form"
/>
<field name="arch" type="xml">
<button name="import_file_button" position="before">
<button
name="import_file_and_reconcile_button"
string="Import and Start to Reconcile"
type="object"
class="btn-primary"
/>
</button>
</field>
</record>
</odoo>