Skip to content

Commit

Permalink
[ADD] purchase_order_update_planned_date
Browse files Browse the repository at this point in the history
  • Loading branch information
IriaAlonso committed Nov 29, 2024
1 parent 23ca774 commit 5455977
Show file tree
Hide file tree
Showing 9 changed files with 510 additions and 0 deletions.
60 changes: 60 additions & 0 deletions purchase_order_update_planned_date/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/solvosci/slv-purchase/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 <https://github.com/solvosci/slv-purchase/issues/new?body=module:%20purchase_order_update_planned_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Solvos

Contributors
~~~~~~~~~~~~

* Iria Alonso <[email protected]>

Maintainers
~~~~~~~~~~~

This module is part of the `solvosci/slv-purchase <https://github.com/solvosci/slv-purchase/tree/15.0/purchase_order_update_planned_date>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions purchase_order_update_planned_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions purchase_order_update_planned_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>)
# 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,
}
1 change: 1 addition & 0 deletions purchase_order_update_planned_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order
15 changes: 15 additions & 0 deletions purchase_order_update_planned_date/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>)
# 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})
1 change: 1 addition & 0 deletions purchase_order_update_planned_date/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Iria Alonso <[email protected]>
1 change: 1 addition & 0 deletions purchase_order_update_planned_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modify the default behavior of "date_planned" of a purchase order when it is confirmed
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5455977

Please sign in to comment.