Skip to content

Commit ac0193c

Browse files
committed
[15.0][ADD] fieldservice_sale_stock_route: New module fieldservice_sale_stock_route
1 parent 381a6fc commit ac0193c

20 files changed

+1308
-0
lines changed
+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
================================
2+
Field Service - Sale Stock Route
3+
================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:8d2e3e157d288e550262aba54a16930a5be9dc2ae26b0d863ba42e01708ef3f6
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%2Ffield--service-lightgray.png?logo=github
20+
:target: https://github.com/OCA/field-service/tree/15.0/fieldservice_sale_stock_route
21+
:alt: OCA/field-service
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_sale_stock_route
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/field-service&target_branch=15.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module integrates the `fieldservice_sale_stock` and `fieldservice_route` modules, enabling automatic generation of FSM order day routes from sales orders.
32+
33+
Requirements for Confirming a Sales Order
34+
-----------------------------------------
35+
If a sales order contains a product that generates an FSM order, the following conditions must be met before confirmation:
36+
37+
- An FSM location must be set.
38+
- The FSM location must have an assigned route.
39+
- The FSM route must have a designated FSM person.
40+
- The FSM route must have assigned working days.
41+
42+
Automatic Scheduling of FSM Orders
43+
----------------------------------
44+
- If the `commitment_date` and `commitment_date_end` fields **are not set** on the sale order upon confirmation, they will be automatically assigned to the next available route day based on the FSM location’s schedule.
45+
- If these fields **are set**, the FSM order will be scheduled accordingly, with validation ensuring that the `commitment_date` falls on a valid route day.
46+
47+
This module also introduces a **"Postpone Delivery"** button in the FSM order form view, allowing users to reschedule the order to the next available route day based on the FSM location’s schedule.
48+
49+
**Table of contents**
50+
51+
.. contents::
52+
:local:
53+
54+
Usage
55+
=====
56+
57+
To use this module, you need to:
58+
59+
1. Navigate to Sales > Orders.
60+
2. Create a new sales order.
61+
3. Add a product that generates an FSM order (Field Service Tracking set to "Create one FSM order per sale order" on the product form).
62+
4. Set the Customer and FSM Location.
63+
5. Make sure the FSM Location has a route set and this route has a person assigned and route days set.
64+
6. In the sale order, navigate to the 'Other Info' tab and set the 'Delivery Date' and 'Delivery End Date' fields. You can also leave them empty to have the system automatically assign the next available route day.
65+
7. Confirm the sale order.
66+
8. If the 'Delivery Date' and 'Delivery End Date' fields were empty, the system will automatically assign the next available route day based on the FSM location's schedule. If they were set, the FSM order will be scheduled accordingly. In case the 'Delivery Date' falls on a day that is not part of the route, the system will show an error message.
67+
68+
If you navigate to the FSM order, you will see that the Schedule Details are based on the 'Delivery Date' and 'Delivery End Date' fields from the sale order.
69+
70+
Additionally, you will find a 'Postpone Delivery' button in the FSM order form view, allowing you to reschedule the order to the next available route day based on the FSM location's schedule. You can also manually reschedule the order by changing the 'Delivery Date' and 'Delivery End Date' fields in the sale order.
71+
72+
Bug Tracker
73+
===========
74+
75+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
76+
In case of trouble, please check there if your issue has already been reported.
77+
If you spotted it first, help us to smash it by providing a detailed and welcomed
78+
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_sale_stock_route%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
79+
80+
Do not contact contributors directly about support or help with technical issues.
81+
82+
Credits
83+
=======
84+
85+
Authors
86+
~~~~~~~
87+
88+
* APSL-Nagarro
89+
90+
Contributors
91+
~~~~~~~~~~~~
92+
93+
`APSL-Nagarro <https://www.apsl.tech>`_:
94+
* Patryk Pyczko <ppyczko@apsl.net>
95+
96+
Maintainers
97+
~~~~~~~~~~~
98+
99+
This module is maintained by the OCA.
100+
101+
.. image:: https://odoo-community.org/logo.png
102+
:alt: Odoo Community Association
103+
:target: https://odoo-community.org
104+
105+
OCA, or the Odoo Community Association, is a nonprofit organization whose
106+
mission is to support the collaborative development of Odoo features and
107+
promote its widespread use.
108+
109+
.. |maintainer-ppyczko| image:: https://github.com/ppyczko.png?size=40px
110+
:target: https://github.com/ppyczko
111+
:alt: ppyczko
112+
113+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
114+
115+
|maintainer-ppyczko|
116+
117+
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/15.0/fieldservice_sale_stock_route>`_ project on GitHub.
118+
119+
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,4 @@
1+
# Copyright 2025 Patryk Pyczko (APSL-Nagarro)<ppyczko@apsl.net>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Patryk Pyczko (APSL-Nagarro)<ppyczko@apsl.net>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Field Service - Sale Stock Route",
6+
"version": "15.0.1.0.0",
7+
"summary": "Link between Field Service Sale Stock and Route",
8+
"category": "Field Service",
9+
"website": "https://github.com/OCA/field-service",
10+
"author": "APSL-Nagarro, Odoo Community Association (OCA)",
11+
"maintainers": ["ppyczko"],
12+
"license": "AGPL-3",
13+
"application": False,
14+
"installable": True,
15+
"depends": [
16+
"fieldservice_sale_stock",
17+
"fieldservice_route",
18+
],
19+
"data": ["views/fsm_order.xml", "views/sale_order.xml"],
20+
}
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * fieldservice_sale_stock_route
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-03-11 11:15+0000\n"
10+
"PO-Revision-Date: 2025-03-11 11:15+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: fieldservice_sale_stock_route
19+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
20+
msgid "Delivery End Date"
21+
msgstr "Data de finalització del lliurament"
22+
23+
#. module: fieldservice_sale_stock_route
24+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
25+
#, python-format
26+
msgid "FSM Location must have a route set."
27+
msgstr "La ubicació FSM ha de tenir una ruta establerta."
28+
29+
#. module: fieldservice_sale_stock_route
30+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
31+
#, python-format
32+
msgid "FSM Route must have a person set."
33+
msgstr "La ruta FSM ha de tenir una persona establerta."
34+
35+
#. module: fieldservice_sale_stock_route
36+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
37+
#, python-format
38+
msgid "FSM Route must have days set."
39+
msgstr "La ruta FSM ha de tenir dies establerts."
40+
41+
#. module: fieldservice_sale_stock_route
42+
#: model:ir.model,name:fieldservice_sale_stock_route.model_fsm_order
43+
msgid "Field Service Order"
44+
msgstr "Ordre de servei de camp"
45+
46+
#. module: fieldservice_sale_stock_route
47+
#: model_terms:ir.ui.view,arch_db:fieldservice_sale_stock_route.fsm_order_form_inherit_product_move_ids
48+
msgid "Postpone Delivery"
49+
msgstr "Aplaçar el lliurament"
50+
51+
#. module: fieldservice_sale_stock_route
52+
#: model:ir.model,name:fieldservice_sale_stock_route.model_sale_order
53+
msgid "Sales Order"
54+
msgstr "Comanda de venda"
55+
56+
#. module: fieldservice_sale_stock_route
57+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_fsm_order__show_postpone_button
58+
msgid "Show Postpone Button"
59+
msgstr "Mostrar botó d'aplaçament"
60+
61+
#. module: fieldservice_sale_stock_route
62+
#: model:ir.model.fields,help:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
63+
msgid ""
64+
"This is the delivery deadline date promised to the customer. If set, the "
65+
"delivery order will be scheduled based on this date rather than product lead"
66+
" times."
67+
msgstr ""
68+
"Aquesta és la data límit de lliurament promesa al client. Si s'estableix, "
69+
"l'ordre de lliurament es programarà en funció d'aquesta data en lloc dels "
70+
"temps de lliurament del producte."
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * fieldservice_sale_stock_route
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-03-11 11:15+0000\n"
10+
"PO-Revision-Date: 2025-03-11 11:15+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: fieldservice_sale_stock_route
19+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
20+
msgid "Delivery End Date"
21+
msgstr "Fecha de Entrega Final"
22+
23+
#. module: fieldservice_sale_stock_route
24+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
25+
#, python-format
26+
msgid "FSM Location must have a route set."
27+
msgstr "La ubicación FSM debe tener una ruta establecida."
28+
29+
#. module: fieldservice_sale_stock_route
30+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
31+
#, python-format
32+
msgid "FSM Route must have a person set."
33+
msgstr "La ruta FSM debe tener una persona asignada."
34+
35+
#. module: fieldservice_sale_stock_route
36+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
37+
#, python-format
38+
msgid "FSM Route must have days set."
39+
msgstr "La ruta FSM debe tener días establecidos."
40+
41+
#. module: fieldservice_sale_stock_route
42+
#: model:ir.model,name:fieldservice_sale_stock_route.model_fsm_order
43+
msgid "Field Service Order"
44+
msgstr "Orden de Servicio de Campo"
45+
46+
#. module: fieldservice_sale_stock_route
47+
#: model_terms:ir.ui.view,arch_db:fieldservice_sale_stock_route.fsm_order_form_inherit_product_move_ids
48+
msgid "Postpone Delivery"
49+
msgstr "Posponer Entrega"
50+
51+
#. module: fieldservice_sale_stock_route
52+
#: model:ir.model,name:fieldservice_sale_stock_route.model_sale_order
53+
msgid "Sales Order"
54+
msgstr "Pedido de venta"
55+
56+
#. module: fieldservice_sale_stock_route
57+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_fsm_order__show_postpone_button
58+
msgid "Show Postpone Button"
59+
msgstr "Mostrar Botón de Posponer"
60+
61+
#. module: fieldservice_sale_stock_route
62+
#: model:ir.model.fields,help:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
63+
msgid ""
64+
"This is the delivery deadline date promised to the customer. If set, the "
65+
"delivery order will be scheduled based on this date rather than product lead"
66+
" times."
67+
msgstr ""
68+
"Esta es la fecha límite de entrega prometida al cliente. Si se establece, el "
69+
"pedido de entrega se programará en función de esta fecha en lugar de los "
70+
"tiempos de entrega del producto."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * fieldservice_sale_stock_route
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-03-11 11:15+0000\n"
10+
"PO-Revision-Date: 2025-03-11 11:15+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: fieldservice_sale_stock_route
19+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
20+
msgid "Delivery End Date"
21+
msgstr ""
22+
23+
#. module: fieldservice_sale_stock_route
24+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
25+
#, python-format
26+
msgid "FSM Location must have a route set."
27+
msgstr ""
28+
29+
#. module: fieldservice_sale_stock_route
30+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
31+
#, python-format
32+
msgid "FSM Route must have a person set."
33+
msgstr ""
34+
35+
#. module: fieldservice_sale_stock_route
36+
#: code:addons/fieldservice_sale_stock_route/models/sale_order.py:0
37+
#, python-format
38+
msgid "FSM Route must have days set."
39+
msgstr ""
40+
41+
#. module: fieldservice_sale_stock_route
42+
#: model:ir.model,name:fieldservice_sale_stock_route.model_fsm_order
43+
msgid "Field Service Order"
44+
msgstr ""
45+
46+
#. module: fieldservice_sale_stock_route
47+
#: model_terms:ir.ui.view,arch_db:fieldservice_sale_stock_route.fsm_order_form_inherit_product_move_ids
48+
msgid "Postpone Delivery"
49+
msgstr ""
50+
51+
#. module: fieldservice_sale_stock_route
52+
#: model:ir.model,name:fieldservice_sale_stock_route.model_sale_order
53+
msgid "Sales Order"
54+
msgstr ""
55+
56+
#. module: fieldservice_sale_stock_route
57+
#: model:ir.model.fields,field_description:fieldservice_sale_stock_route.field_fsm_order__show_postpone_button
58+
msgid "Show Postpone Button"
59+
msgstr ""
60+
61+
#. module: fieldservice_sale_stock_route
62+
#: model:ir.model.fields,help:fieldservice_sale_stock_route.field_sale_order__commitment_date_end
63+
msgid ""
64+
"This is the delivery deadline date promised to the customer. If set, the "
65+
"delivery order will be scheduled based on this date rather than product lead"
66+
" times."
67+
msgstr ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2025 Patryk Pyczko (APSL-Nagarro)<ppyczko@apsl.net>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from . import fsm_order
5+
from . import sale_order

0 commit comments

Comments
 (0)