==============
Delivery State
==============

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

.. |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%2Fdelivery--carrier-lightgray.png?logo=github
    :target: https://github.com/OCA/delivery-carrier/tree/14.0/delivery_state
    :alt: OCA/delivery-carrier
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_state
    :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/delivery-carrier&target_branch=14.0
    :alt: Try me on Runboat

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

This module adds additional functions that will be needed for the carrier
developments. It provides fields to be able to contemplate the tracking states
and also adds a global field so it can have generic states in addition to the
ones carrier gives us.

**Table of contents**

.. contents::
   :local:

Configuration
=============

A scheduled action for automating the tracking update for these pickings can be
configured going to *Settings > Technical > Scheduled Actions* and then choosing
*Update deliveries states*. It will update the pending delivery states for the
pickings with service providers with tracking methods configured, and in pending
state (not delivered or cancelled).

In order to send automatic notifications to the customer when the picking is
confirmed:

  #. Go to *Inventory > Configuration > Settings*.
  #. Enable the option *Email Confirmation*.
  #. Choose the template "Delivery State Notification to Customer".

In order to deactivate the automatic update of the carrier state in a shipping
method:

  #. Go to *Inventory > Configuration > Shipping Methods*.
  #. Go to the form view of the shipping method.
  #. Uncheck the "Track Carrier State" option.

Usage
=====

Depending on the delivery service provider, the state tracking could be more or
less complete, since it could have or not the necessary API calls implemented.

With regular methods (fixed, based on rules):

  #. Go to Inventory / Operations and open an outgoing pending picking.
  #. In the *Additional Info* tab, assign it a delivery carrier which is fixed or
     based on rules.
  #. Validate the picking and you'll see in the same tab the delivery state
     info with the shipping date and the shipping state.
  #. If enabled, an automatic notification will be sent to the picking customer.

When service provider methods are implemented, we can follow the same steps as
described before, but we'll get additionally:

  #. In the *Additional Info* tab, we'll see button *Update tracking state* to
     manually query the provider API for tracking updates for this expedition.
  #. Depending on the stated returned by the provider, we could get these
     states (field *Carrier State*):

        * Shipping recorded in carrier
        * In transit
        * Canceled shipment (finished)
        * Incidence
        * Warehouse delivered
        * Customer delivered (finished)
  #. In the field *Tracking state* we'll get the tracking state name given by
     the provider (which is mapped to the ones in this module)
  #. In the field *Tracking history* we'll get the former states log.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/delivery-carrier/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/delivery-carrier/issues/new?body=module:%20delivery_state%0Aversion:%2014.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
~~~~~~~

* Trey (www.trey.es)
* FactorLibre
* Tecnativa

Contributors
~~~~~~~~~~~~

* `Trey <https://www.trey.es>`_:

  * Roberto Lizana <roberto@trey.es>

* `FactorLibre <https://www.factorlibre.com>`_:

  * Zahra Velasco <zahra.velasco@factorlibre.com>
* `Tecnativa <https://www.tecnativa.com>`_:

  * Pedro M. Baeza
  * David Vidal
* Marçal Isern <marsal.isern@qubiq.es>
* `Sygel <https://www.sygel.es>`_:

  * Manuel Regidor
  * Valentín Vinagre

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/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/14.0/delivery_state>`_ project on GitHub.

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