diff --git a/account_partner_reconcile/README.rst b/account_partner_reconcile/README.rst new file mode 100644 index 00000000..f1fff347 --- /dev/null +++ b/account_partner_reconcile/README.rst @@ -0,0 +1,89 @@ +========================= +Account Partner Reconcile +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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--payment-lightgray.png?logo=github + :target: https://github.com/OCA/account-payment/tree/12.0/account_partner_reconcile + :alt: OCA/account-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-payment-12-0/account-payment-12-0-account_partner_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/96/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a button "Match Payments" in the customer & suppliers form +view to allow to start the matching of invoices & payments for that partner. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +The button is visible only to users that belong to the accounting groups +"Accountant" or "Adviser". + +Usage +===== + +#. Enable 'Show Full Accounting Features' +#. Create a new Customer Invoice and Payment +#. Go to the Customer/Supplier view form and click on Match payments + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Eficent +* + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester +* Jaume Planas + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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-payment `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_partner_reconcile/__init__.py b/account_partner_reconcile/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/account_partner_reconcile/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_partner_reconcile/__manifest__.py b/account_partner_reconcile/__manifest__.py new file mode 100644 index 00000000..784bc40d --- /dev/null +++ b/account_partner_reconcile/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2017-19 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + 'name': "Account Partner Reconcile", + 'version': '12.0.1.0.0', + 'category': 'Accounting', + 'author': 'Eficent,' + 'Odoo Community Association (OCA), ', + 'website': 'https://github.com/OCA/account-reconcile', + 'license': 'AGPL-3', + "depends": [ + 'account', + ], + "data": [ + 'views/res_partner_view.xml', + ], + "installable": True +} diff --git a/account_partner_reconcile/i18n/account_partner_reconcile.pot b/account_partner_reconcile/i18n/account_partner_reconcile.pot new file mode 100644 index 00000000..e441b34e --- /dev/null +++ b/account_partner_reconcile/i18n/account_partner_reconcile.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_partner_reconcile +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_partner_reconcile +#: model:ir.model,name:account_partner_reconcile.model_res_partner +msgid "Contact" +msgstr "" + +#. module: account_partner_reconcile +#: model:ir.ui.view,arch_db:account_partner_reconcile.res_partner_view_buttons +msgid "Match payments" +msgstr "" + diff --git a/account_partner_reconcile/models/__init__.py b/account_partner_reconcile/models/__init__.py new file mode 100644 index 00000000..91fed54d --- /dev/null +++ b/account_partner_reconcile/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/account_partner_reconcile/models/res_partner.py b/account_partner_reconcile/models/res_partner.py new file mode 100644 index 00000000..afbbcbc4 --- /dev/null +++ b/account_partner_reconcile/models/res_partner.py @@ -0,0 +1,25 @@ +# Copyright 2017-19 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.multi + def action_open_reconcile(self): + # Open reconciliation view for customers + accounts = self.env['account.account'] + accounts += (self.property_account_receivable_id + + self.property_account_payable_id) + + action_context = {'show_mode_selector': True, + 'partner_ids': [self.id, ], + 'account_ids': accounts.ids} + return { + 'type': 'ir.actions.client', + 'tag': 'manual_reconciliation_view', + 'context': action_context, + } diff --git a/account_partner_reconcile/readme/CONFIGURE.rst b/account_partner_reconcile/readme/CONFIGURE.rst new file mode 100644 index 00000000..b7f142bb --- /dev/null +++ b/account_partner_reconcile/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +The button is visible only to users that belong to the accounting groups +"Accountant" or "Adviser". \ No newline at end of file diff --git a/account_partner_reconcile/readme/CONTRIBUTORS.rst b/account_partner_reconcile/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..3f85fbc5 --- /dev/null +++ b/account_partner_reconcile/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Jordi Ballester +* Jaume Planas \ No newline at end of file diff --git a/account_partner_reconcile/readme/DESCRIPTION.rst b/account_partner_reconcile/readme/DESCRIPTION.rst new file mode 100644 index 00000000..f3d85e2c --- /dev/null +++ b/account_partner_reconcile/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds a button "Match Payments" in the customer & suppliers form +view to allow to start the matching of invoices & payments for that partner. \ No newline at end of file diff --git a/account_partner_reconcile/readme/USAGE.rst b/account_partner_reconcile/readme/USAGE.rst new file mode 100644 index 00000000..c01c915d --- /dev/null +++ b/account_partner_reconcile/readme/USAGE.rst @@ -0,0 +1,3 @@ +#. Enable 'Show Full Accounting Features' +#. Create a new Customer Invoice and Payment +#. Go to the Customer/Supplier view form and click on Match payments \ No newline at end of file diff --git a/account_partner_reconcile/static/description/icon.png b/account_partner_reconcile/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/account_partner_reconcile/static/description/icon.png differ diff --git a/account_partner_reconcile/static/description/index.html b/account_partner_reconcile/static/description/index.html new file mode 100644 index 00000000..f6f2daab --- /dev/null +++ b/account_partner_reconcile/static/description/index.html @@ -0,0 +1,437 @@ + + + + + + +Account Partner Reconcile + + + +
+

