-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] purchase_order_update_planned_date
- Loading branch information
1 parent
23ca774
commit 5455977
Showing
9 changed files
with
510 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import purchase_order |
15 changes: 15 additions & 0 deletions
15
purchase_order_update_planned_date/models/purchase_order.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Iria Alonso <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.