Skip to content

Commit

Permalink
Merge pull request #619 from Tecnativa/14.0-fix-account_reconciliatio…
Browse files Browse the repository at this point in the history
…n_widget-stml_link

[14.0][FIX] account_reconciliation_widget: Don't link counterpart to the statement line
  • Loading branch information
pedrobaeza authored Jan 2, 2024
2 parents a7346b6 + 427e66a commit 29210db
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion account_reconciliation_widget/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion account_reconciliation_widget/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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')
""",
)
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ def _create_counterpart_and_new_aml(
# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">account_reconciliation_widget</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:71c112eed119e92025ed8b56c20e37d22c783f2bcf5d34f57341426b5b441445
!! source digest: sha256:0d52517eebbb28021256df2b908243ec57e21ff06fc619cd39ff1785a6552e12
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/14.0/account_reconciliation_widget"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-reconcile-14-0/account-reconcile-14-0-account_reconciliation_widget"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module restores account reconciliation widget moved from Odoo community to enterpise in V. 14.0
Expand Down

0 comments on commit 29210db

Please sign in to comment.