Metadata-Version: 2.1
Name: odoo-addon-fieldservice_sale_stock_route
Version: 18.0.1.0.0.3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-fieldservice_route==18.0.*
Requires-Dist: odoo-addon-fieldservice_sale_stock==18.0.*
Requires-Dist: odoo==18.0.*
Summary: Link between Field Service Sale Stock and Route
Home-page: https://github.com/OCA/field-service
License: AGPL-3
Author: APSL-Nagarro, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

================================
Field Service - Sale Stock Route
================================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:b3ba5bf95a63b99c7b307b18c8d3c2cb14d1793c58702e356d8e608e4b33390e
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Ffield--service-lightgray.png?logo=github
    :target: https://github.com/OCA/field-service/tree/18.0/fieldservice_sale_stock_route
    :alt: OCA/field-service
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/field-service-18-0/field-service-18-0-fieldservice_sale_stock_route
    :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/field-service&target_branch=18.0
    :alt: Try me on Runboat

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

This module integrates the fieldservice_sale_stock and
fieldservice_route modules, enabling automatic generation of FSM order
day routes from sales orders.

Requirements for Confirming a Sales Order
-----------------------------------------

If a sales order contains a product that generates an FSM order, the
following conditions must be met before confirmation:

- An FSM location must be set.
- The FSM location must have an assigned route.
- The FSM route must have a designated FSM person.
- The FSM route must have assigned working days.

Automatic Scheduling of FSM Orders
----------------------------------

- 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.
- 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. This validation can be overridden by enabling
  the **"Force Schedule"** option on the FSM route to allow scheduling
  on any day.

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.

**Table of contents**

.. contents::
   :local:

Usage
=====

To use this module, you need to:

1. Navigate to Sales > Orders.
2. Create a new sales order.
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).
4. Set the Customer and FSM Location.
5. Make sure the FSM Location has a route set and this route has a
   person assigned and route days set.
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.
7. Confirm the sale order.
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.

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.

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.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/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/field-service/issues/new?body=module:%20fieldservice_sale_stock_route%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
-------

* APSL-Nagarro

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

   `APSL-Nagarro <https://www.apsl.tech>`__:

   - Patryk Pyczko <ppyczko@apsl.net>
   - Bernat Obrador <bobrador@apsl.net>

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.

.. |maintainer-ppyczko| image:: https://github.com/ppyczko.png?size=40px
    :target: https://github.com/ppyczko
    :alt: ppyczko

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ppyczko| 

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/18.0/fieldservice_sale_stock_route>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
