Skip to content

Commit 4e14b6b

Browse files
committed
[ADD] purchase_date_planned_manual_product_packaging_container_deposit: When date_planned is set manually, prevent calculation of the field upon PO confirmation
1 parent 1e7cd27 commit 4e14b6b

13 files changed

Lines changed: 642 additions & 0 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
==============================================
2+
Purchase Date Planned Manual Container Deposit
3+
==============================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:096a81afacd9b853ef576065aea83f9d832947fdf5d82dc030006591e710d643
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_date_planned_manual_product_packaging_container_deposit
21+
:alt: OCA/purchase-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/purchase-workflow-16-0/purchase-workflow-16-0-purchase_date_planned_manual_product_packaging_container_deposit
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module makes the system to always respect the planned (or scheduled)
32+
date set by the user in PO when choose product with packaging container deposit.
33+
34+
35+
**Table of contents**
36+
37+
.. contents::
38+
:local:
39+
40+
Usage
41+
=====
42+
43+
To use this module you could follow below:
44+
45+
#. Go to 'Purchase' and create a purchase order.
46+
#. Select any vendor
47+
#. Add new PO Line with product with container deposit associated
48+
#. Enter Expected Arrival (date_planned) in future
49+
#. Confirm PO
50+
#. This date will never be modified by the system.
51+
52+
53+
Bug Tracker
54+
===========
55+
56+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/issues>`_.
57+
In case of trouble, please check there if your issue has already been reported.
58+
If you spotted it first, help us to smash it by providing a detailed and welcomed
59+
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_date_planned_manual_product_packaging_container_deposit%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
60+
61+
Do not contact contributors directly about support or help with technical issues.
62+
63+
Credits
64+
=======
65+
66+
Authors
67+
~~~~~~~
68+
69+
* Camptocamp
70+
71+
Contributors
72+
~~~~~~~~~~~~
73+
74+
* Chau Le <chaulb@trobz.com>
75+
76+
77+
Maintainers
78+
~~~~~~~~~~~
79+
80+
This module is maintained by the OCA.
81+
82+
.. image:: https://odoo-community.org/logo.png
83+
:alt: Odoo Community Association
84+
:target: https://odoo-community.org
85+
86+
OCA, or the Odoo Community Association, is a nonprofit organization whose
87+
mission is to support the collaborative development of Odoo features and
88+
promote its widespread use.
89+
90+
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/16.0/purchase_date_planned_manual_product_packaging_container_deposit>`_ project on GitHub.
91+
92+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Camptocamp (http://www.camptocamp.com).
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Purchase Date Planned Manual Container Deposit",
5+
"summary": "This module prevents container deposits from recalculating the planned",
6+
"version": "16.0.1.0.0",
7+
"author": "Camptocamp, " "Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/purchase-workflow",
9+
"category": "Purchase Management",
10+
"depends": ["purchase_date_planned_manual", "product_packaging_container_deposit"],
11+
"license": "AGPL-3",
12+
"installable": True,
13+
"application": False,
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import purchase_order
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2024 Camptocamp (http://www.camptocamp.com).
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
from odoo import models
5+
6+
7+
class PurchaseOrderLine(models.Model):
8+
_inherit = "purchase.order.line"
9+
10+
def _get_date_planned(self, seller, po=False):
11+
if self.is_container_deposit:
12+
return self.order_id.date_planned
13+
14+
return super()._get_date_planned(seller, po)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Chau Le <chaulb@trobz.com>
2+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This module makes the system to always respect the planned (or scheduled)
2+
date set by the user in PO when choose product with packaging container deposit.
3+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
To use this module you could follow below:
2+
3+
#. Go to 'Purchase' and create a purchase order.
4+
#. Select any vendor
5+
#. Add new PO Line with product with container deposit associated
6+
#. Enter Expected Arrival (date_planned) in future
7+
#. Confirm PO
8+
#. This date will never be modified by the system.
9+

0 commit comments

Comments
 (0)