Skip to content

Commit 8796098

Browse files
committed
[17.0][ADD] stock_picking_carrier: Setting the shipping method automatically according to the receiving origin in the picking
1 parent d9f39a9 commit 8796098

16 files changed

+743
-0
lines changed

stock_picking_carrier/README.rst

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
=====================
2+
Stock Picking Carrier
3+
=====================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:90b8ff4b2dfdba96bc810968c0ce61efa54c512d6abea98421992e2442873c49
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%2Fstock--logistics--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_carrier
21+
:alt: OCA/stock-logistics-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_picking_carrier
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/stock-logistics-workflow&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows you to complete the Carrier field during picking, if
32+
the partner has previously associated a shipping method.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Usage
40+
=====
41+
42+
Configure shipping method in the contact
43+
----------------------------------------
44+
45+
1. Go to Contacts or any other menu to access contacts.
46+
2. Select the contact you want to configure the shipping method.
47+
3. Go to the tab "Sales & Purchases" and select the shipping method.
48+
49+
|SHIPPING_METHOD_CONTACT|
50+
51+
Set shipping method on the picking
52+
----------------------------------
53+
54+
1. Go to Inventory > Operations > Receipts
55+
56+
2. Create a new picking
57+
58+
3. Select the Receive From and the Shipping Method field will
59+
automatically be filled in on the Additional Information tab.
60+
61+
|SHIPPING_METHOD_PICKING|
62+
63+
Set shipping method when creating a sales order
64+
-----------------------------------------------
65+
66+
1. Go to Sales > Orders > Quotations
67+
68+
2. Create a new sale order
69+
70+
3. Add the partner, lines, and other necessary data, then confirm the
71+
sales order.
72+
73+
4. A picking will be created with the Carrier configured in the partner
74+
selected in the sales order.
75+
76+
|SALE_SHIPPING_METHOD_PICKING|
77+
78+
.. |SHIPPING_METHOD_CONTACT| image:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/17.0/stock_picking_carrier/static/img/readme/configure_shipping_method_contact.png
79+
.. |SHIPPING_METHOD_PICKING| image:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/17.0/stock_picking_carrier/static/img/readme/configure_shipping_method_picking.png
80+
.. |SALE_SHIPPING_METHOD_PICKING| image:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/17.0/stock_picking_carrier/static/img/readme/configure_sale_shipping_method_picking.png
81+
82+
Bug Tracker
83+
===========
84+
85+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
86+
In case of trouble, please check there if your issue has already been reported.
87+
If you spotted it first, help us to smash it by providing a detailed and welcomed
88+
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_carrier%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
89+
90+
Do not contact contributors directly about support or help with technical issues.
91+
92+
Credits
93+
=======
94+
95+
Authors
96+
-------
97+
98+
* Binhex
99+
100+
Contributors
101+
------------
102+
103+
[Binhex] (https://www.binhex.cloud):
104+
105+
- Edilio Escalona Almira [email protected]
106+
107+
Maintainers
108+
-----------
109+
110+
This module is maintained by the OCA.
111+
112+
.. image:: https://odoo-community.org/logo.png
113+
:alt: Odoo Community Association
114+
:target: https://odoo-community.org
115+
116+
OCA, or the Odoo Community Association, is a nonprofit organization whose
117+
mission is to support the collaborative development of Odoo features and
118+
promote its widespread use.
119+
120+
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_picking_carrier>`_ project on GitHub.
121+
122+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

stock_picking_carrier/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Binhex <https://www.binhex.cloud>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import models
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2025 Binhex <https://www.binhex.cloud>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Stock Picking Carrier",
6+
"version": "17.0.1.0.0",
7+
"author": "Binhex, Odoo Community Association (OCA)",
8+
"category": "Inventory/Delivery",
9+
"website": "https://github.com/OCA/stock-logistics-workflow",
10+
"depends": ["stock_delivery"],
11+
"data": [],
12+
"installable": True,
13+
"license": "AGPL-3",
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 Binhex <https://www.binhex.cloud>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import stock_picking
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2025 Binhex <https://www.binhex.cloud>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class StockPicking(models.Model):
8+
_inherit = "stock.picking"
9+
10+
@api.model_create_multi
11+
def create(self, vals):
12+
ResPartner = self.env["res.partner"]
13+
for val in vals:
14+
if "partner_id" in val:
15+
val["carrier_id"] = ResPartner.browse(
16+
val["partner_id"]
17+
).property_delivery_carrier_id.id
18+
return super().create(vals)
19+
20+
@api.onchange("partner_id")
21+
def _onchange_partner_id(self):
22+
for picking in self:
23+
if picking.partner_id:
24+
picking.carrier_id = picking.partner_id.property_delivery_carrier_id.id
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Binhex] (https://www.binhex.cloud):
2+
- Edilio Escalona Almira <[email protected]>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This module allows you to complete the Carrier field during picking, if the partner has previously associated a shipping method.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Configure shipping method in the contact
2+
-------------------------
3+
4+
1. Go to Contacts or any other menu to access contacts.
5+
2. Select the contact you want to configure the shipping method.
6+
3. Go to the tab "Sales & Purchases" and select the shipping method.
7+
8+
![SHIPPING_METHOD_CONTACT](../static/img/readme/configure_shipping_method_contact.png)
9+
10+
11+
Set shipping method on the picking
12+
-------------------------
13+
14+
1. Go to Inventory > Operations > Receipts
15+
2. Create a new picking
16+
3. Select the Receive From and the Shipping Method field
17+
will automatically be filled in on the Additional Information tab.
18+
19+
![SHIPPING_METHOD_PICKING](../static/img/readme/configure_shipping_method_picking.png)
20+
21+
22+
Set shipping method when creating a sales order
23+
-------------------------
24+
25+
1. Go to Sales > Orders > Quotations
26+
2. Create a new sale order
27+
3. Add the partner, lines, and other necessary data, then confirm the sales order.
28+
4. A picking will be created with the Carrier configured in the partner selected in the sales order.
29+
30+
![SALE_SHIPPING_METHOD_PICKING](../static/img/readme/configure_sale_shipping_method_picking.png)
31+
32+
9.23 KB
Loading

0 commit comments

Comments
 (0)