diff --git a/account_reconciliation_widget/README.rst b/account_reconciliation_widget/README.rst index 316f5f95..3c38b0be 100644 --- a/account_reconciliation_widget/README.rst +++ b/account_reconciliation_widget/README.rst @@ -7,7 +7,7 @@ account_reconciliation_widget !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:71c112eed119e92025ed8b56c20e37d22c783f2bcf5d34f57341426b5b441445 + !! source digest: sha256:0d52517eebbb28021256df2b908243ec57e21ff06fc619cd39ff1785a6552e12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_reconciliation_widget/__manifest__.py b/account_reconciliation_widget/__manifest__.py index 0b05d67a..5e483403 100644 --- a/account_reconciliation_widget/__manifest__.py +++ b/account_reconciliation_widget/__manifest__.py @@ -3,7 +3,7 @@ { "name": "account_reconciliation_widget", - "version": "14.0.2.0.6", + "version": "14.0.2.0.7", "category": "Accounting", "license": "AGPL-3", "summary": "Account reconciliation widget", diff --git a/account_reconciliation_widget/migrations/14.0.2.0.7/pre-migration.py b/account_reconciliation_widget/migrations/14.0.2.0.7/pre-migration.py new file mode 100644 index 00000000..1a70d1bc --- /dev/null +++ b/account_reconciliation_widget/migrations/14.0.2.0.7/pre-migration.py @@ -0,0 +1,24 @@ +# Copyright 2023 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """Mitigate a bit the problem on past reconciled invoices, for being available + to be reconciled again if we press "Revert reconciliation" on the statement line. + + This doesn't cover other AR/AP lines, but at least we keep data consistent for + these ones. + """ + openupgrade.logged_query( + env.cr, + """ + UPDATE account_move_line aml + SET statement_line_id = NULL, statement_id = NULL + FROM account_move am WHERE am.id = aml.move_id + AND aml.statement_line_id IS NOT NULL + AND am.move_type IN ('out_invoice', 'out_refund', 'in_invoice', 'in_refund') + """, + ) diff --git a/account_reconciliation_widget/models/account_bank_statement.py b/account_reconciliation_widget/models/account_bank_statement.py index 4b6a8bb3..ce2e42bc 100644 --- a/account_reconciliation_widget/models/account_bank_statement.py +++ b/account_reconciliation_widget/models/account_bank_statement.py @@ -227,8 +227,6 @@ class AccountBankStatementLine(models.Model): # Create counterpart move lines and reconcile them aml_to_reconcile = [] for aml_dict in counterpart_aml_dicts: - if not aml_dict["move_line"].statement_line_id: - aml_dict["move_line"].write({"statement_line_id": self.id}) if aml_dict["move_line"].partner_id.id: aml_dict["partner_id"] = aml_dict["move_line"].partner_id.id aml_dict["account_id"] = aml_dict["move_line"].account_id.id diff --git a/account_reconciliation_widget/static/description/index.html b/account_reconciliation_widget/static/description/index.html index bb37d3f8..293e2f4f 100644 --- a/account_reconciliation_widget/static/description/index.html +++ b/account_reconciliation_widget/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:71c112eed119e92025ed8b56c20e37d22c783f2bcf5d34f57341426b5b441445 +!! source digest: sha256:0d52517eebbb28021256df2b908243ec57e21ff06fc619cd39ff1785a6552e12 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
This module restores account reconciliation widget moved from Odoo community to enterpise in V. 14.0