diff --git a/purchase_report_date_planned/__init__.py b/purchase_report_date_planned/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_report_date_planned/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_report_date_planned/__manifest__.py b/purchase_report_date_planned/__manifest__.py new file mode 100644 index 0000000..cc41e84 --- /dev/null +++ b/purchase_report_date_planned/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2024 Akretion (https://www.akretion.com). +# @author Mathieu Delva +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Purchase Report Date Planned", + "version": "14.0.1.1.0", + "author": "Akretion ,Odoo Community Association (OCA)", + "maintainers": ["mathieudelva"], + "website": "https://github.com/OCA/purchase-workflow", + "category": "Purchase", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "purchase_usability", + ], + "data": [ + "views/purchase_report.xml", + ], +} diff --git a/purchase_report_date_planned/models/__init__.py b/purchase_report_date_planned/models/__init__.py new file mode 100644 index 0000000..84b6eef --- /dev/null +++ b/purchase_report_date_planned/models/__init__.py @@ -0,0 +1 @@ +from . import purchase_report diff --git a/purchase_report_date_planned/models/purchase_report.py b/purchase_report_date_planned/models/purchase_report.py new file mode 100644 index 0000000..128a047 --- /dev/null +++ b/purchase_report_date_planned/models/purchase_report.py @@ -0,0 +1,22 @@ +from odoo import fields, models + + +class PurchaseReport(models.Model): + _inherit = "purchase.report" + + date_planned = fields.Datetime(compute="_compute_date_planned", store=True) + + def _compute_date_planned(self): + for record in self: + order_line = record.order_id.order_line.filtered( + lambda r: r.product_id == record.product_id + ) + record.date_planned = order_line.date_planned + + def _select(self): + select_str = super(PurchaseReport, self)._select() + return select_str + ", l.date_planned as date_planned" + + def _group_by(self): + group_by_str = super(PurchaseReport, self)._group_by() + return group_by_str + ", l.date_planned" diff --git a/purchase_report_date_planned/readme/CONTRIBUTORS.rst b/purchase_report_date_planned/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..bec244e --- /dev/null +++ b/purchase_report_date_planned/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Mathieu Delva diff --git a/purchase_report_date_planned/readme/DESCRIPTION.rst b/purchase_report_date_planned/readme/DESCRIPTION.rst new file mode 100644 index 0000000..8ac7782 --- /dev/null +++ b/purchase_report_date_planned/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module add the field date_planned on purchase report model, purchase report tree view and add a filter that allows you to display orders that are late for delivery diff --git a/purchase_report_date_planned/static/description/index.html b/purchase_report_date_planned/static/description/index.html new file mode 100644 index 0000000..9678115 --- /dev/null +++ b/purchase_report_date_planned/static/description/index.html @@ -0,0 +1,425 @@ + + + + + +Purchase Report Date Planned + + + +
+

Purchase Report Date Planned

+ + +

Beta License: AGPL-3 OCA/purchase-workflow Translate me on Weblate Try me on Runboat

+

This module add the field date_planned on purchase report model, purchase report tree view and add a filter that allows you to display orders that are late for delivery

+

Table of contents

+ +
+

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

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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

+

Current maintainer:

+

mathieudelva

+

This module is part of the OCA/purchase-workflow project on GitHub.

+

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

+
+
+
+ + diff --git a/purchase_report_date_planned/views/purchase_report.xml b/purchase_report_date_planned/views/purchase_report.xml new file mode 100644 index 0000000..f255e01 --- /dev/null +++ b/purchase_report_date_planned/views/purchase_report.xml @@ -0,0 +1,30 @@ + + + + + purchase.report + + + + + + + + + + purchase.report.search + purchase.report + + + + + + + + + +