diff --git a/partner_aging/README.rst b/partner_aging/README.rst new file mode 100644 index 000000000000..0bd83338a9f4 --- /dev/null +++ b/partner_aging/README.rst @@ -0,0 +1,114 @@ +===================================== +Interactive Partner Aging at any date +===================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |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/14.0/partner_aging + :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-14-0/account-payment-14-0-partner_aging + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module creates a new customer / supplier aging report as of a given date. + +The default Aged Partner balance report is related to a specific date and a +static PDF that is based on the difference between credits and debits, not +based on documents such as Invoices/Bills and Payments. + +This module provides an interactive view with details of the invoice. + +This module does not consider unapplied credits. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Go to Accounting +#. Click on Sales > Customer Aging or Purchases > Supplier Aging +#. Change the date if necessary + +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 +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* Bhavesh Odedra +* Balaji Kannan +* Sandeep Mangukiya +* Sudarshan Kadalazhi +* Murtuza Saleh +* Maxime Chambreuil +* Nikul Chaudhary +* Ammar Offcewala +* Urvisha Desai + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Open Source Integrators +* Serpent Consulting Services Pvt. Ltd. + +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-urvisha-osi| image:: https://github.com/urvisha-osi.png?size=40px + :target: https://github.com/urvisha-osi + :alt: urvisha-osi + +Current `maintainer `__: + +|maintainer-urvisha-osi| + +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/partner_aging/__init__.py b/partner_aging/__init__.py new file mode 100644 index 000000000000..ffe5d86224f2 --- /dev/null +++ b/partner_aging/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2022 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import wizard diff --git a/partner_aging/__manifest__.py b/partner_aging/__manifest__.py new file mode 100644 index 000000000000..f07a8439a038 --- /dev/null +++ b/partner_aging/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2012 - 2022 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Interactive Partner Aging at any date", + "summary": "Aging as a view - invoices and credits", + "version": "15.0.1.0.0", + "license": "AGPL-3", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "category": "Accounting & Finance", + "website": "https://github.com/OCA/account-payment", + "depends": ["account"], + "data": [ + "security/ir.model.access.csv", + "wizard/res_partner_aging_customer.xml", + "wizard/res_partner_aging_supplier.xml", + ], + "installable": True, + "application": True, + "development_status": "Production/Stable", + "maintainers": ["Urvisha-OSI"], +} diff --git a/partner_aging/i18n/fr.po b/partner_aging/i18n/fr.po new file mode 100644 index 000000000000..98eaecf18ceb --- /dev/null +++ b/partner_aging/i18n/fr.po @@ -0,0 +1,267 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_aging +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-06-07 11:23+0000\n" +"Last-Translator: Yann Papouin \n" +"Language-Team: none\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_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_121togr +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_121togr +msgid "+121" +msgstr "+121" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_01to30 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_01to30 +msgid "1/30" +msgstr "1/30" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_31to60 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_31to60 +msgid "31/60" +msgstr "31/60" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_61to90 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_61to90 +msgid "61/90" +msgstr "61/90" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_91to120 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_91to120 +msgid "91/120" +msgstr "91/120" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__age_date +msgid "Aging Date" +msgstr "Date d’échéance" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__avg_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__avg_days_overdue +msgid "Avg Days Overdue" +msgstr "Durée moyenne de retard" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Cancel" +msgstr "Annuler" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Choose date for Supplier Aging" +msgstr "Choisir une date pour la balance âgée des fournisseurs" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Choose date for partner Aging" +msgstr "Choisir une date pour la balance âgée des clients" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Current" +msgstr "Actuel" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer" +msgstr "Client" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_partner_aging_date +#: model:ir.ui.menu,name:partner_aging.menu_customer_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Customer Aging" +msgstr "Balance âgée des clients" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_customer_aging_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer Aging Date wise" +msgstr "Balance âgée des clients par échéances" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date +msgid "Date" +msgstr "Date" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__max_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__max_days_overdue +msgid "Days Outstanding" +msgstr "Jours exceptionnels" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Due Date" +msgstr "Date d'échéance" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Group By..." +msgstr "Regrouper par..." + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__id +msgid "ID" +msgstr "ID" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_id +msgid "Invoice" +msgstr "Facture" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__inv_date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__inv_date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Invoice Date" +msgstr "Date de la facture" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_date +msgid "Last Updated on" +msgstr "Mis à jour le" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__not_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__not_due +msgid "Not Due Yet" +msgstr "Pas encore dû" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_ref +msgid "Our Invoice" +msgstr "Nos factures" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Overdue" +msgstr "Retard" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__partner_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__partner_id +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Partner" +msgstr "Partenaire" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_customer +msgid "Res Partner Aging Customer" +msgstr "Res Partner Balance Agée Client" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_date +msgid "Res Partner Aging Date" +msgstr "Res Partner Balance Agée Date" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_supplier +msgid "Res Partner Aging Supplier" +msgstr "Res Partner Balance Agée Fournisseur" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__salesman +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__salesman +msgid "Sales Rep" +msgstr "Commercial" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier" +msgstr "Fournisseur" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_date +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_tree +#: model:ir.ui.menu,name:partner_aging.menu_supplier_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Supplier Aging" +msgstr "Balance âgée des fournisseurs" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier Aging Date wise" +msgstr "Balance âgée des fournisseurs par échéances" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_ref +msgid "Their Invoice" +msgstr "Leurs factures" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__total +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__total +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Total" +msgstr "Total" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "or" +msgstr "ou" diff --git a/partner_aging/i18n/partner_aging.pot b/partner_aging/i18n/partner_aging.pot new file mode 100644 index 000000000000..643d452bbc1d --- /dev/null +++ b/partner_aging/i18n/partner_aging.pot @@ -0,0 +1,265 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_aging +# +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_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_121togr +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_121togr +msgid "+121" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_01to30 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_01to30 +msgid "1/30" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_31to60 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_31to60 +msgid "31/60" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_61to90 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_61to90 +msgid "61/90" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_91to120 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_91to120 +msgid "91/120" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__age_date +msgid "Aging Date" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__avg_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__avg_days_overdue +msgid "Avg Days Overdue" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Cancel" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Choose date for Supplier Aging" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Choose date for partner Aging" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_uid +msgid "Created by" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_date +msgid "Created on" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Current" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer" +msgstr "" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_partner_aging_date +#: model:ir.ui.menu,name:partner_aging.menu_customer_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Customer Aging" +msgstr "" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_customer_aging_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer Aging Date wise" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date +msgid "Date" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__max_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__max_days_overdue +msgid "Days Outstanding" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__display_name +msgid "Display Name" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Due Date" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Group By..." +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__id +msgid "ID" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_id +msgid "Invoice" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__inv_date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__inv_date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Invoice Date" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier____last_update +msgid "Last Modified on" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_date +msgid "Last Updated on" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__not_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__not_due +msgid "Not Due Yet" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_ref +msgid "Our Invoice" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Overdue" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__partner_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__partner_id +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Partner" +msgstr "" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_customer +msgid "Res Partner Aging Customer" +msgstr "" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_date +msgid "Res Partner Aging Date" +msgstr "" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_supplier +msgid "Res Partner Aging Supplier" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__salesman +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__salesman +msgid "Sales Rep" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier" +msgstr "" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_date +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_tree +#: model:ir.ui.menu,name:partner_aging.menu_supplier_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Supplier Aging" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier Aging Date wise" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_ref +msgid "Their Invoice" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__total +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__total +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Total" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "or" +msgstr "" diff --git a/partner_aging/i18n/pt.po b/partner_aging/i18n/pt.po new file mode 100644 index 000000000000..35c4bcd49625 --- /dev/null +++ b/partner_aging/i18n/pt.po @@ -0,0 +1,273 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_aging +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_121togr +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_121togr +msgid "+121" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_01to30 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_01to30 +msgid "1/30" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_31to60 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_31to60 +msgid "31/60" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_61to90 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_61to90 +msgid "61/90" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__days_due_91to120 +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__days_due_91to120 +msgid "91/120" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__age_date +msgid "Aging Date" +msgstr "Data de Antiguidade" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__avg_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__avg_days_overdue +msgid "Avg Days Overdue" +msgstr "Med. Dias Vencidos" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Cancel" +msgstr "Cancelar" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Choose date for Supplier Aging" +msgstr "Escolha data para Antiguidade de Fornecedores" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Choose date for partner Aging" +msgstr "Escolha data para Antiguidade de Parceiros" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_uid +msgid "Created by" +msgstr "Criado por" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__create_date +msgid "Created on" +msgstr "Criado em" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Current" +msgstr "Corrente" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer" +msgstr "Cliente" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_partner_aging_date +#: model:ir.ui.menu,name:partner_aging.menu_customer_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +msgid "Customer Aging" +msgstr "Antiguidade de Clientes" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_customer_aging_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +msgid "Customer Aging Date wise" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date +msgid "Date" +msgstr "Data" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__max_days_overdue +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__max_days_overdue +msgid "Days Outstanding" +msgstr "Dias Por Liquidar" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__display_name +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__display_name +msgid "Display Name" +msgstr "Nome a Exibir" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Due Date" +msgstr "Data de Vencimento" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Group By..." +msgstr "Agrupar Por..." + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__id +msgid "ID" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_id +msgid "Invoice" +msgstr "Fatura" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__inv_date_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__inv_date_due +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Invoice Date" +msgstr "Data da Fatura" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date____last_update +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier____last_update +msgid "Last Modified on" +msgstr "Última Modific. em" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_uid +msgid "Last Updated by" +msgstr "Última Atualização por" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_date__write_date +msgid "Last Updated on" +msgstr "Última Atualização em" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__not_due +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__not_due +msgid "Not Due Yet" +msgstr "Vincendo" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Open Document" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__invoice_ref +msgid "Our Invoice" +msgstr "Nossa Fatura" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Overdue" +msgstr "Vencido" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__partner_id +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__partner_id +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +msgid "Partner" +msgstr "Parceiro" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_customer +msgid "Res Partner Aging Customer" +msgstr "" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_date +msgid "Res Partner Aging Date" +msgstr "" + +#. module: partner_aging +#: model:ir.model,name:partner_aging.model_res_partner_aging_supplier +msgid "Res Partner Aging Supplier" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__salesman +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__salesman +msgid "Sales Rep" +msgstr "Repr. Vendas" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier" +msgstr "Fornecedor" + +#. module: partner_aging +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_date +#: model:ir.actions.act_window,name:partner_aging.action_supplier_aging_tree +#: model:ir.ui.menu,name:partner_aging.menu_supplier_aging_wizard +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "Supplier Aging" +msgstr "Antiguidade de Fornecedores" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Supplier Aging Date wise" +msgstr "" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__invoice_ref +msgid "Their Invoice" +msgstr "Fatura Deles" + +#. module: partner_aging +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_customer__total +#: model:ir.model.fields,field_description:partner_aging.field_res_partner_aging_supplier__total +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_customer_aging_ad_tree +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_search +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_ad_tree +msgid "Total" +msgstr "" + +#. module: partner_aging +#: model_terms:ir.ui.view,arch_db:partner_aging.view_partner_aging_date +#: model_terms:ir.ui.view,arch_db:partner_aging.view_supplier_aging_date +msgid "or" +msgstr "ou" diff --git a/partner_aging/readme/CONTRIBUTORS.rst b/partner_aging/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..fc984e6b8650 --- /dev/null +++ b/partner_aging/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* Bhavesh Odedra +* Balaji Kannan +* Sandeep Mangukiya +* Sudarshan Kadalazhi +* Murtuza Saleh +* Maxime Chambreuil +* Nikul Chaudhary +* Ammar Offcewala +* Urvisha Desai diff --git a/partner_aging/readme/CREDITS.rst b/partner_aging/readme/CREDITS.rst new file mode 100644 index 000000000000..652cd7148e02 --- /dev/null +++ b/partner_aging/readme/CREDITS.rst @@ -0,0 +1,4 @@ +The development of this module has been financially supported by: + +* Open Source Integrators +* Serpent Consulting Services Pvt. Ltd. diff --git a/partner_aging/readme/DESCRIPTION.rst b/partner_aging/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..59ff97bfed4a --- /dev/null +++ b/partner_aging/readme/DESCRIPTION.rst @@ -0,0 +1,9 @@ +This module creates a new customer / supplier aging report as of a given date. + +The default Aged Partner balance report is related to a specific date and a +static PDF that is based on the difference between credits and debits, not +based on documents such as Invoices/Bills and Payments. + +This module provides an interactive view with details of the invoice. + +This module does not consider unapplied credits. diff --git a/partner_aging/readme/USAGE.rst b/partner_aging/readme/USAGE.rst new file mode 100644 index 000000000000..5aa58565af50 --- /dev/null +++ b/partner_aging/readme/USAGE.rst @@ -0,0 +1,5 @@ +To use this module, you need to: + +#. Go to Accounting +#. Click on Sales > Customer Aging or Purchases > Supplier Aging +#. Change the date if necessary diff --git a/partner_aging/security/ir.model.access.csv b/partner_aging/security/ir.model.access.csv new file mode 100644 index 000000000000..c41cca3b8dd2 --- /dev/null +++ b/partner_aging/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,group_id/id,name,model_id/id,perm_create,perm_read,perm_write,perm_unlink +res_partner_aging_customer,account.group_account_invoice,AR can READ,partner_aging.model_res_partner_aging_customer,0,1,0,0 +res_partner_aging_supplier,account.group_account_invoice,AP can READ,partner_aging.model_res_partner_aging_supplier,0,1,0,0 +res_partner_aging_date,,Partner Aging Date,partner_aging.model_res_partner_aging_date,1,1,1,1 diff --git a/partner_aging/static/description/icon.png b/partner_aging/static/description/icon.png new file mode 100644 index 000000000000..7849454dcb9a Binary files /dev/null and b/partner_aging/static/description/icon.png differ diff --git a/partner_aging/static/description/index.html b/partner_aging/static/description/index.html new file mode 100644 index 000000000000..8c4c76cf23f4 --- /dev/null +++ b/partner_aging/static/description/index.html @@ -0,0 +1,452 @@ + + + + + + +Interactive Partner Aging at any date + + + +
+

