diff --git a/account_reconcile_reconciliation_date/README.rst b/account_reconcile_reconciliation_date/README.rst index 75e3563e..9abec966 100644 --- a/account_reconcile_reconciliation_date/README.rst +++ b/account_reconcile_reconciliation_date/README.rst @@ -14,13 +14,13 @@ Account Reconciliation Date :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_reconcile_reconciliation_date + :target: https://github.com/OCA/account-reconcile/tree/14.0/account_reconcile_reconciliation_date :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_reconcile_reconciliation_date + :target: https://translation.odoo-community.org/projects/account-reconcile-14-0/account-reconcile-14-0-account_reconcile_reconciliation_date :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/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -38,7 +38,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. @@ -54,6 +54,7 @@ Contributors ~~~~~~~~~~~~ * Steven Campbell +* Ammar Officewala Maintainers ~~~~~~~~~~~ @@ -68,6 +69,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_reconcile_reconciliation_date/__init__.py b/account_reconcile_reconciliation_date/__init__.py index a0d2c6cd..84af717e 100644 --- a/account_reconcile_reconciliation_date/__init__.py +++ b/account_reconcile_reconciliation_date/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/account_reconcile_reconciliation_date/__manifest__.py b/account_reconcile_reconciliation_date/__manifest__.py index 1a9b7d3d..fe90f740 100644 --- a/account_reconcile_reconciliation_date/__manifest__.py +++ b/account_reconcile_reconciliation_date/__manifest__.py @@ -1,15 +1,15 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Account Reconciliation Date", "summary": "Track Reconciliation Date of Payments and Invoices", - "version": "12.0.1.1.0", + "version": "14.0.1.0.0", "depends": ["account"], "author": "Open Source Integrators, Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-reconcile", "category": "Finance", "license": "AGPL-3", - "data": ["views/account_invoice.xml", "views/account_payment.xml"], + "data": ["views/account_move.xml", "views/account_payment.xml"], "installable": True, } diff --git a/account_reconcile_reconciliation_date/i18n/es_CL.po b/account_reconcile_reconciliation_date/i18n/es_CL.po deleted file mode 100644 index cc076f68..00000000 --- a/account_reconcile_reconciliation_date/i18n/es_CL.po +++ /dev/null @@ -1,39 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * account_reconcile_reconciliation_date -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-03-01 23:45+0000\n" -"Last-Translator: Nelson Ramírez Sánchez \n" -"Language-Team: none\n" -"Language: es_CL\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" - -#. module: account_reconcile_reconciliation_date -#: model:ir.model,name:account_reconcile_reconciliation_date.model_account_full_reconcile -msgid "Full Reconcile" -msgstr "Reconciliación Completa" - -#. module: account_reconcile_reconciliation_date -#: model:ir.model,name:account_reconcile_reconciliation_date.model_account_invoice -msgid "Invoice" -msgstr "Factura" - -#. module: account_reconcile_reconciliation_date -#: model:ir.model,name:account_reconcile_reconciliation_date.model_account_payment -msgid "Payments" -msgstr "Pagos" - -#. module: account_reconcile_reconciliation_date -#: model:ir.model.fields,field_description:account_reconcile_reconciliation_date.field_account_full_reconcile__reconciliation_date -#: model:ir.model.fields,field_description:account_reconcile_reconciliation_date.field_account_invoice__reconciliation_date -#: model:ir.model.fields,field_description:account_reconcile_reconciliation_date.field_account_payment__reconciliation_date -msgid "Reconciliation Date" -msgstr "Fecha de Reconciliación" diff --git a/account_reconcile_reconciliation_date/models/__init__.py b/account_reconcile_reconciliation_date/models/__init__.py index 6fcf8c62..587cc1d1 100644 --- a/account_reconcile_reconciliation_date/models/__init__.py +++ b/account_reconcile_reconciliation_date/models/__init__.py @@ -1,6 +1,6 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import account_full_reconcile -from . import account_invoice +from . import account_move from . import account_payment diff --git a/account_reconcile_reconciliation_date/models/account_full_reconcile.py b/account_reconcile_reconciliation_date/models/account_full_reconcile.py index e8145039..b652b850 100644 --- a/account_reconcile_reconciliation_date/models/account_full_reconcile.py +++ b/account_reconcile_reconciliation_date/models/account_full_reconcile.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from datetime import date @@ -23,8 +23,8 @@ class AccountFullReconcile(models.Model): line_id.payment_id.reconciliation_date = ( reconcile_id.reconciliation_date ) - if line_id.invoice_id: - line_id.invoice_id.reconciliation_date = ( + if line_id.move_id: + line_id.move_id.reconciliation_date = ( reconcile_id.reconciliation_date ) return res diff --git a/account_reconcile_reconciliation_date/models/account_invoice.py b/account_reconcile_reconciliation_date/models/account_move.py similarity index 59% rename from account_reconcile_reconciliation_date/models/account_invoice.py rename to account_reconcile_reconciliation_date/models/account_move.py index ae3a4ffb..436f0def 100644 --- a/account_reconcile_reconciliation_date/models/account_invoice.py +++ b/account_reconcile_reconciliation_date/models/account_move.py @@ -1,10 +1,10 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models -class AccountInvoice(models.Model): - _inherit = "account.invoice" +class AccountMove(models.Model): + _inherit = "account.move" reconciliation_date = fields.Date(string="Reconciliation Date") diff --git a/account_reconcile_reconciliation_date/models/account_payment.py b/account_reconcile_reconciliation_date/models/account_payment.py index e16ea24e..f59ef6ba 100644 --- a/account_reconcile_reconciliation_date/models/account_payment.py +++ b/account_reconcile_reconciliation_date/models/account_payment.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/account_reconcile_reconciliation_date/readme/CONTRIBUTORS.rst b/account_reconcile_reconciliation_date/readme/CONTRIBUTORS.rst index 8fa8bb97..c39c4246 100644 --- a/account_reconcile_reconciliation_date/readme/CONTRIBUTORS.rst +++ b/account_reconcile_reconciliation_date/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Steven Campbell +* Ammar Officewala diff --git a/account_reconcile_reconciliation_date/static/description/index.html b/account_reconcile_reconciliation_date/static/description/index.html index 56f5f2aa..91e8122d 100644 --- a/account_reconcile_reconciliation_date/static/description/index.html +++ b/account_reconcile_reconciliation_date/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/account-reconcile Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/account-reconcile Translate me on Weblate Try me on Runbot

