diff --git a/partner_time_to_pay/README.rst b/partner_time_to_pay/README.rst new file mode 100644 index 000000000..51b36097d --- /dev/null +++ b/partner_time_to_pay/README.rst @@ -0,0 +1,136 @@ +=================== +Partner Time to Pay +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c92c99443662f43199114dd5d0bcd3682b4b946bab3e4f0b0672590b834115ac + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--invoice--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/account-invoice-reporting/tree/15.0/partner_time_to_pay + :alt: OCA/account-invoice-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-invoice-reporting-15-0/account-invoice-reporting-15-0-partner_time_to_pay + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoice-reporting&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module displays statistics related to the receivables and payables behavior of a partner on the *Sales & Purchases* tab of the partner form view. +Also displays the full reconcile payment date on invoices. +Statistics on each contact corresponds to the partner and its child contacts. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +Your preferred way to install addons will work with Partner Time to Pay. + +An easy way to install it with all its dependencies is using pip: + +* ``pip install --pre odoo11-addon-partner_time_to_pay odoo-autodiscover`` +* then restart Odoo, update the addons list in your database, and install + the Partner Time to Pay application. + +Usage +===== + +* Go to the *Sales & Purchases* tab of a partner +* There are 6 new fields named *AVG Days to Payable/Receivable*. + These fields represent the average days to pay/receive for last year (LY), + this year (YTD) and since the first invoice (lifetime). +* Adds a new field in the tree and form invoices views to check the + Full Reconcile Payment Date + +Known issues / Roadmap +====================== + +The partner_time_to_pay `roadmap `_ +and `known issues `_ can +be found on GitHub. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators +* Moduon + +Contributors +~~~~~~~~~~~~ + +* Ray Carnes +* Maxime Chambreuil +* Bhavesh Odedra +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Jevin Dement +* Rafael Blasco (https://www.moduon.team/) +* Eduardo de Miguel (https://www.moduon.team/) + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators +* Moduon Team + +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. + +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn +.. |maintainer-Shide| image:: https://github.com/Shide.png?size=40px + :target: https://github.com/Shide + :alt: Shide + +Current `maintainers `__: + +|maintainer-max3903| |maintainer-rafaelbn| |maintainer-Shide| + +This module is part of the `OCA/account-invoice-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_time_to_pay/__init__.py b/partner_time_to_pay/__init__.py new file mode 100644 index 000000000..69f7babdf --- /dev/null +++ b/partner_time_to_pay/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/partner_time_to_pay/__manifest__.py b/partner_time_to_pay/__manifest__.py new file mode 100644 index 000000000..b11a3a808 --- /dev/null +++ b/partner_time_to_pay/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Partner Time to Pay", + "summary": "Add receivables and payables statistics to partners", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "development_status": "Beta", + "author": "Open Source Integrators, Odoo Community Association (OCA), Moduon", + "category": "Accounting & Finance", + "website": "https://github.com/OCA/account-invoice-reporting", + "maintainers": ["max3903", "rafaelbn", "Shide"], + "depends": ["account"], + "data": [ + "views/account_move_view.xml", + "views/res_partner_view.xml", + ], + "installable": True, +} diff --git a/partner_time_to_pay/i18n/ca.po b/partner_time_to_pay/i18n/ca.po new file mode 100644 index 000000000..c13d720ab --- /dev/null +++ b/partner_time_to_pay/i18n/ca.po @@ -0,0 +1,113 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-06-23 09:08+0000\n" +"Last-Translator: eccit-quim \n" +"Language-Team: none\n" +"Language: ca\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.17\n" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "Mitjana de dies de pagament (Any anterior)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +msgid "AVG Days to Payable (YTD)" +msgstr "Mitjana de dies de pagament (Any en curs)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +msgid "AVG Days to Payable (lifetime)" +msgstr "Mitjana de dies de pagament (sempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "Mitjana de dies de cobrament (Any anterior)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +msgid "AVG Days to Receivable (YTD)" +msgstr "Mitjana de dies de cobrament (Any en curs)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +msgid "AVG Days to Receivable (lifetime)" +msgstr "Mitjana de dies de cobrament (sempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "Mitjana de dies de pagament per factures entrants l'any anterior." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "Mitjana de dies de pagament per factures entrants l'any en curs." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "Mitjana de dies de pagament per factures entrants." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "Mitjana de dies de pagament per factures sortints l'any anterior." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "Mitjana de dies de pagament per factures sortints l'any en curs." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "Mitjana de dies de pagament per factures sortints." + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "Conacte" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "Data de la conciliació completa d'aquesta factura." + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "Assentaments comptables" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "Data de pagament" diff --git a/partner_time_to_pay/i18n/es.po b/partner_time_to_pay/i18n/es.po new file mode 100644 index 000000000..8475f9de7 --- /dev/null +++ b/partner_time_to_pay/i18n/es.po @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-04-12 06:27+0000\n" +"PO-Revision-Date: 2023-04-12 08:29+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 3.1.1\n" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "Promedio de días de pago (año anterior)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +msgid "AVG Days to Payable (YTD)" +msgstr "Promedio de días de pago (año actual)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +msgid "AVG Days to Payable (lifetime)" +msgstr "Promedio de días de pago (siempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "Promedio de días de cobro (año anterior)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +msgid "AVG Days to Receivable (YTD)" +msgstr "Promedio de días de cobro (año actual)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +msgid "AVG Days to Receivable (lifetime)" +msgstr "Promedio de días de cobro (siempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "Promedio de días de pago para las facturas entrantes el año anterior." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "Promedio de días de pago para las facturas entrantes éste año." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "Promedio de días de pago para las facturas entrantes." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "Promedio de días de pago para las facturas salientes el año anterior." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "Promedio de días de pago para las facturas salientes éste año." + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "Promedio de días de pago para las facturas salientes." + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "Fecha cuando la reconciliación completa de ésta factura ocurrió." + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "Asiento contable" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "Fecha de pago" diff --git a/partner_time_to_pay/i18n/fr.po b/partner_time_to_pay/i18n/fr.po new file mode 100644 index 000000000..94a278727 --- /dev/null +++ b/partner_time_to_pay/i18n/fr.po @@ -0,0 +1,122 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +# Translators: +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-30 23:33+0000\n" +"PO-Revision-Date: 2017-06-30 23:33+0000\n" +"Last-Translator: Quentin THEURET , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +#, fuzzy +msgid "AVG Days to Payable (YTD)" +msgstr "Moy. Jours pour payer (YTD)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +#, fuzzy +msgid "AVG Days to Payable (lifetime)" +msgstr "Moy. Jours pour payer (durée)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +#, fuzzy +msgid "AVG Days to Receivable (YTD)" +msgstr "Moy. Jours pour payer (YTD)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +#, fuzzy +msgid "AVG Days to Receivable (lifetime)" +msgstr "Moy. Jours pour payer (durée)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "" + +#~ msgid "Partner" +#~ msgstr "Partenaire" diff --git a/partner_time_to_pay/i18n/nl_NL.po b/partner_time_to_pay/i18n/nl_NL.po new file mode 100644 index 000000000..6d6096a00 --- /dev/null +++ b/partner_time_to_pay/i18n/nl_NL.po @@ -0,0 +1,123 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-28 00:42+0000\n" +"PO-Revision-Date: 2017-06-28 00:42+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +#, fuzzy +msgid "AVG Days to Payable (YTD)" +msgstr "Gem. Dagen tot Betalen (dit jaar)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +#, fuzzy +msgid "AVG Days to Payable (lifetime)" +msgstr "Gem. Dagen tot Betalen (alle)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +#, fuzzy +msgid "AVG Days to Receivable (YTD)" +msgstr "Gem. Dagen tot Betalen (dit jaar)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +#, fuzzy +msgid "AVG Days to Receivable (lifetime)" +msgstr "Gem. Dagen tot Betalen (alle)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "" + +#~ msgid "Partner" +#~ msgstr "Relatie" diff --git a/partner_time_to_pay/i18n/partner_time_to_pay.pot b/partner_time_to_pay/i18n/partner_time_to_pay.pot new file mode 100644 index 000000000..b5ba74480 --- /dev/null +++ b/partner_time_to_pay/i18n/partner_time_to_pay.pot @@ -0,0 +1,110 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +msgid "AVG Days to Payable (YTD)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +msgid "AVG Days to Payable (lifetime)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +msgid "AVG Days to Receivable (YTD)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +msgid "AVG Days to Receivable (lifetime)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "" diff --git a/partner_time_to_pay/i18n/pt.po b/partner_time_to_pay/i18n/pt.po new file mode 100644 index 000000000..a9d0a6d55 --- /dev/null +++ b/partner_time_to_pay/i18n/pt.po @@ -0,0 +1,113 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_time_to_pay +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-08-18 01:44+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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 3.7.1\n" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ly +msgid "AVG Days to Payable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_ytd +msgid "AVG Days to Payable (YTD)" +msgstr "MED Dias até Pagável (YTD)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2p_life +msgid "AVG Days to Payable (lifetime)" +msgstr "MED Dias até Pagável (sempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ly +msgid "AVG Days to Receivable (LY)" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_ytd +msgid "AVG Days to Receivable (YTD)" +msgstr "MED Dias até Recebível (YTD)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,field_description:partner_time_to_pay.field_res_users__d2r_life +msgid "AVG Days to Receivable (lifetime)" +msgstr "MED Dias até Recebível (sempre)" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ly +msgid "Average days of payment for incoming invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_ytd +msgid "Average days of payment for incoming invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2p_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2p_life +msgid "Average days of payment for incoming invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ly +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ly +msgid "Average days of payment for outgoing invoices last year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_ytd +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_ytd +msgid "Average days of payment for outgoing invoices this year." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_res_partner__d2r_life +#: model:ir.model.fields,help:partner_time_to_pay.field_res_users__d2r_life +msgid "Average days of payment for outgoing invoices." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: partner_time_to_pay +#: model:ir.model.fields,help:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,help:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Date when the complete reconciliation of this invoice occurred." +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model,name:partner_time_to_pay.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: partner_time_to_pay +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_bank_statement_line__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_move__full_reconcile_payment_date +#: model:ir.model.fields,field_description:partner_time_to_pay.field_account_payment__full_reconcile_payment_date +msgid "Payment Date" +msgstr "" diff --git a/partner_time_to_pay/models/__init__.py b/partner_time_to_pay/models/__init__.py new file mode 100644 index 000000000..58510ebfa --- /dev/null +++ b/partner_time_to_pay/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import account_move +from . import res_partner diff --git a/partner_time_to_pay/models/account_move.py b/partner_time_to_pay/models/account_move.py new file mode 100644 index 000000000..f0a8060ee --- /dev/null +++ b/partner_time_to_pay/models/account_move.py @@ -0,0 +1,50 @@ +# Copyright 2022 - Moduon +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + full_reconcile_payment_date = fields.Date( + string="Payment Date", + compute="_compute_full_reconcile_payment_date", + store=True, + compute_sudo=True, + help="Date when the complete reconciliation of this invoice occurred.", + ) + + @api.depends("payment_state") + def _compute_full_reconcile_payment_date(self): + aml_model = self.env["account.move.line"] + in_payment_states = {"paid", self._get_invoice_in_payment_state()} + for move in self: + if move.payment_state in in_payment_states: + if not move.full_reconcile_payment_date: + valid_accounts = move.line_ids.filtered( + lambda ml: ml.account_id.account_type + in {"asset_receivable", "liability_payable"} + ).mapped("account_id") + reconciled_moves = ( + aml_model.search( + [ + ("account_id", "in", valid_accounts.ids), + ("parent_state", "=", "posted"), + ("partner_id", "=", move.commercial_partner_id.id), + ("reconciled", "=", True), + ("id", "not in", move.line_ids.ids), + ( + "full_reconcile_id.reconciled_line_ids", + "in", + move.line_ids.ids, + ), + ] + ) + .mapped("move_id") + .sorted("date") + ) + move.full_reconcile_payment_date = ( + reconciled_moves[-1:].date or fields.Date.today() + ) + continue + move.full_reconcile_payment_date = None diff --git a/partner_time_to_pay/models/res_partner.py b/partner_time_to_pay/models/res_partner.py new file mode 100644 index 000000000..742d85220 --- /dev/null +++ b/partner_time_to_pay/models/res_partner.py @@ -0,0 +1,108 @@ +# Copyright (C) 2019 Open Source Integrators +# Copyright 2022 - Moduon +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + # Suppliers + d2p_life = fields.Float( + compute="_compute_d2x", + string="AVG Days to Payable (lifetime)", + store=True, + help="Average days of payment for incoming invoices.", + ) + d2p_ytd = fields.Float( + compute="_compute_d2x", + string="AVG Days to Payable (YTD)", + store=True, + help="Average days of payment for incoming invoices this year.", + ) + d2p_ly = fields.Float( + compute="_compute_d2x", + string="AVG Days to Payable (LY)", + store=True, + help="Average days of payment for incoming invoices last year.", + ) + # Customers + d2r_life = fields.Float( + compute="_compute_d2x", + string="AVG Days to Receivable (lifetime)", + store=True, + help="Average days of payment for outgoing invoices.", + ) + d2r_ytd = fields.Float( + compute="_compute_d2x", + string="AVG Days to Receivable (YTD)", + store=True, + help="Average days of payment for outgoing invoices this year.", + ) + d2r_ly = fields.Float( + compute="_compute_d2x", + string="AVG Days to Receivable (LY)", + store=True, + help="Average days of payment for outgoing invoices last year.", + ) + + @api.depends("invoice_ids.full_reconcile_payment_date") + def _compute_d2x(self): + for partner in self: + ( + partner.d2r_ly, + partner.d2r_ytd, + partner.d2r_life, + ) = partner._compute_d2x_per_invoice_type( + (partner + partner.child_ids).invoice_ids, {"out_invoice"} + ) + ( + partner.d2p_ly, + partner.d2p_ytd, + partner.d2p_life, + ) = partner._compute_d2x_per_invoice_type( + (partner + partner.child_ids).invoice_ids, {"in_invoice"} + ) + + def _compute_d2x_per_invoice_type(self, invoices, invoice_types): + self.ensure_one() + this_year = fields.Date.today().year + last_year = this_year - 1 + + total_number_of_invoices_life, total_days_to_pay_life = 0, 0 + total_number_of_invoices_ytd, total_days_to_pay_ytd = 0, 0 + total_number_of_invoices_ly, total_days_to_pay_ly = 0, 0 + d2x_ly, d2x_ytd, d2x_life = 0, 0, 0 + + selected_invoices = invoices.filtered( + lambda inv: inv.move_type in invoice_types + and inv.full_reconcile_payment_date + and inv.state == "posted" + ) + for invoice in selected_invoices: + days_until_invoice_is_paid = ( + invoice.full_reconcile_payment_date - invoice.invoice_date + ).days + + total_number_of_invoices_life += 1 + total_days_to_pay_life += days_until_invoice_is_paid + + if invoice.invoice_date.year == last_year: + total_number_of_invoices_ly += 1 + total_days_to_pay_ly += days_until_invoice_is_paid + + if invoice.invoice_date.year == this_year: + total_number_of_invoices_ytd += 1 + total_days_to_pay_ytd += days_until_invoice_is_paid + + if total_number_of_invoices_ly: + d2x_ly = total_days_to_pay_ly / total_number_of_invoices_ly + + if total_number_of_invoices_ytd: + d2x_ytd = total_days_to_pay_ytd / total_number_of_invoices_ytd + + if total_number_of_invoices_life: + d2x_life = total_days_to_pay_life / total_number_of_invoices_life + + return d2x_ly, d2x_ytd, d2x_life diff --git a/partner_time_to_pay/readme/CONTRIBUTORS.rst b/partner_time_to_pay/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..7df41fccc --- /dev/null +++ b/partner_time_to_pay/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* Ray Carnes +* Maxime Chambreuil +* Bhavesh Odedra +* Sandip Mangukiya +* Serpent Consulting Services Pvt. Ltd. +* Jevin Dement +* Rafael Blasco (https://www.moduon.team/) +* Eduardo de Miguel (https://www.moduon.team/) diff --git a/partner_time_to_pay/readme/CREDITS.rst b/partner_time_to_pay/readme/CREDITS.rst new file mode 100644 index 000000000..a20dc8b67 --- /dev/null +++ b/partner_time_to_pay/readme/CREDITS.rst @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +* Open Source Integrators +* Moduon Team diff --git a/partner_time_to_pay/readme/DESCRIPTION.rst b/partner_time_to_pay/readme/DESCRIPTION.rst new file mode 100644 index 000000000..49b82b995 --- /dev/null +++ b/partner_time_to_pay/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module displays statistics related to the receivables and payables behavior of a partner on the *Sales & Purchases* tab of the partner form view. +Also displays the full reconcile payment date on invoices. +Statistics on each contact corresponds to the partner and its child contacts. diff --git a/partner_time_to_pay/readme/INSTALL.rst b/partner_time_to_pay/readme/INSTALL.rst new file mode 100644 index 000000000..51f31d65c --- /dev/null +++ b/partner_time_to_pay/readme/INSTALL.rst @@ -0,0 +1,7 @@ +Your preferred way to install addons will work with Partner Time to Pay. + +An easy way to install it with all its dependencies is using pip: + +* ``pip install --pre odoo11-addon-partner_time_to_pay odoo-autodiscover`` +* then restart Odoo, update the addons list in your database, and install + the Partner Time to Pay application. diff --git a/partner_time_to_pay/readme/ROADMAP.rst b/partner_time_to_pay/readme/ROADMAP.rst new file mode 100644 index 000000000..3a4b00a41 --- /dev/null +++ b/partner_time_to_pay/readme/ROADMAP.rst @@ -0,0 +1,3 @@ +The partner_time_to_pay `roadmap `_ +and `known issues `_ can +be found on GitHub. diff --git a/partner_time_to_pay/readme/USAGE.rst b/partner_time_to_pay/readme/USAGE.rst new file mode 100644 index 000000000..575472648 --- /dev/null +++ b/partner_time_to_pay/readme/USAGE.rst @@ -0,0 +1,6 @@ +* Go to the *Sales & Purchases* tab of a partner +* There are 6 new fields named *AVG Days to Payable/Receivable*. + These fields represent the average days to pay/receive for last year (LY), + this year (YTD) and since the first invoice (lifetime). +* Adds a new field in the tree and form invoices views to check the + Full Reconcile Payment Date diff --git a/partner_time_to_pay/static/description/icon.png b/partner_time_to_pay/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/partner_time_to_pay/static/description/icon.png differ diff --git a/partner_time_to_pay/static/description/index.html b/partner_time_to_pay/static/description/index.html new file mode 100644 index 000000000..c0cebf775 --- /dev/null +++ b/partner_time_to_pay/static/description/index.html @@ -0,0 +1,472 @@ + + + + + + +Partner Time to Pay + + + +
+

Partner Time to Pay

+ + +

Beta License: AGPL-3 OCA/account-invoice-reporting Translate me on Weblate Try me on Runboat

+

This module displays statistics related to the receivables and payables behavior of a partner on the Sales & Purchases tab of the partner form view. +Also displays the full reconcile payment date on invoices. +Statistics on each contact corresponds to the partner and its child contacts.

+

Table of contents

+ +
+

Installation

+

Your preferred way to install addons will work with Partner Time to Pay.

+

An easy way to install it with all its dependencies is using pip:

+
    +
  • pip install --pre odoo11-addon-partner_time_to_pay odoo-autodiscover
  • +
  • then restart Odoo, update the addons list in your database, and install +the Partner Time to Pay application.
  • +
+
+
+

Usage

+
    +
  • Go to the Sales & Purchases tab of a partner
  • +
  • There are 6 new fields named AVG Days to Payable/Receivable. +These fields represent the average days to pay/receive for last year (LY), +this year (YTD) and since the first invoice (lifetime).
  • +
  • Adds a new field in the tree and form invoices views to check the +Full Reconcile Payment Date
  • +
+
+
+

Known issues / Roadmap

+

The partner_time_to_pay roadmap +and known issues can +be found on GitHub.

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
  • Moduon
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+ +
+
+

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.

+

Current maintainers:

+

max3903 rafaelbn Shide

+

This module is part of the OCA/account-invoice-reporting project on GitHub.

+

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

+
+
+
+ + diff --git a/partner_time_to_pay/tests/__init__.py b/partner_time_to_pay/tests/__init__.py new file mode 100644 index 000000000..caa0762b7 --- /dev/null +++ b/partner_time_to_pay/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_partner_time_to_pay diff --git a/partner_time_to_pay/tests/test_partner_time_to_pay.py b/partner_time_to_pay/tests/test_partner_time_to_pay.py new file mode 100644 index 000000000..0fc7b64a3 --- /dev/null +++ b/partner_time_to_pay/tests/test_partner_time_to_pay.py @@ -0,0 +1,74 @@ +# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd. +# () +# Copyright 2022 - Moduon +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from datetime import timedelta + +from odoo import fields +from odoo.tests import Form, TransactionCase + + +class TestPartnerTimeToPay(TransactionCase): + def setUp(self): + super(TestPartnerTimeToPay, self).setUp() + apr_model = self.env["account.payment.register"] + am_model = self.env["account.move"] + rp_model = self.env["res.partner"] + today = fields.Date.today() + self.partner = rp_model.create( + { + "name": "Test Time to Pay Partner", + "is_company": True, + "child_ids": [(0, 0, {"name": "TTPP Contact", "type": "invoice"})], + } + ) + self.time_to_pay_days = 10 + # Create invoice for last year + move_form_ly = Form(am_model.with_context(default_move_type="out_invoice")) + move_form_ly.partner_id = self.partner.child_ids[0] + move_form_ly.invoice_date = today - timedelta(days=365) + with move_form_ly.invoice_line_ids.new() as line_form_ly: + line_form_ly.name = "Inv Line Partner Time To Pay LY" + line_form_ly.price_unit = 100.0 + line_form_ly.quantity = 10.0 + invoice_ly = move_form_ly.save() + invoice_ly.action_post() + # Create payment for last year + apr_model.with_context( + active_model="account.move", active_ids=invoice_ly.ids + ).create( + { + "payment_date": invoice_ly.date + timedelta(days=self.time_to_pay_days), + } + ).with_context( + dont_redirect_to_payments=True, + ).action_create_payments() + # Create invoice for this year + move_form_ty = Form(am_model.with_context(default_move_type="out_invoice")) + move_form_ty.partner_id = self.partner.child_ids[0] + move_form_ty.invoice_date = today + with move_form_ty.invoice_line_ids.new() as line_form_ty: + line_form_ly.name = "Inv Line Partner Time To Pay TY" + line_form_ty.price_unit = 100.0 + line_form_ty.quantity = 10.0 + invoice_ty = move_form_ty.save() + invoice_ty.action_post() + # Create payment for this year + apr_model.with_context( + active_model="account.move", active_ids=invoice_ty.ids + ).create( + { + "payment_date": invoice_ty.date + timedelta(days=self.time_to_pay_days), + } + ).with_context( + dont_redirect_to_payments=True, + ).action_create_payments() + + def test_partner_compute_d2x(self): + self.assertEqual(self.partner.child_ids[0].d2r_ly, self.time_to_pay_days) + self.assertEqual(self.partner.child_ids[0].d2r_ytd, self.time_to_pay_days) + self.assertEqual(self.partner.child_ids[0].d2r_life, self.time_to_pay_days) + self.assertEqual(self.partner.d2r_ly, self.time_to_pay_days) + self.assertEqual(self.partner.d2r_ytd, self.time_to_pay_days) + self.assertEqual(self.partner.d2r_life, self.time_to_pay_days) diff --git a/partner_time_to_pay/views/account_move_view.xml b/partner_time_to_pay/views/account_move_view.xml new file mode 100644 index 000000000..14bba7880 --- /dev/null +++ b/partner_time_to_pay/views/account_move_view.xml @@ -0,0 +1,28 @@ + + + + account.move.form.dtp + account.move + + + + + + + + + + account.invoice.tree.dtp + account.move + + + + + + + + diff --git a/partner_time_to_pay/views/res_partner_view.xml b/partner_time_to_pay/views/res_partner_view.xml new file mode 100644 index 000000000..867e36885 --- /dev/null +++ b/partner_time_to_pay/views/res_partner_view.xml @@ -0,0 +1,21 @@ + + + + res.partner.form.dtp + res.partner + + + + + + + + + + + + + + + diff --git a/setup/partner_time_to_pay/odoo/addons/partner_time_to_pay b/setup/partner_time_to_pay/odoo/addons/partner_time_to_pay new file mode 120000 index 000000000..856432ed9 --- /dev/null +++ b/setup/partner_time_to_pay/odoo/addons/partner_time_to_pay @@ -0,0 +1 @@ +../../../../partner_time_to_pay \ No newline at end of file diff --git a/setup/partner_time_to_pay/setup.py b/setup/partner_time_to_pay/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/partner_time_to_pay/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)