diff --git a/purchase_order_update_planned_date/README.rst b/purchase_order_update_planned_date/README.rst new file mode 100644 index 0000000..47a029c --- /dev/null +++ b/purchase_order_update_planned_date/README.rst @@ -0,0 +1,60 @@ +================================== +Purchase Order Update Planned Date +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c08b1679df210c804a72b3fd4abaed7693b3bb792ac278091013e0cfd415de3d + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-solvosci%2Fslv--purchase-lightgray.png?logo=github + :target: https://github.com/solvosci/slv-purchase/tree/15.0/purchase_order_update_planned_date + :alt: solvosci/slv-purchase + +|badge1| |badge2| |badge3| + +Modify the default behavior of "date_planned" of a purchase order when it is confirmed + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Solvos + +Contributors +~~~~~~~~~~~~ + +* Iria Alonso + +Maintainers +~~~~~~~~~~~ + +This module is part of the `solvosci/slv-purchase `_ project on GitHub. + +You are welcome to contribute. diff --git a/purchase_order_update_planned_date/__init__.py b/purchase_order_update_planned_date/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_order_update_planned_date/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_order_update_planned_date/__manifest__.py b/purchase_order_update_planned_date/__manifest__.py new file mode 100644 index 0000000..f737d70 --- /dev/null +++ b/purchase_order_update_planned_date/__manifest__.py @@ -0,0 +1,15 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See https://www.gnu.org/licenses/lgpl-3.0.html +{ + 'name': 'Purchase Order Update Planned Date', + "summary": """ + Modify the default behavior of "date_planned" of a purchase order when it is confirmed + """, + "author": "Solvos", + "license": "LGPL-3", + "version": "15.0.1.0.0", + "category": "Manufacturing", + "website": "https://github.com/solvosci/slv-purchase", + "depends": ["purchase"], + "installable": True, +} diff --git a/purchase_order_update_planned_date/models/__init__.py b/purchase_order_update_planned_date/models/__init__.py new file mode 100644 index 0000000..9f03530 --- /dev/null +++ b/purchase_order_update_planned_date/models/__init__.py @@ -0,0 +1 @@ +from . import purchase_order diff --git a/purchase_order_update_planned_date/models/purchase_order.py b/purchase_order_update_planned_date/models/purchase_order.py new file mode 100644 index 0000000..4886db6 --- /dev/null +++ b/purchase_order_update_planned_date/models/purchase_order.py @@ -0,0 +1,15 @@ +# © 2024 Solvos Consultoría Informática () +# License LGPL-3 - See https://www.gnu.org/licenses/lgpl-3.0.html +from odoo import models +from datetime import timedelta + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + def button_confirm(self): + super().button_confirm() + for order in self: + if order.date_order and order.date_planned: + dif = (order.date_approve - order.date_order).days + new_date_planned = order.date_planned + timedelta(days=dif) + order.write({'date_planned': new_date_planned}) diff --git a/purchase_order_update_planned_date/readme/CONTRIBUTORS.rst b/purchase_order_update_planned_date/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..8b5203a --- /dev/null +++ b/purchase_order_update_planned_date/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Iria Alonso diff --git a/purchase_order_update_planned_date/readme/DESCRIPTION.rst b/purchase_order_update_planned_date/readme/DESCRIPTION.rst new file mode 100644 index 0000000..1952d6a --- /dev/null +++ b/purchase_order_update_planned_date/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Modify the default behavior of "date_planned" of a purchase order when it is confirmed diff --git a/purchase_order_update_planned_date/static/description/icon.png b/purchase_order_update_planned_date/static/description/icon.png new file mode 100644 index 0000000..daa2a02 Binary files /dev/null and b/purchase_order_update_planned_date/static/description/icon.png differ diff --git a/purchase_order_update_planned_date/static/description/index.html b/purchase_order_update_planned_date/static/description/index.html new file mode 100644 index 0000000..97f729a --- /dev/null +++ b/purchase_order_update_planned_date/static/description/index.html @@ -0,0 +1,416 @@ + + + + + + +Purchase Order Update Planned Date + + + +
+

Purchase Order Update Planned Date

+ + +

Beta License: LGPL-3 solvosci/slv-purchase

+

Modify the default behavior of “date_planned” of a purchase order when it is confirmed

+

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

+
    +
  • Solvos
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the solvosci/slv-purchase project on GitHub.

+

You are welcome to contribute.

+
+
+
+ +