Interactive Partner Aging at any date

+ + +

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

+

This module creates a new customer / supplier aging report as of a given date.

+

The default Aged Partner balance report is related to a specific date and a +static PDF that is based on the difference between credits and debits, not +based on documents such as Invoices/Bills and Payments.

+

This module provides an interactive view with details of the invoice.

+

This module does not consider unapplied credits.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Accounting
  2. +
  3. Click on Sales > Customer Aging or Purchases > Supplier Aging
  4. +
  5. Change the date if necessary
  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

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

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 maintainer:

+

smangukiya

+

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/partner_aging/tests/__init__.py b/partner_aging/tests/__init__.py new file mode 100644 index 000000000000..f1dd981e0406 --- /dev/null +++ b/partner_aging/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2012 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_partner_aging diff --git a/partner_aging/tests/test_partner_aging.py b/partner_aging/tests/test_partner_aging.py new file mode 100644 index 000000000000..d66f61139753 --- /dev/null +++ b/partner_aging/tests/test_partner_aging.py @@ -0,0 +1,159 @@ +# Copyright 2012 Open Source Integrators +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from datetime import datetime, timedelta + +from odoo import fields +from odoo.tests import common +from odoo.tools import DEFAULT_SERVER_DATE_FORMAT + + +class TestPartnerAging(common.TransactionCase): + def setUp(self): + super(TestPartnerAging, self).setUp() + self.partner_aging_date_model = self.env["res.partner.aging.date"] + self.partner_aging_supplier_model = self.env["res.partner.aging.supplier"] + self.partner_aging_customer_model = self.env["res.partner.aging.customer"] + self.current_date = fields.Date.today() + self.account_invoice_obj = self.env["account.move"] + self.account_move_line_obj = self.env["account.move.line"] + self.account_account_obj = self.env["account.account"] + self.account_journal_obj = self.env["account.journal"] + + self.account_receivable = self.env.ref("account.data_account_type_receivable") + self.partner_12 = self.env.ref("base.res_partner_12") + self.partner_2 = self.env.ref("base.res_partner_2") + self.partner_10 = self.env.ref("base.res_partner_10") + self.partner_3 = self.env.ref("base.res_partner_3") + self.partner_18 = self.env.ref("base.res_partner_18") + + self.journal_sale = self.account_journal_obj.create( + {"name": "sale_0", "code": "SALE0", "type": "sale"} + ) + self.journal_purchase = self.account_journal_obj.create( + {"name": "purchase_0", "code": "PRCHASE0", "type": "purchase"} + ) + + self.account_id = self.account_account_obj.create( + { + "code": "RA1000", + "name": "Test Receivable Account", + "user_type_id": self.account_receivable.id, + "reconcile": True, + } + ) + + invoice_data_list = [ + # Customer Invoice Data + [ + "out_invoice", + self.get_date(30), + self.partner_12.id, + self.journal_sale.id, + ], + ["out_invoice", self.get_date(60), self.partner_2.id, self.journal_sale.id], + [ + "out_invoice", + self.get_date(90), + self.partner_18.id, + self.journal_sale.id, + ], + [ + "out_invoice", + self.get_date(119), + self.partner_3.id, + self.journal_sale.id, + ], + [ + "out_invoice", + self.get_date(124), + self.partner_10.id, + self.journal_sale.id, + ], + # Supplier Invoice Data + [ + "in_invoice", + self.get_date(30), + self.partner_12.id, + self.journal_purchase.id, + ], + [ + "in_invoice", + self.get_date(60), + self.partner_2.id, + self.journal_purchase.id, + ], + [ + "in_invoice", + self.get_date(90), + self.partner_18.id, + self.journal_purchase.id, + ], + [ + "in_invoice", + self.get_date(119), + self.partner_3.id, + self.journal_purchase.id, + ], + [ + "in_invoice", + self.get_date(124), + self.partner_10.id, + self.journal_purchase.id, + ], + ] + for invoice in invoice_data_list: + self._create_invoice_with_reference(invoice) + + def _create_invoice_with_reference(self, invoice_data): + invoice = self.account_invoice_obj.with_context( + default_journal_id=invoice_data[3], test_no_refuse_ref=True + ).create( + { + "ref": "reference", + "move_type": invoice_data[0], + "invoice_date": invoice_data[1], + "invoice_date_due": invoice_data[1], + "partner_id": invoice_data[2], + } + ) + self.account_move_line_obj.create( + { + "product_id": self.env.ref("product.product_product_4").id, + "quantity": 1.0, + "price_unit": 0, + "move_id": invoice.id, + "name": "product that cost 100", + "account_id": self.account_id.id, + } + ) + invoice.action_post() + return invoice + + def get_date(self, set_days): + return (datetime.now() - timedelta(days=-set_days)).strftime( + DEFAULT_SERVER_DATE_FORMAT + ) + + def test_partner_aging_customer(self): + partner_aging_date = self.partner_aging_date_model.create( + {"age_date": self.current_date} + ) + res = partner_aging_date.open_customer_aging() + self.assertEqual(res["context"]["age_date"], self.current_date) + partner_aging_customer_rec = self.partner_aging_customer_model.search( + [("invoice_id", "!=", False)], limit=1 + ) + partner_aging_customer_rec.open_document() + + def test_partner_aging_supplier(self): + partner_aging_date = self.partner_aging_date_model.create( + {"age_date": self.current_date} + ) + res = partner_aging_date.open_supplier_aging() + self.assertEqual(res["context"]["age_date"], self.current_date) + partner_aging_supplier_rec = self.partner_aging_supplier_model.search( + [("invoice_id", "!=", False)], limit=1 + ) + partner_aging_supplier_rec.open_document() diff --git a/partner_aging/wizard/__init__.py b/partner_aging/wizard/__init__.py new file mode 100644 index 000000000000..4a316350cc79 --- /dev/null +++ b/partner_aging/wizard/__init__.py @@ -0,0 +1,7 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ( + res_partner_aging_customer, + res_partner_aging_date, + res_partner_aging_supplier, +) diff --git a/partner_aging/wizard/res_partner_aging_customer.py b/partner_aging/wizard/res_partner_aging_customer.py new file mode 100644 index 000000000000..97a29d88f85c --- /dev/null +++ b/partner_aging/wizard/res_partner_aging_customer.py @@ -0,0 +1,382 @@ +# Copyright 2022 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models, tools + + +class ResPartnerAgingCustomer(models.Model): + _name = "res.partner.aging.customer" + _description = "Res Partner Aging Customer" + _auto = False + _order = "partner_id" + + partner_id = fields.Many2one("res.partner", "Partner", readonly=True) + avg_days_overdue = fields.Integer(readonly=True) + date = fields.Date(readonly=True) + date_due = fields.Date("Due Date", readonly=True) + inv_date_due = fields.Date("Invoice Date", readonly=True) + total = fields.Float(readonly=True) + not_due = fields.Float("Not Due Yet", readonly=True) + days_due_01to30 = fields.Float("1/30", readonly=True) + days_due_31to60 = fields.Float("31/60", readonly=True) + days_due_61to90 = fields.Float("61/90", readonly=True) + days_due_91to120 = fields.Float("91/120", readonly=True) + days_due_121togr = fields.Float("+121", readonly=True) + max_days_overdue = fields.Integer("Days Outstanding", readonly=True) + invoice_ref = fields.Char("Our Invoice", size=25, readonly=True) + invoice_id = fields.Many2one("account.move", "Invoice", readonly=True) + salesman = fields.Many2one("res.users", "Sales Rep", readonly=True) + + def execute_aging_query(self, age_date=False): + if not age_date: + age_date = fields.Date.context_today(self) + + query = """ + SELECT aml.id, aml.partner_id as partner_id, + ai.invoice_user_id as salesman, aml.date as date, aml.date as + date_due, ai.name as invoice_ref, + days_due AS avg_days_overdue, + CASE WHEN (days_due BETWEEN 1 and 30) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_01to30, + + CASE WHEN (days_due BETWEEN 31 and 60) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_31to60, + + CASE WHEN (days_due BETWEEN 61 and 90) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_61to90, + + CASE WHEN (days_due BETWEEN 91 and 120) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and + apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_91to120, + + CASE WHEN (days_due >= 121) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_121togr, + + CASE when days_due < 0 THEN 0 ELSE days_due END as + "max_days_overdue", + CASE WHEN (days_due < 1) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS not_due, + + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END AS total, + ai.id as invoice_id, + ai.invoice_date_due as inv_date_due + FROM account_move_line aml + LEFT JOIN account_account ac on ac.id = aml.account_id + INNER JOIN + (SELECT lt.id, + CASE WHEN inv.invoice_date_due is null then 0 + WHEN inv.id is not null THEN '{}' - inv.invoice_date_due + ELSE current_date - lt.date END AS days_due + FROM account_move_line lt LEFT JOIN account_move inv + on lt.move_id = inv.id) DaysDue + ON DaysDue.id = aml.id + LEFT JOIN account_move as ai ON ai.id = aml.move_id + WHERE ac.user_type_id in + (select id from account_account_type where + type = 'receivable') and aml.date + <= '{}' AND ai.state = 'posted' AND + (ai.payment_state != 'paid' OR + aml.full_reconcile_id IS NULL) AND + ai.move_type IN ('out_invoice', 'out_refund') + and ai.partner_id IS NOT NULL + GROUP BY aml.partner_id, + aml.id, ai.name, days_due, ai.invoice_user_id, ai.id UNION + SELECT aml.id, aml.partner_id as partner_id, + ai.invoice_user_id as + salesman, aml.date as date, aml.date as date_due, + ai.name as invoice_ref,days_due AS avg_days_overdue, + + CASE WHEN (days_due BETWEEN 1 and 30) THEN + + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_01to30, + + CASE WHEN (days_due BETWEEN 31 and 60) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) + and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_31to60, + + CASE WHEN (days_due BETWEEN 61 and 90) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_61to90, + + CASE WHEN (days_due BETWEEN 91 and 120) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or apr.debit_move_id=aml.id) + and apr.create_date <= '{}')) WHEN (aml.full_reconcile_id + is NULL and aml.amount_residual>0) THEN + aml.debit-(select coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or apr.debit_move_id=aml.id) + and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_91to120, + + CASE WHEN (days_due >= 121) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from + account_partial_reconcile apr where + (apr.credit_move_id =aml.id or apr.debit_move_id=aml.id) + and apr.create_date <= '{}')) WHEN (aml.full_reconcile_id + is NULL and aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS days_due_121togr, + + CASE when days_due < 0 THEN + 0 ELSE days_due END as "max_days_overdue", + + CASE WHEN (days_due < 1) THEN + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END ELSE 0 END AS not_due, + + CASE WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual<0) THEN -(aml.credit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}')) + WHEN (aml.full_reconcile_id is NULL and + aml.amount_residual>0) THEN aml.debit-(select + coalesce(sum(apr.amount),0) from account_partial_reconcile + apr where (apr.credit_move_id =aml.id or + apr.debit_move_id=aml.id) and apr.create_date <= '{}') + WHEN (aml.full_reconcile_id is NOT NULL) THEN + aml.amount_residual END AS total, + ai.id as invoice_id, + ai.invoice_date_due as inv_date_due + FROM account_move_line aml + LEFT JOIN account_account ac on ac.id = aml.account_id + INNER JOIN + ( + SELECT lt.id, + CASE WHEN inv.invoice_date_due is null then 0 + WHEN inv.id is not null THEN '{}' - inv.invoice_date_due + ELSE current_date - lt.date END AS days_due + FROM account_move_line lt LEFT JOIN account_move + inv on lt.move_id = inv.id + ) DaysDue + ON DaysDue.id = aml.id + LEFT JOIN account_move as ai ON ai.id = aml.move_id + WHERE ac.user_type_id in (select id from account_account_type + where type = 'receivable') + AND aml.date <= '{}' + AND aml.partner_id IS NULL + AND ai.partner_id IS not NULL + AND aml.full_reconcile_id is NULL + GROUP BY aml.partner_id, aml.id, ai.name, days_due, + ai.invoice_user_id, ai.id UNION + select aml.id, + aml.partner_id as partner_id, + aml.create_uid as salesman, + aml.date as date, + aml.date as date_due, + ' ' as invoice_ref, + 0 as avg_days_overdue, + 0 as days_due_01to30, + 0 as days_due_31to60, + 0 as days_due_61to90, + 0 as days_due_91to120, + 0 as days_due_121togr, + 0 as max_days_overdue, + 0 as not_due, + CASE WHEN (aml.credit - (select sum(debit) + from account_move_line l where + l.full_reconcile_id = aml.full_reconcile_id and + l.date<='{}')) > 0 then -(aml.credit - (select + sum(debit) from account_move_line l where + l.full_reconcile_id = aml.full_reconcile_id and + l.date<='{}')) ELSE 0 END AS total, + null as invoice_id, aml.date as inv_date_due + from account_move_line aml + LEFT JOIN account_account ac on ac.id = aml.account_id + where aml.date <= '{}' + and aml.partner_id IS NOT NULL + and aml.full_reconcile_id IS NOT NULL + and ac.user_type_id in (select id from + account_account_type where type = 'receivable') + and aml.credit > 0 + """.format( + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + age_date, + ) + + tools.drop_view_if_exists(self.env.cr, self._table) + # pylint: disable=sql-injection + q = """CREATE OR REPLACE VIEW {} AS ({})""".format(self._table, (query)) + self.env.cr.execute(q) + + def open_document(self): + """ + @description Open form view of Customer Invoice + """ + xmlid = "account.action_move_out_invoice_type" + action = self.env["ir.actions.act_window"]._for_xml_id(xmlid) + action["views"] = [(self.env.ref("account.view_move_form").id, "form")] + action["res_id"] = self.invoice_id.id + return action + + def init(self): + self.execute_aging_query() + return super(ResPartnerAgingCustomer, self).init() diff --git a/partner_aging/wizard/res_partner_aging_customer.xml b/partner_aging/wizard/res_partner_aging_customer.xml new file mode 100644 index 000000000000..73154886e180 --- /dev/null +++ b/partner_aging/wizard/res_partner_aging_customer.xml @@ -0,0 +1,114 @@ + + + + + customer.aging.ad.search + res.partner.aging.customer + search + + + + + + + + + + + + + + + + customer.aging.ad.tree + res.partner.aging.customer + tree + + + + + + + + +