Skip to content

Commit

Permalink
Merge pull request #1646 from OCA/18.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/purchase-workflow (18.0)
  • Loading branch information
bt-admin authored Jan 11, 2025
2 parents 790869c + c124dc7 commit 1797f75
Show file tree
Hide file tree
Showing 28 changed files with 1,209 additions and 59 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ addon | version | maintainers | summary
[purchase_order_archive](purchase_order_archive/) | 18.0.1.0.0 | | Archive Purchase Orders
[purchase_order_line_menu](purchase_order_line_menu/) | 18.0.1.0.0 | | Adds Purchase Order Lines Menu
[purchase_order_type](purchase_order_type/) | 18.0.1.0.0 | | Purchase Order Type
[purchase_request](purchase_request/) | 18.0.1.0.0 | | Use this module to have notification of requirements of materials and/or external services and keep track of such requirements.
[purchase_request](purchase_request/) | 18.0.1.0.1 | | Use this module to have notification of requirements of materials and/or external services and keep track of such requirements.
[purchase_request_department](purchase_request_department/) | 18.0.1.0.0 | | Purchase Request Department
[vendor_transport_lead_time](vendor_transport_lead_time/) | 18.0.1.0.0 | | Purchase delay based on transport and supplier delays

[//]: # (end addons)

Expand Down
36 changes: 18 additions & 18 deletions purchase_request/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Purchase Request
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a773f51d0c8b186ca91b9dbf7169f0b3e5a044209ff795e57711b9e5e090ca1e
!! source digest: sha256:f91c253fdf425211d134ca7bfa339e0a44c389aaa053418279ecab37c14a56c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -85,9 +85,9 @@ To configure the product follow this steps:
Note that MTO route is archived by default, you should unarchive it
first:

- Go to Inventory > Configuration > Routes, in the Search dropdown
menu, click *Archived* to show *Replenish on Order (MTO)* route and
*Unarchive* it.
- Go to Inventory > Configuration > Routes, in the Search dropdown menu,
click *Archived* to show *Replenish on Order (MTO)* route and
*Unarchive* it.

With this configuration, whenever a procurement order is created and the
supply rule selected is 'Buy' the application will create a Purchase
Expand Down Expand Up @@ -125,31 +125,31 @@ Authors
Contributors
------------

- Jordi Ballester Alomar <[email protected]>
- Jordi Ballester Alomar <[email protected]>

- Jonathan Nemry <[email protected]>
- Jonathan Nemry <[email protected]>

- Aaron Henriquez <[email protected]>
- Aaron Henriquez <[email protected]>

- Adrien Peiffer <[email protected]>
- Adrien Peiffer <[email protected]>

- Lois Rilo <[email protected]>
- Lois Rilo <[email protected]>

- Héctor Villarreal <[email protected]>
- Héctor Villarreal <[email protected]>

- Ben Cai <[email protected]>
- Ben Cai <[email protected]>

- Rattapong Chokmasermkul <[email protected]>
- Rattapong Chokmasermkul <[email protected]>

- Stefan Rijnhart <[email protected]>
- Stefan Rijnhart <[email protected]>

- ``Trobz <https://trobz.com>``\ \_:
- ``Trobz <https://trobz.com>``\ \_:

- Son Ho [email protected]
- Son Ho [email protected]

- `Komit Company Limited <https://komit-consulting.com/>`__:
- `Komit Company Limited <https://komit-consulting.com/>`__:

- Quoc Pham Ngoc <[email protected]>
- Quoc Pham Ngoc <[email protected]>

Other credits
-------------
Expand All @@ -161,7 +161,7 @@ The development of this module has been financially supported by:
Images
~~~~~~

- Enric Tobella (logo)
- Enric Tobella (logo)

.. |Aleph Objects, Inc| image:: https://upload.wikimedia.org/wikipedia/en/3/3b/Aleph_Objects_Logo.png
:target: https://www.alephobjects.com
Expand Down
2 changes: 1 addition & 1 deletion purchase_request/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Purchase Request",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"version": "18.0.1.0.0",
"version": "18.0.1.0.1",
"summary": "Use this module to have notification of requirements of "
"materials and/or external services and keep track of such "
"requirements.",
Expand Down
72 changes: 37 additions & 35 deletions purchase_request/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,41 +108,43 @@ def copy_data(self, default=None):
"""
if default is None:
default = {}
if not default.get("purchase_request_allocation_ids") and (
default.get("product_uom_qty") or self.state in ("done", "cancel")
):
default["purchase_request_allocation_ids"] = []
new_move_qty = default.get("product_uom_qty") or self.product_uom_qty
rounding = self.product_id.uom_id.rounding
for alloc in self.purchase_request_allocation_ids.filtered(
"open_product_qty"
vals_list = super().copy_data(default)
for move, vals in zip(self, vals_list, strict=False):
if not default.get("purchase_request_allocation_ids") and (
default.get("product_uom_qty") or move.state in ("done", "cancel")
):
if (
float_compare(
new_move_qty,
0,
precision_rounding=self.product_id.uom_id.rounding,
)
<= 0
or float_compare(
alloc.open_product_qty, 0, precision_rounding=rounding
)
<= 0
vals["purchase_request_allocation_ids"] = []
new_move_qty = default.get("product_uom_qty") or move.product_uom_qty
rounding = move.product_id.uom_id.rounding
for alloc in move.purchase_request_allocation_ids.filtered(
"open_product_qty"
):
break
open_qty = min(new_move_qty, alloc.open_product_qty)
new_move_qty -= open_qty
default["purchase_request_allocation_ids"].append(
(
0,
0,
{
"purchase_request_line_id": (
alloc.purchase_request_line_id.id
),
"requested_product_uom_qty": open_qty,
},
if (
float_compare(
new_move_qty,
0,
precision_rounding=move.product_id.uom_id.rounding,
)
<= 0
or float_compare(
alloc.open_product_qty, 0, precision_rounding=rounding
)
<= 0
):
break
open_qty = min(new_move_qty, alloc.open_product_qty)
new_move_qty -= open_qty
vals["purchase_request_allocation_ids"].append(
(
0,
0,
{
"purchase_request_line_id": (
alloc.purchase_request_line_id.id
),
"requested_product_uom_qty": open_qty,
},
)
)
)
alloc.requested_product_uom_qty -= open_qty
return super().copy_data(default)
alloc.requested_product_uom_qty -= open_qty
return vals_list
6 changes: 3 additions & 3 deletions purchase_request/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Purchase Request</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a773f51d0c8b186ca91b9dbf7169f0b3e5a044209ff795e57711b9e5e090ca1e
!! source digest: sha256:f91c253fdf425211d134ca7bfa339e0a44c389aaa053418279ecab37c14a56c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/purchase-workflow/tree/18.0/purchase_request"><img alt="OCA/purchase-workflow" src="https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_request"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>You use this module if you wish to give notification of requirements of
Expand Down Expand Up @@ -428,8 +428,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>Note that MTO route is archived by default, you should unarchive it
first:</p>
<ul class="simple">
<li>Go to Inventory &gt; Configuration &gt; Routes, in the Search dropdown
menu, click <em>Archived</em> to show <em>Replenish on Order (MTO)</em> route and
<li>Go to Inventory &gt; Configuration &gt; Routes, in the Search dropdown menu,
click <em>Archived</em> to show <em>Replenish on Order (MTO)</em> route and
<em>Unarchive</em> it.</li>
</ul>
<p>With this configuration, whenever a procurement order is created and the
Expand Down
3 changes: 2 additions & 1 deletion setup/_metapackage/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "odoo-addons-oca-purchase-workflow"
version = "18.0.20250108.0"
version = "18.0.20250110.0"
dependencies = [
"odoo-addon-purchase_cancel_reason==18.0.*",
"odoo-addon-purchase_commercial_partner==18.0.*",
Expand All @@ -10,6 +10,7 @@ dependencies = [
"odoo-addon-purchase_order_type==18.0.*",
"odoo-addon-purchase_request==18.0.*",
"odoo-addon-purchase_request_department==18.0.*",
"odoo-addon-vendor_transport_lead_time==18.0.*",
]
classifiers=[
"Programming Language :: Python",
Expand Down
98 changes: 98 additions & 0 deletions vendor_transport_lead_time/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
==========================
Vendor transport lead time
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a70bb2b5cbd0007c31487c57ab573790e9c59cd1bc333a1979554738a9a31644
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/18.0/vendor_transport_lead_time
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-vendor_transport_lead_time
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/purchase-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module overrides the product.supplierinfo model. It splits the
delay into two new delay fields, Supplier Lead Time and Transport Lead
Time, to sum them into the actual Lead Time. This allow users to get the
information about the transportation lead time in order to plan the
transport properly when relevant.

**Table of contents**

.. contents::
:local:

Changelog
=========

13.0.1.0.0 (2020-06-15)
-----------------------

- Initial version

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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/OCA/purchase-workflow/issues/new?body=module:%20vendor_transport_lead_time%0Aversion:%2018.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
-------

* Camptocamp

Contributors
------------

- Matthieu Méquignon <[email protected]>
- Phuc Tran Thanh <[email protected]>
- Do Anh Duy <[email protected]>

Other credits
-------------

The development and migration of this module has been financially
supported by:

- Camptocamp

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/vendor_transport_lead_time>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions vendor_transport_lead_time/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions vendor_transport_lead_time/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Vendor transport lead time",
"summary": "Purchase delay based on transport and supplier delays",
"version": "18.0.1.0.0",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["product", "purchase"],
"data": [
"views/product_supplierinfo.xml",
"views/purchase_order_line.xml",
"report/purchase_order_template.xml",
],
"installable": True,
}
Loading

0 comments on commit 1797f75

Please sign in to comment.