From b558b542f0e44e775bb77b77c0e012eece61d5df Mon Sep 17 00:00:00 2001
From: Damien Crier
Date: Sun, 26 Jul 2020 09:22:16 +0200
Subject: [PATCH] [MIG] account_mass_reconcile_ref_deep_search: Migration to
13.0
---
.../README.rst | 10 ++--
...account_mass_reconcile_ref_deep_search.pot | 2 +-
.../models/advanced_reconciliation.py | 1 +
.../static/description/index.html | 6 +-
.../test_account_reconcile_ref_deep_search.py | 58 +++++++++++--------
5 files changed, 44 insertions(+), 33 deletions(-)
diff --git a/account_mass_reconcile_ref_deep_search/README.rst b/account_mass_reconcile_ref_deep_search/README.rst
index efa97cce..f9fe69a5 100644
--- a/account_mass_reconcile_ref_deep_search/README.rst
+++ b/account_mass_reconcile_ref_deep_search/README.rst
@@ -14,13 +14,13 @@ Mass Reconcile Ref Deep Search
: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/12.0/account_mass_reconcile_ref_deep_search
+ :target: https://github.com/OCA/account-reconcile/tree/13.0/account_mass_reconcile_ref_deep_search
: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-12-0/account-reconcile-12-0-account_mass_reconcile_ref_deep_search
+ :target: https://translation.odoo-community.org/projects/account-reconcile-13-0/account-reconcile-13-0-account_mass_reconcile_ref_deep_search
: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/12.0
+ :target: https://runbot.odoo-community.org/runbot/98/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -40,7 +40,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -71,6 +71,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 `_ project on GitHub.
+This module is part of the `OCA/account-reconcile `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_mass_reconcile_ref_deep_search/i18n/account_mass_reconcile_ref_deep_search.pot b/account_mass_reconcile_ref_deep_search/i18n/account_mass_reconcile_ref_deep_search.pot
index 0ba5ed44..62bf7ca0 100644
--- a/account_mass_reconcile_ref_deep_search/i18n/account_mass_reconcile_ref_deep_search.pot
+++ b/account_mass_reconcile_ref_deep_search/i18n/account_mass_reconcile_ref_deep_search.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 12.0\n"
+"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
diff --git a/account_mass_reconcile_ref_deep_search/models/advanced_reconciliation.py b/account_mass_reconcile_ref_deep_search/models/advanced_reconciliation.py
index 6eb2f985..9e3e64a9 100644
--- a/account_mass_reconcile_ref_deep_search/models/advanced_reconciliation.py
+++ b/account_mass_reconcile_ref_deep_search/models/advanced_reconciliation.py
@@ -9,6 +9,7 @@ class MassReconciledAdvancedRefDeepSearch(models.TransientModel):
_name = "mass.reconcile.advanced.ref.deep.search"
_inherit = "mass.reconcile.advanced.ref"
+ _description = "Advanced. Partner and Ref. Deep Search"
@staticmethod
def _compare_values(key, value, opposite_value):
diff --git a/account_mass_reconcile_ref_deep_search/static/description/index.html b/account_mass_reconcile_ref_deep_search/static/description/index.html
index abf555e8..dafe055a 100644
--- a/account_mass_reconcile_ref_deep_search/static/description/index.html
+++ b/account_mass_reconcile_ref_deep_search/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module extends the functionality of account_mass_reconcile and adds a new
reconciliation method which allows, for a partner, to search the credit entry
ref in any debit entry ref.
@@ -388,7 +388,7 @@ ref in any debit entry ref.
Bugs are tracked on GitHub 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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -413,7 +413,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
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 project on GitHub.
+
This module is part of the OCA/account-reconcile project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_mass_reconcile_ref_deep_search/tests/test_account_reconcile_ref_deep_search.py b/account_mass_reconcile_ref_deep_search/tests/test_account_reconcile_ref_deep_search.py
index 992f78aa..7654a9d4 100644
--- a/account_mass_reconcile_ref_deep_search/tests/test_account_reconcile_ref_deep_search.py
+++ b/account_mass_reconcile_ref_deep_search/tests/test_account_reconcile_ref_deep_search.py
@@ -18,6 +18,7 @@ class TestAccountReconcileRefDeepSearch(SavepointCase):
)
],
limit=1,
+ order="id",
)
account_revenue = cls.env["account.account"].search(
[
@@ -33,32 +34,40 @@ class TestAccountReconcileRefDeepSearch(SavepointCase):
[("type", "=", "sale")], limit=1
)
# Create invoice
- cls.cust_invoice = cls.env["account.invoice"].create(
- {
- "partner_id": cls.partner.id,
- "type": "out_invoice",
- "account_id": cls.account_receivable.id,
- "journal_id": sales_journal.id,
- "invoice_line_ids": [
- (
- 0,
- 0,
- {
- "name": "[CONS_DEL01] Server",
- "product_id": cls.env.ref("product.consu_delivery_01").id,
- "account_id": account_revenue.id,
- "price_unit": 1000.0,
- "quantity": 1.0,
- },
- )
- ],
- "name": "test_deep_search",
- }
+ cls.cust_invoice = (
+ cls.env["account.move"]
+ .with_context(default_type="out_invoice")
+ .create(
+ {
+ "partner_id": cls.partner.id,
+ "company_id": cls.env.ref("base.main_company"),
+ "type": "out_invoice",
+ "journal_id": sales_journal.id,
+ "invoice_line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "name": "[CONS_DEL01] Server",
+ "product_id": cls.env.ref(
+ "product.consu_delivery_01"
+ ).id,
+ "account_id": account_revenue.id,
+ "price_unit": 1000.0,
+ "quantity": 1.0,
+ },
+ )
+ ],
+ "name": "test_deep_search",
+ "ref": "test_deep_search",
+ }
+ )
)
- cls.cust_invoice.action_invoice_open()
+ cls.cust_invoice.action_post()
def test_account_reconcile_ref_deep_search(self):
- self.assertEqual(self.cust_invoice.state, "open")
+ self.assertEqual(self.cust_invoice.state, "posted")
+ self.assertEqual(self.cust_invoice.invoice_payment_state, "not_paid")
bank_journal = self.env["account.journal"].search(
[("type", "=", "bank")], limit=1
)
@@ -99,5 +108,6 @@ class TestAccountReconcileRefDeepSearch(SavepointCase):
)
count = reconcile.unreconciled_count
reconcile.run_reconcile()
- self.assertEqual(self.cust_invoice.state, "paid")
+ self.cust_invoice.invalidate_cache()
+ self.assertEqual(self.cust_invoice.invoice_payment_state, "paid")
self.assertEqual(reconcile.unreconciled_count, count - 2)