Account Partner Reconcile

+ + +

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

+

This module adds a button “Match Payments” in the customer & suppliers form +view to allow to start the matching of invoices & payments for that partner.

+

Table of contents

+ +
+

Configuration

+

The button is visible only to users that belong to the accounting groups +“Accountant” or “Adviser”.

+
+
+

Usage

+
    +
  1. Enable ‘Show Full Accounting Features’
  2. +
  3. Create a new Customer Invoice and Payment
  4. +
  5. Go to the Customer/Supplier view form and click on Match payments
  6. +
+
+
+

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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Eficent
  • +
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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-payment project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_partner_reconcile/tests/__init__.py b/account_partner_reconcile/tests/__init__.py new file mode 100644 index 00000000..2d8892c4 --- /dev/null +++ b/account_partner_reconcile/tests/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_account_partner_reconcile diff --git a/account_partner_reconcile/tests/test_account_partner_reconcile.py b/account_partner_reconcile/tests/test_account_partner_reconcile.py new file mode 100644 index 00000000..5e44f9d7 --- /dev/null +++ b/account_partner_reconcile/tests/test_account_partner_reconcile.py @@ -0,0 +1,38 @@ +# Copyright 2017-19 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestAccountPartnerReconcile(TransactionCase): + """ + Tests for Account Partner Reconcile. + """ + + def setUp(self): + super(TestAccountPartnerReconcile, self).setUp() + + self.partner1 = self.env.ref('base.res_partner_1') + + def test_account_partner_reconcile(self): + res = self.partner1.action_open_reconcile() + + # assertDictContainsSubset is deprecated in Python <3.2 + expect = { + 'type': 'ir.actions.client', + 'tag': 'manual_reconciliation_view', + } + self.assertDictEqual( + expect, {k: v for k, v in res.items() if k in expect}, + 'There was an error and the manual_reconciliation_view ' + 'couldn\'t be opened.') + + expect = { + 'partner_ids': self.partner1.ids, + 'show_mode_selector': True, + } + self.assertDictEqual( + expect, {k: v for k, v in res['context'].items() if k in expect}, + 'There was an error and the manual_reconciliation_view ' + 'couldn\'t be opened.') diff --git a/account_partner_reconcile/views/res_partner_view.xml b/account_partner_reconcile/views/res_partner_view.xml new file mode 100644 index 00000000..52a2f257 --- /dev/null +++ b/account_partner_reconcile/views/res_partner_view.xml @@ -0,0 +1,22 @@ + + + + + + + res.partner.view.buttons + res.partner + + + + +
+ +
+
+
+ +