diff --git a/account_reconcile_oca/models/account_bank_statement_line.py b/account_reconcile_oca/models/account_bank_statement_line.py index ddf8a8dc..2395b195 100644 --- a/account_reconcile_oca/models/account_bank_statement_line.py +++ b/account_reconcile_oca/models/account_bank_statement_line.py @@ -412,8 +412,9 @@ class AccountBankStatementLine(models.Model): continue new_data.append(line_data) liquidity_amount += line_data["amount"] + for line in reconcile_model._get_write_off_move_lines_dict( - -liquidity_amount, self._retrieve_partner() + -liquidity_amount, self._retrieve_partner().id ): new_line = line.copy() amount = line.get("balance") diff --git a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js index fd9f7cb9..862c05ac 100644 --- a/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +++ b/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js @@ -33,7 +33,7 @@ export class ReconcileController extends KanbanController { }); } get journalId() { - if (this.props.resModel === "account.bank.statement.line") { + if (this.props.context.active_model === "account.journal") { return this.props.context.active_id; } return false; @@ -69,6 +69,7 @@ export class ReconcileController extends KanbanController { this.action.doAction(action, { onClose: async () => { await this.model.root.load(); + await this.updateJournalInfo(); this.render(true); }, }); diff --git a/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js b/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js index d91b4bda..ae5640dd 100644 --- a/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +++ b/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js @@ -23,10 +23,12 @@ export class ReconcileFormController extends FormController { async reloadFormController() { var is_reconciled = this.model.root.data.is_reconciled; await this.model.root.load(); - if (!is_reconciled && this.model.root.data.is_reconciled) { - // This only happens when we press the reconcile button - if (this.env.parentController) { - // Showing rainbow man + if (this.env.parentController) { + // We will update the parent controller every time we reload the form. + await this.env.parentController.model.root.load(); + await this.env.parentController.render(true); + if (!is_reconciled && this.model.root.data.is_reconciled) { + // This only happens when we press the reconcile button for showing rainbow man const message = await this.orm.call( "account.journal", "get_rainbowman_message", @@ -36,8 +38,6 @@ export class ReconcileFormController extends FormController { this.env.parentController.setRainbowMan(message); } // Refreshing - await this.env.parentController.model.root.load(); - await this.env.parentController.render(true); this.env.parentController.selectRecord(); } } diff --git a/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js b/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js index 4f401d5c..632768dd 100644 --- a/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js +++ b/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js @@ -2,9 +2,10 @@ // import {ChatterContainer} from "@mail/components/chatter_container/chatter_container"; // import {Chatter} from "@mail/core/web/chatter"; +import {Chatter} from "@mail/core/web/chatter"; + import {registry} from "@web/core/registry"; import {standardFieldProps} from "@web/views/fields/standard_field_props"; -import {Chatter} from "@mail/core/web/chatter"; const {Component} = owl; diff --git a/account_reconcile_oca/views/account_move.xml b/account_reconcile_oca/views/account_move.xml index c8de1da8..aa6a8d3a 100644 --- a/account_reconcile_oca/views/account_move.xml +++ b/account_reconcile_oca/views/account_move.xml @@ -13,6 +13,7 @@ type="action" name="%(account_reconcile_oca.action_bank_statement_line_move_view_reconcile)s" string="Bank reconcile" + context="{'search_default_move_id': id}" class="btn btn-primary" icon="fa-list" invisible="statement_line_id == False" diff --git a/account_reconcile_oca/views/account_move_line.xml b/account_reconcile_oca/views/account_move_line.xml index e818c718..c2927700 100644 --- a/account_reconcile_oca/views/account_move_line.xml +++ b/account_reconcile_oca/views/account_move_line.xml @@ -45,7 +45,7 @@ diff --git a/account_statement_base/README.rst b/account_statement_base/README.rst index 84f5adde..7d2d7883 100644 --- a/account_statement_base/README.rst +++ b/account_statement_base/README.rst @@ -58,7 +58,14 @@ Authors Contributors ------------ -- Alexis de Lattre +- `Akretion `__: + + - Alexis de Lattre + +- `Tecnativa `__: + + - Carlos Dauden + - Sergio Teruel Maintainers ----------- diff --git a/account_statement_base/__init__.py b/account_statement_base/__init__.py index e69de29b..0650744f 100644 --- a/account_statement_base/__init__.py +++ b/account_statement_base/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_statement_base/__manifest__.py b/account_statement_base/__manifest__.py index 871bb02e..e2d7551e 100644 --- a/account_statement_base/__manifest__.py +++ b/account_statement_base/__manifest__.py @@ -14,8 +14,8 @@ "website": "https://github.com/OCA/account-reconcile", "depends": ["account"], "data": [ - "views/account_bank_statement.xml", "views/account_bank_statement_line.xml", + "views/account_bank_statement.xml", # Keep order ], "installable": True, } diff --git a/account_statement_base/models/__init__.py b/account_statement_base/models/__init__.py new file mode 100644 index 00000000..3fb26d48 --- /dev/null +++ b/account_statement_base/models/__init__.py @@ -0,0 +1 @@ +from . import account_journal_dashboard diff --git a/account_statement_base/models/account_journal_dashboard.py b/account_statement_base/models/account_journal_dashboard.py new file mode 100644 index 00000000..d6661090 --- /dev/null +++ b/account_statement_base/models/account_journal_dashboard.py @@ -0,0 +1,16 @@ +from odoo import models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + def create_cash_statement(self): + # Totally override this action for avoiding the standard + # message saying that you need to install the enterprise + # module. We do the equivalent thing instead. + self.ensure_one() + action = self.env["ir.actions.actions"]._for_xml_id( + "account_statement_base.account_bank_statement_line_action" + ) + action["context"] = {"search_default_journal_id": self.id} + return action diff --git a/account_statement_base/readme/CONTRIBUTORS.md b/account_statement_base/readme/CONTRIBUTORS.md index b61afe5d..fc3d487b 100644 --- a/account_statement_base/readme/CONTRIBUTORS.md +++ b/account_statement_base/readme/CONTRIBUTORS.md @@ -1 +1,5 @@ -- Alexis de Lattre \<\> + - [Akretion](https://www.akretion.com): + - Alexis de Lattre \<\> + - [Tecnativa](https://www.tecnativa.com): + - Carlos Dauden + - Sergio Teruel diff --git a/account_statement_base/static/description/index.html b/account_statement_base/static/description/index.html index 3aba0616..e6af25b3 100644 --- a/account_statement_base/static/description/index.html +++ b/account_statement_base/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -403,13 +404,23 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

diff --git a/account_statement_base/views/account_bank_statement.xml b/account_statement_base/views/account_bank_statement.xml index 7c4341c9..6c86b867 100644 --- a/account_statement_base/views/account_bank_statement.xml +++ b/account_statement_base/views/account_bank_statement.xml @@ -5,6 +5,81 @@ --> + + account.bank.statement.form + account.bank.statement + 1 + +
+ + +
+
+
+
+ + + + + + + + + + + + + + + +
+ + + + + + account.bank.statement diff --git a/account_statement_base/views/account_bank_statement_line.xml b/account_statement_base/views/account_bank_statement_line.xml index 052595c0..aac145a2 100644 --- a/account_statement_base/views/account_bank_statement_line.xml +++ b/account_statement_base/views/account_bank_statement_line.xml @@ -15,7 +15,7 @@ - + @@ -60,21 +60,36 @@ account.bank.statement.line - - - - - - - + + + + + + + + + + - - - + + + +