This module is designed to help users track when invoices and payments are reconciled

Table of contents

@@ -386,7 +386,7 @@ ul.auto-toc {

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.

@@ -401,6 +401,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

@@ -410,7 +411,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_reconcile_reconciliation_date/tests/__init__.py b/account_reconcile_reconciliation_date/tests/__init__.py index 3608509e..5cbf2f9a 100644 --- a/account_reconcile_reconciliation_date/tests/__init__.py +++ b/account_reconcile_reconciliation_date/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import test_account_reconcile_reconciliation_date diff --git a/account_reconcile_reconciliation_date/tests/test_account_reconcile_reconciliation_date.py b/account_reconcile_reconciliation_date/tests/test_account_reconcile_reconciliation_date.py index 3ebea791..2554acee 100644 --- a/account_reconcile_reconciliation_date/tests/test_account_reconcile_reconciliation_date.py +++ b/account_reconcile_reconciliation_date/tests/test_account_reconcile_reconciliation_date.py @@ -1,20 +1,20 @@ -# Copyright (C) 2019, Open Source Integrators +# Copyright (C) 2021, Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import time -from odoo.addons.account.tests.account_test_classes import AccountingTestCase +from odoo.addons.account.tests.common import AccountTestInvoicingCommon -class TestAccountReconcileReconciliationDate(AccountingTestCase): +class TestAccountReconcileReconciliationDate(AccountTestInvoicingCommon): def setUp(self): super(TestAccountReconcileReconciliationDate, self).setUp() self.register_payments_model = self.env[ - "account.register.payments" - ].with_context(active_model="account.invoice") + "account.payment.register" + ].with_context(active_model="account.move") self.payment_model = self.env["account.payment"] - self.invoice_model = self.env["account.invoice"] - self.invoice_line_model = self.env["account.invoice.line"] + self.invoice_model = self.env["account.move"] + self.invoice_line_model = self.env["account.move.line"] self.acc_bank_stmt_model = self.env["account.bank.statement"] self.acc_bank_stmt_line_model = self.env["account.bank.statement.line"] @@ -68,10 +68,10 @@ class TestAccountReconcileReconciliationDate(AccountingTestCase): limit=1, ) - self.bank_journal_euro = self.env["account.journal"].create( - {"name": "Bank", "type": "bank", "code": "BNK67"} + self.bank_journal_euro = self.env["account.journal"].search( + [("type", "=", "bank")], limit=1 ) - self.account_eur = self.bank_journal_euro.default_debit_account_id + self.account_eur = self.bank_journal_euro.default_account_id self.bank_journal_usd = self.env["account.journal"].create( { @@ -81,8 +81,10 @@ class TestAccountReconcileReconciliationDate(AccountingTestCase): "currency_id": self.currency_usd_id, } ) - self.account_usd = self.bank_journal_usd.default_debit_account_id - + self.account_usd = self.bank_journal_usd.default_account_id + self.journal_id = self.env["account.journal"].search( + [("type", "=", "sale")], limit=1 + ) self.transfer_account = ( self.env["res.users"].browse(self.env.uid).company_id.transfer_account_id ) @@ -100,7 +102,7 @@ class TestAccountReconcileReconciliationDate(AccountingTestCase): def create_invoice( self, amount=100, - type="out_invoice", + move_type="out_invoice", currency_id=None, partner=None, account_id=None, @@ -110,23 +112,25 @@ class TestAccountReconcileReconciliationDate(AccountingTestCase): { "partner_id": partner or self.partner_agrolait.id, "currency_id": currency_id or self.currency_eur_id, - "name": type, - "account_id": account_id or self.account_receivable.id, - "type": type, - "date_invoice": time.strftime("%Y") + "-06-26", + "journal_id": self.journal_id.id, + "move_type": move_type, + "invoice_date": time.strftime("%Y") + "-06-26", + "invoice_line_ids": [ + ( + 0, + 0, + { + "product_id": self.product.id, + "quantity": 1, + "price_unit": amount, + "name": "something", + "account_id": self.journal_id.default_account_id.id, + }, + ) + ], } ) - self.invoice_line_model.create( - { - "product_id": self.product.id, - "quantity": 1, - "price_unit": amount, - "invoice_id": invoice.id, - "name": "something", - "account_id": self.account_revenue.id, - } - ) - invoice.action_invoice_open() + invoice.action_post() return invoice def reconcile( @@ -169,56 +173,39 @@ class TestAccountReconcileReconciliationDate(AccountingTestCase): partner=self.partner_agrolait.id, ) - ctx = {"active_model": "account.invoice", "active_ids": [inv_1.id, inv_2.id]} + ctx = {"active_model": "account.move", "active_ids": [inv_1.id, inv_2.id]} register_payments = self.register_payments_model.with_context(ctx).create( { "payment_date": time.strftime("%Y") + "-07-15", "journal_id": self.bank_journal_euro.id, "payment_method_id": self.payment_method_manual_in.id, - "group_invoices": True, } ) - register_payments.create_payments() + register_payments.flush() + register_payments.action_create_payments() payment = self.payment_model.search([], order="id desc", limit=1) - self.assertAlmostEquals(payment.amount, 300) + self.assertAlmostEqual(payment.amount, 200) self.assertEqual(payment.state, "posted") self.assertEqual(payment.state, "posted") - self.assertEqual(inv_1.state, "paid") - self.assertEqual(inv_2.state, "paid") + self.assertEqual(inv_1.payment_state, "paid") + self.assertEqual(inv_2.payment_state, "paid") self.assertRecordValues( - payment.move_line_ids, + payment.line_ids, [ { - "account_id": self.account_eur.id, - "debit": 300.0, + "journal_id": self.bank_journal_euro.id, + "debit": 200.0, "credit": 0.0, - "amount_currency": 0, - "currency_id": False, }, { - "account_id": inv_1.account_id.id, + "journal_id": self.bank_journal_euro.id, "debit": 0.0, - "credit": 300.0, - "amount_currency": 0, - "currency_id": False, + "credit": 200.0, }, ], ) - self.assertTrue( - payment.move_line_ids.filtered(lambda l: l.account_id == inv_1.account_id)[ - 0 - ].full_reconcile_id - ) - liquidity_aml = payment.move_line_ids.filtered( - lambda r: r.account_id == self.account_eur - ) - bank_statement = self.reconcile(liquidity_aml, 200, 0, False) - - self.assertEqual(liquidity_aml.statement_id, bank_statement) - self.assertEqual(liquidity_aml.statement_line_id, bank_statement.line_ids[0]) - - self.assertEqual(payment.state, "reconciled") + self.assertEqual(payment.state, "posted") self.assertEqual(payment.reconciliation_date, inv_1.reconciliation_date) diff --git a/account_reconcile_reconciliation_date/views/account_invoice.xml b/account_reconcile_reconciliation_date/views/account_invoice.xml deleted file mode 100644 index b523261a..00000000 --- a/account_reconcile_reconciliation_date/views/account_invoice.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - account.invoice.reconciliation.date - account.invoice - - - - - - - - - diff --git a/account_reconcile_reconciliation_date/views/account_move.xml b/account_reconcile_reconciliation_date/views/account_move.xml new file mode 100644 index 00000000..60bb0c4a --- /dev/null +++ b/account_reconcile_reconciliation_date/views/account_move.xml @@ -0,0 +1,17 @@ + + + + account.move.reconciliation.date + account.move + + + + + + + + + diff --git a/account_reconcile_reconciliation_date/views/account_payment.xml b/account_reconcile_reconciliation_date/views/account_payment.xml index 1802aa16..0088cbc8 100644 --- a/account_reconcile_reconciliation_date/views/account_payment.xml +++ b/account_reconcile_reconciliation_date/views/account_payment.xml @@ -5,7 +5,7 @@ account.payment - +