[16.0][MIG] account_mass_reconcile: Migrate to version 16.0

This commit is contained in:
sonhd91
2023-01-04 11:29:53 +07:00
parent 7df36f640b
commit 22a333da60
10 changed files with 90 additions and 40 deletions

View File

@@ -14,14 +14,14 @@ Account Mass Reconcile
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github
:target: https://github.com/OCA/account-reconcile/tree/15.0/account_mass_reconcile
:target: https://github.com/OCA/account-reconcile/tree/16.0/account_mass_reconcile
:alt: OCA/account-reconcile
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-reconcile-15-0/account-reconcile-15-0-account_mass_reconcile
:target: https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_mass_reconcile
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/98/15.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/account-reconcile&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -44,6 +44,10 @@ on 2 lines (1 debit / 1 credit) and do not allow
partial reconciliation, they also match on 1 key,
partner or Journal item name.
2 advanced reconciliation methods are also available, which can make full
reconcilations, based on the account move lines' Label and Reference, for moves
with the same partner.
**Table of contents**
.. contents::
@@ -62,7 +66,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-reconcile/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_mass_reconcile%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_mass_reconcile%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -97,6 +101,14 @@ Contributors
* Akim Juillerat <akim.juillerat@camptocamp.com>
* Mykhailo Panarin <m.panarin@mobilunity.com>
* Adrià Gil Sorribes <adria.gil@forgeflow.com>
* `Trobz <https://trobz.com>`_:
* Son Ho <sonhd@trobz.com>
Other credits
~~~~~~~~~~~~~
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp
Maintainers
~~~~~~~~~~~
@@ -111,6 +123,6 @@ 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.
This module is part of the `OCA/account-reconcile <https://github.com/OCA/account-reconcile/tree/15.0/account_mass_reconcile>`_ project on GitHub.
This module is part of the `OCA/account-reconcile <https://github.com/OCA/account-reconcile/tree/16.0/account_mass_reconcile>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{
"name": "Account Mass Reconcile",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"depends": ["account"],
"author": "Akretion,Camptocamp,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-reconcile",

View File

@@ -205,7 +205,7 @@ class MassReconcileAdvanced(models.AbstractModel):
]
def _action_rec(self):
self.flush()
self.env.flush_all()
credit_lines = self._query_credit()
debit_lines = self._query_debit()
result = self._rec_auto_lines_advanced(credit_lines, debit_lines)

View File

@@ -9,7 +9,7 @@ import psycopg2
from psycopg2.extensions import AsIs
from odoo import _, api, exceptions, fields, models, sql_db
from odoo.exceptions import Warning as UserError
from odoo.exceptions import UserError
_logger = logging.getLogger(__name__)
@@ -149,7 +149,7 @@ class AccountMassReconcile(models.Model):
def find_reconcile_ids(fieldname, move_line_ids):
if not move_line_ids:
return []
self.flush()
self.env.flush_all()
sql = """
SELECT DISTINCT %s FROM account_move_line
WHERE %s IS NOT NULL AND id in %s
@@ -246,7 +246,7 @@ class AccountMassReconcile(models.Model):
"view_id": False,
"res_model": "account.move.line",
"type": "ir.actions.act_window",
"nodestroy": True,
"context": {"nodestroy": True},
"target": "current",
"domain": [("id", "in", move_line_ids)],
}

View File

@@ -59,7 +59,7 @@ class MassReconcileHistory(models.Model):
"view_id": False,
"res_model": "account.move.line",
"type": "ir.actions.act_window",
"nodestroy": True,
"context": {"nodestroy": True},
"target": "current",
"domain": [("id", "in", move_line_ids)],
}

View File

@@ -71,7 +71,7 @@ class MassReconcileSimple(models.AbstractModel):
query = " ".join(
(select, self._from_query(), where, where2, self._simple_order())
)
self.flush()
self.env.flush_all()
self.env.cr.execute(query, params + params2)
lines = self.env.cr.dictfetchall()
return self.rec_auto_lines_simple(lines)

View File

@@ -17,3 +17,6 @@
* Akim Juillerat <akim.juillerat@camptocamp.com>
* Mykhailo Panarin <m.panarin@mobilunity.com>
* Adrià Gil Sorribes <adria.gil@forgeflow.com>
* `Trobz <https://trobz.com>`_:
* Son Ho <sonhd@trobz.com>

