diff --git a/README.md b/README.md index f6e638b37..49832014a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ addon | version | maintainers | summary [sale_order_report_product_image](sale_order_report_product_image/) | 16.0.1.0.0 | | Show product images on Sale documents [sale_packaging_report](sale_packaging_report/) | 16.0.1.1.0 | [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) | Packaging data in sale reports [sale_report_commitment_date](sale_report_commitment_date/) | 16.0.1.0.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Display the commitment date on Sales Order analysis reports +[sale_report_country_state](sale_report_country_state/) | 16.0.1.0.0 | | Sale Report Filter by State [sale_report_delivered](sale_report_delivered/) | 16.0.1.0.2 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Sale Report Delivered [sale_report_delivered_subtotal](sale_report_delivered_subtotal/) | 16.0.1.0.1 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Sale Report Delivered subtotal [sale_report_delivered_volume](sale_report_delivered_volume/) | 16.0.1.0.0 | | Sale Report Delivered Volume diff --git a/sale_report_country_state/README.rst b/sale_report_country_state/README.rst new file mode 100644 index 000000000..a1c51a732 --- /dev/null +++ b/sale_report_country_state/README.rst @@ -0,0 +1,92 @@ +=========================== +Sale Report Filter by State +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d101143695d9ce5dc9d1cd209770f0eac630e7c9e47f758e05cb63ddb6b2aa41 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsale--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/sale-reporting/tree/16.0/sale_report_country_state + :alt: OCA/sale-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-reporting-16-0/sale-reporting-16-0-sale_report_country_state + :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/sale-reporting&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to filter by partner's state in the sale reports. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To filter by state you can either: + +#. Go to *Sales > Reporting > Sales* +#. Group by *Customer State* or filter for such criteria. + +#. Go to *Sales > Products > Products* and select a product. +#. Press the sales analysis smart button at the top. +#. Filter or group by the *Customer State* + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * David Vidal + * João Marques + * Carlos López + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/sale-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_report_country_state/__init__.py b/sale_report_country_state/__init__.py new file mode 100644 index 000000000..65323532b --- /dev/null +++ b/sale_report_country_state/__init__.py @@ -0,0 +1 @@ +from . import reports diff --git a/sale_report_country_state/__manifest__.py b/sale_report_country_state/__manifest__.py new file mode 100644 index 000000000..9c5eb823d --- /dev/null +++ b/sale_report_country_state/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2020 Tecnativa - David Vidal +# Copyright 2024 Tecnativa - Carlos López +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Sale Report Filter by State", + "version": "16.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/sale-reporting", + "category": "Sales", + "license": "AGPL-3", + "depends": ["sale"], + "data": ["reports/sale_report_views.xml"], + "installable": True, +} diff --git a/sale_report_country_state/i18n/es.po b/sale_report_country_state/i18n/es.po new file mode 100644 index 000000000..bf4a0bbd9 --- /dev/null +++ b/sale_report_country_state/i18n/es.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_report_country_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-07 16:53+0000\n" +"PO-Revision-Date: 2024-10-07 16:53+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sale_report_country_state +#: model:ir.model.fields,field_description:sale_report_country_state.field_sale_report__state_id +#: model_terms:ir.ui.view,arch_db:sale_report_country_state.view_order_product_search +msgid "Customer State" +msgstr "Provincia del cliente" + +#. module: sale_report_country_state +#: model:ir.model,name:sale_report_country_state.model_sale_report +msgid "Sales Analysis Report" +msgstr "Informe de análisis de ventas" diff --git a/sale_report_country_state/i18n/sale_report_country_state.pot b/sale_report_country_state/i18n/sale_report_country_state.pot new file mode 100644 index 000000000..ea586b904 --- /dev/null +++ b/sale_report_country_state/i18n/sale_report_country_state.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_report_country_state +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: sale_report_country_state +#: model:ir.model.fields,field_description:sale_report_country_state.field_sale_report__state_id +#: model_terms:ir.ui.view,arch_db:sale_report_country_state.view_order_product_search +msgid "Customer State" +msgstr "" + +#. module: sale_report_country_state +#: model:ir.model,name:sale_report_country_state.model_sale_report +msgid "Sales Analysis Report" +msgstr "" diff --git a/sale_report_country_state/readme/CONTRIBUTORS.rst b/sale_report_country_state/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..22bfaebad --- /dev/null +++ b/sale_report_country_state/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* `Tecnativa `_: + + * David Vidal + * João Marques + * Carlos López diff --git a/sale_report_country_state/readme/DESCRIPTION.rst b/sale_report_country_state/readme/DESCRIPTION.rst new file mode 100644 index 000000000..3fba40398 --- /dev/null +++ b/sale_report_country_state/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to filter by partner's state in the sale reports. diff --git a/sale_report_country_state/readme/USAGE.rst b/sale_report_country_state/readme/USAGE.rst new file mode 100644 index 000000000..0c6592f11 --- /dev/null +++ b/sale_report_country_state/readme/USAGE.rst @@ -0,0 +1,8 @@ +To filter by state you can either: + +#. Go to *Sales > Reporting > Sales* +#. Group by *Customer State* or filter for such criteria. + +#. Go to *Sales > Products > Products* and select a product. +#. Press the sales analysis smart button at the top. +#. Filter or group by the *Customer State* diff --git a/sale_report_country_state/reports/__init__.py b/sale_report_country_state/reports/__init__.py new file mode 100644 index 000000000..cd23411b8 --- /dev/null +++ b/sale_report_country_state/reports/__init__.py @@ -0,0 +1 @@ +from . import sale_report diff --git a/sale_report_country_state/reports/sale_report.py b/sale_report_country_state/reports/sale_report.py new file mode 100644 index 000000000..10fe90c43 --- /dev/null +++ b/sale_report_country_state/reports/sale_report.py @@ -0,0 +1,24 @@ +# Copyright 2020 Tecnativa - David Vidal +# Copyright 2024 Tecnativa - Carlos López +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class SaleReport(models.Model): + _inherit = "sale.report" + + state_id = fields.Many2one( + comodel_name="res.country.state", + string="Customer State", + readonly=True, + ) + + def _select_additional_fields(self): + res = super()._select_additional_fields() + res["state_id"] = "partner.state_id" + return res + + def _group_by_sale(self): + res = super()._group_by_sale() + res += ", partner.state_id" + return res diff --git a/sale_report_country_state/reports/sale_report_views.xml b/sale_report_country_state/reports/sale_report_views.xml new file mode 100644 index 000000000..ebc9443ad --- /dev/null +++ b/sale_report_country_state/reports/sale_report_views.xml @@ -0,0 +1,18 @@ + + + + + sale.report + + + + + + + + + diff --git a/sale_report_country_state/static/description/icon.png b/sale_report_country_state/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/sale_report_country_state/static/description/icon.png differ diff --git a/sale_report_country_state/static/description/index.html b/sale_report_country_state/static/description/index.html new file mode 100644 index 000000000..e82e53fd8 --- /dev/null +++ b/sale_report_country_state/static/description/index.html @@ -0,0 +1,440 @@ + + + + + +Sale Report Filter by State + + + +
+

