Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][FIX] account_reconciliation_widget: Don't link counterpart to the stamement line #617

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:688eca6f0012e97d95ab4d6273bc61e3863a109ccd2d91f71fdc8741118b7093
!! source digest: sha256:727cfc9bd327b1f0a2686b0ad086d40473fb4f10d900eebce431852b68102644
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.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": "15.0.1.2.12",
"version": "15.0.1.2.13",
"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 @@ -207,8 +207,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:688eca6f0012e97d95ab4d6273bc61e3863a109ccd2d91f71fdc8741118b7093
!! source digest: sha256:727cfc9bd327b1f0a2686b0ad086d40473fb4f10d900eebce431852b68102644
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/15.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-15-0/account-reconcile-15-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=15.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