View File

@@ -0,0 +1 @@
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Account Mass Reconcile</title>
<style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/account-reconcile/tree/15.0/account_mass_reconcile"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-reconcile-15-0/account-reconcile-15-0-account_mass_reconcile"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/98/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/account-reconcile/tree/16.0/account_mass_reconcile"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_mass_reconcile"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/account-reconcile&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This is a shared work between Akretion and Camptocamp
in order to provide:</p>
<ul class="simple">
@@ -386,6 +386,9 @@ in this module, the simple reconciliations works
on 2 lines (1 debit / 1 credit) and do not allow
partial reconciliation, they also match on 1 key,
partner or Journal item name.</p>
<p>2 advanced reconciliation methods are also available, which can make full
reconcilations, based on the account move lines Label and Reference, for moves
with the same partner.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@@ -394,7 +397,8 @@ partner or Journal item name.</p>
<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="id6">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
@@ -410,7 +414,7 @@ reconcile.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-reconcile/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_mass_reconcile%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_mass_reconcile%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -424,36 +428,66 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul>
<li><p class="first">Sébastien Beau &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</p>
</li>
<li><p class="first">Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Vincent Renaville &lt;<a class="reference external" href="mailto:vincent.renaville&#64;camptocamp.com">vincent.renaville&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Alexandre Fayolle &lt;<a class="reference external" href="mailto:alexandre.fayolle&#64;camptocamp.com">alexandre.fayolle&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Joël Grand-Guillaume &lt;<a class="reference external" href="mailto:joel.grandguillaume&#64;camptocamp.com">joel.grandguillaume&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Nicolas Bessi &lt;<a class="reference external" href="mailto:nicolas.bessi&#64;camptocamp.com">nicolas.bessi&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Pedro M.Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;gmail.com">pedro.baeza&#64;gmail.com</a>&gt;</p>
</li>
<li><p class="first">Matthieu Dietrich &lt;<a class="reference external" href="mailto:matthieu.dietrich&#64;camptocamp.com">matthieu.dietrich&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Leonardo Pistone &lt;<a class="reference external" href="mailto:leonardo.pistone&#64;camptocamp.com">leonardo.pistone&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Ecino &lt;<a class="reference external" href="mailto:ecino&#64;compassion.ch">ecino&#64;compassion.ch</a>&gt;</p>
</li>
<li><p class="first">Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Rudolf Schnapka &lt;<a class="reference external" href="mailto:rs&#64;techno-flex.de">rs&#64;techno-flex.de</a>&gt;</p>
</li>
<li><p class="first">Florian Dacosta &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</p>
</li>
<li><p class="first">Laetitia Gangloff &lt;<a class="reference external" href="mailto:laetitia.gangloff&#64;acsone.eu">laetitia.gangloff&#64;acsone.eu</a>&gt;</p>
</li>
<li><p class="first">Frédéric Clémenti &lt;<a class="reference external" href="mailto:frederic.clementi&#64;camptocamp.com">frederic.clementi&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Damien Crier &lt;<a class="reference external" href="mailto:damien.crier&#64;camptocamp.com">damien.crier&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Akim Juillerat &lt;<a class="reference external" href="mailto:akim.juillerat&#64;camptocamp.com">akim.juillerat&#64;camptocamp.com</a>&gt;</p>
</li>
<li><p class="first">Mykhailo Panarin &lt;<a class="reference external" href="mailto:m.panarin&#64;mobilunity.com">m.panarin&#64;mobilunity.com</a>&gt;</p>
</li>
<li><p class="first">Adrià Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;forgeflow.com">adria.gil&#64;forgeflow.com</a>&gt;</p>
</li>
<li><p class="first"><a class="reference external" href="https://trobz.com">Trobz</a>:</p>
<blockquote>
<ul class="simple">
<li>Sébastien Beau &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</li>
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Vincent Renaville &lt;<a class="reference external" href="mailto:vincent.renaville&#64;camptocamp.com">vincent.renaville&#64;camptocamp.com</a>&gt;</li>
<li>Alexandre Fayolle &lt;<a class="reference external" href="mailto:alexandre.fayolle&#64;camptocamp.com">alexandre.fayolle&#64;camptocamp.com</a>&gt;</li>
<li>Joël Grand-Guillaume &lt;<a class="reference external" href="mailto:joel.grandguillaume&#64;camptocamp.com">joel.grandguillaume&#64;camptocamp.com</a>&gt;</li>
<li>Nicolas Bessi &lt;<a class="reference external" href="mailto:nicolas.bessi&#64;camptocamp.com">nicolas.bessi&#64;camptocamp.com</a>&gt;</li>
<li>Pedro M.Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;gmail.com">pedro.baeza&#64;gmail.com</a>&gt;</li>
<li>Matthieu Dietrich &lt;<a class="reference external" href="mailto:matthieu.dietrich&#64;camptocamp.com">matthieu.dietrich&#64;camptocamp.com</a>&gt;</li>
<li>Leonardo Pistone &lt;<a class="reference external" href="mailto:leonardo.pistone&#64;camptocamp.com">leonardo.pistone&#64;camptocamp.com</a>&gt;</li>
<li>Ecino &lt;<a class="reference external" href="mailto:ecino&#64;compassion.ch">ecino&#64;compassion.ch</a>&gt;</li>
<li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li>
<li>Rudolf Schnapka &lt;<a class="reference external" href="mailto:rs&#64;techno-flex.de">rs&#64;techno-flex.de</a>&gt;</li>
<li>Florian Dacosta &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
<li>Laetitia Gangloff &lt;<a class="reference external" href="mailto:laetitia.gangloff&#64;acsone.eu">laetitia.gangloff&#64;acsone.eu</a>&gt;</li>
<li>Frédéric Clémenti &lt;<a class="reference external" href="mailto:frederic.clementi&#64;camptocamp.com">frederic.clementi&#64;camptocamp.com</a>&gt;</li>
<li>Damien Crier &lt;<a class="reference external" href="mailto:damien.crier&#64;camptocamp.com">damien.crier&#64;camptocamp.com</a>&gt;</li>
<li>Akim Juillerat &lt;<a class="reference external" href="mailto:akim.juillerat&#64;camptocamp.com">akim.juillerat&#64;camptocamp.com</a>&gt;</li>
<li>Mykhailo Panarin &lt;<a class="reference external" href="mailto:m.panarin&#64;mobilunity.com">m.panarin&#64;mobilunity.com</a>&gt;</li>
<li>Adrià Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;forgeflow.com">adria.gil&#64;forgeflow.com</a>&gt;</li>
<li>Son Ho &lt;<a class="reference external" href="mailto:sonhd&#64;trobz.com">sonhd&#64;trobz.com</a>&gt;</li>
</ul>
</blockquote>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#id6">Other credits</a></h2>
<p>The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/15.0/account_mass_reconcile">OCA/account-reconcile</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/16.0/account_mass_reconcile">OCA/account-reconcile</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -43,7 +43,7 @@ class TestReconcile(TestAccountReconciliationCommon):
self.assertEqual(False, mass_rec_last_hist)
def test_last_history_full_no_history(self):
with self.assertRaises(exceptions.Warning):
with self.assertRaises(exceptions.UserError):
self.mass_rec_no_history.last_history_reconcile()
def test_open_unreconcile(self):