Sale Report Filter by State

+ + +

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

+

This module allows to filter by partner’s state in the sale reports.

+

Table of contents

+ +
+

Usage

+

To filter by state you can either:

+
    +
  1. Go to Sales > Reporting > Sales
  2. +
  3. Group by Customer State or filter for such criteria.
  4. +
  5. Go to Sales > Products > Products and select a product.
  6. +
  7. Press the sales analysis smart button at the top.
  8. +
  9. Filter or group by the Customer State
  10. +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • David Vidal
    • +
    • João Marques
    • +
    • Carlos López
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

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

+

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

+
+
+
+ + diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 5dae69862..0598da5bc 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20240522.0 \ No newline at end of file +16.0.20241008.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 942456414..ffc1cc606 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -16,6 +16,7 @@ 'odoo-addon-sale_order_report_product_image>=16.0dev,<16.1dev', 'odoo-addon-sale_packaging_report>=16.0dev,<16.1dev', 'odoo-addon-sale_report_commitment_date>=16.0dev,<16.1dev', + 'odoo-addon-sale_report_country_state>=16.0dev,<16.1dev', 'odoo-addon-sale_report_delivered>=16.0dev,<16.1dev', 'odoo-addon-sale_report_delivered_subtotal>=16.0dev,<16.1dev', 'odoo-addon-sale_report_delivered_volume>=16.0dev,<16.1dev', diff --git a/setup/sale_report_country_state/odoo/addons/sale_report_country_state b/setup/sale_report_country_state/odoo/addons/sale_report_country_state new file mode 120000 index 000000000..bf425f544 --- /dev/null +++ b/setup/sale_report_country_state/odoo/addons/sale_report_country_state @@ -0,0 +1 @@ +../../../../sale_report_country_state \ No newline at end of file diff --git a/setup/sale_report_country_state/setup.py b/setup/sale_report_country_state/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/sale_report_country_state/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)