Skip to content

Commit 6850896

Browse files
committed
Add stock_warehouse_flow_delivery_refresh
1 parent 1852829 commit 6850896

File tree

13 files changed

+614
-0
lines changed

13 files changed

+614
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../stock_warehouse_flow_delivery_refresh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
=====================================
2+
Stock Warehouse Flow Delivery Refresh
3+
=====================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:8de340e2095dadbecd3245322179db3413e3b25e0da75bd649643ab997eb7a60
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%2Fwms-lightgray.png?logo=github
20+
:target: https://github.com/OCA/wms/tree/14.0/stock_warehouse_flow_delivery_refresh
21+
:alt: OCA/wms
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-stock_warehouse_flow_delivery_refresh
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/wms&target_branch=14.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This is a glue module between Stock Warehouse Flow and Stock Available On Premise Release.
32+
33+
This module applies a new Stock Warehouse Flow on Stock Moves when carrier changes on a Stock Picking
34+
35+
**Table of contents**
36+
37+
.. contents::
38+
:local:
39+
40+
Bug Tracker
41+
===========
42+
43+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/issues>`_.
44+
In case of trouble, please check there if your issue has already been reported.
45+
If you spotted it first, help us to smash it by providing a detailed and welcomed
46+
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20stock_warehouse_flow_delivery_refresh%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
47+
48+
Do not contact contributors directly about support or help with technical issues.
49+
50+
Credits
51+
=======
52+
53+
Authors
54+
~~~~~~~
55+
56+
* Camptocamp
57+
* BCIM
58+
59+
Contributors
60+
~~~~~~~~~~~~
61+
62+
* Jacques-Etienne Baudoux <je@bcim.be>
63+
* Matthieu Méquignon <matthieu.mequignon@camptocamp.com>
64+
65+
Maintainers
66+
~~~~~~~~~~~
67+
68+
This module is maintained by the OCA.
69+
70+
.. image:: https://odoo-community.org/logo.png
71+
:alt: Odoo Community Association
72+
:target: https://odoo-community.org
73+
74+
OCA, or the Odoo Community Association, is a nonprofit organization whose
75+
mission is to support the collaborative development of Odoo features and
76+
promote its widespread use.
77+
78+
This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/14.0/stock_warehouse_flow_delivery_refresh>`_ project on GitHub.
79+
80+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "Stock Warehouse Flow Delivery Refresh",
3+
"summary": "Allow to refresh delivery flow when carrier changes",
4+
"version": "14.0.1.0.0",
5+
"category": "Warehouse Management",
6+
"website": "https://github.com/OCA/wms",
7+
"author": "Camptocamp, BCIM, Odoo Community Association (OCA)",
8+
"license": "AGPL-3",
9+
"installable": True,
10+
"depends": [
11+
"stock_warehouse_flow",
12+
"stock_available_to_promise_release",
13+
],
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import stock_move
2+
from . import stock_picking
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2025 Camptocamp SA, BCIM
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
3+
4+
from odoo import api, models
5+
6+
class StockMove(models.Model):
7+
_inherit = "stock.move"
8+
9+
def _stock_warehouse_flow_onchange_carrier(self):
10+
flow_model = self.env["stock.warehouse.flow"]
11+
moves_need_release = self.filtered(lambda m: m.picking_id.need_release)
12+
for move in moves_need_release:
13+
flow_model._search_and_apply_for_move(move, assign_picking=True)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2025 Camptocamp SA, BCIM
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
3+
4+
from odoo import api, models
5+
6+
class StockPicking(models.Model):
7+
_inherit = "stock.picking"
8+
9+
def write(self, values):
10+
picking_carrier_mapping = {p.id: p.carrier_id for p in self}
11+
super().write(values)
12+
pickings_to_update = self.filtered(
13+
lambda p: picking_carrier_mapping.get(p.id) != p.carrier_id
14+
)
15+
pickings_to_update.move_lines._stock_warehouse_flow_onchange_carrier()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Jacques-Etienne Baudoux <je@bcim.be>
2+
* Matthieu Méquignon <matthieu.mequignon@camptocamp.com>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This is a glue module between Stock Warehouse Flow and Stock Available On Premise Release.
2+
3+
This module applies a new Stock Warehouse Flow on Stock Moves when carrier changes on a Stock Picking

0 commit comments

Comments
 (0)