Metadata-Version: 2.1
Name: odoo-addon-delivery_dachser
Version: 18.0.2.0.0.2
Requires-Python: >=3.10
Requires-Dist: odoo-addon-delivery_package_number==18.0.*
Requires-Dist: odoo-addon-delivery_state==18.0.*
Requires-Dist: odoo-addon-stock_picking_volume==18.0.*
Requires-Dist: odoo==18.0.*
Summary: Delivery Carrier implementation for Dachser REST API v2: quotations, transport orders, PDF/ZPL labels, tracking and POD
Home-page: https://github.com/OCA/delivery-carrier
License: AGPL-3
Author: Tecnativa, Acysos S.L., 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

================
Delivery Dachser
================

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

.. |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%2Fdelivery--carrier-lightgray.png?logo=github
    :target: https://github.com/OCA/delivery-carrier/tree/18.0/delivery_dachser
    :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-18-0/delivery-carrier-18-0-delivery_dachser
    :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=18.0
    :alt: Try me on Runboat

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

This module integrates Odoo's ``delivery`` framework (along with
``delivery_package_number``, ``delivery_state``, and
``stock_picking_volume``) with **Dachser REST API v2**
(``https://api-gateway.dachser.com/rest/v2``), providing European
Logistics (``T``) and Food Logistics (``F``) shipping automation:

- **Online Freight Quotations (``sale.order``)**:

  - Live rate calculation via ``POST /rest/v2/quotations`` with currency
    conversion and automatic Incoterm-to-Frankatur mapping (``EXW``,
    ``FCA``, ``DAP``, ``DDP``, etc.).
  - Compatible with OCA ``delivery_price_method`` when fixed or
    rule-based local pricing is desired.

- **Shipment & Picking Submission (``stock.picking``)**:

  - Transport order creation
    (``POST /rest/v2/transportorders/{basket}``) in ``imported``,
    ``labelled``, or ``sent`` baskets, plus standalone label generation
    (``POST /rest/v2/labels``) with automatic test-environment fallback.
  - Native integration with ``delivery_package_number``
    (``number_of_packages``), ``delivery_state`` (``delivery_state``,
    ``tracking_state``, ``tracking_state_history``, ``tracking_json``,
    ``date_delivered``, ``pod_file``), and ``stock_picking_volume``
    (``volume``).
  - Automatic assignment of 18-digit **GS1 SSCC** codes to physical Odoo
    packages (``stock.quant.package``).
  - Automatic 30-character street and name splitting complying with
    Dachser REST API v2 schema constraints.

- **Label Generation (PDF & Thermal ZPL)**:

  - Instant attachment of **PDF** (``P``) or **ZPL** (``Z``) shipping
    labels on the picking, supporting GS1 **EAN** 1D barcodes and **2D
    DataMatrix (DMC)** labels.
  - One-click label reprinting (``dachser_get_label``), deferred TMS
    confirmation (``dachser_send_to_tms``), and return label generation
    (``dachser_get_return_label``).

- **Live Tracking, Event History & Signed POD**:

  - Direct link to **Dachser eLogistics ShipmentPointer**.
  - Live shipment status (``GET /rest/v2/shipmentstatus``), full
    chronological event history (``GET /rest/v2/shipmenthistory``), and
    automatic signed **Proof of Delivery (POD PDF)** download
    (``GET /rest/v2/pods``) stored in ``delivery_state``'s ``pod_file``.

- **Daily Loading Manifest (Transfer List)**:

  - Wizard to download the daily **Transfer List PDF**
    (``GET /rest/v2/transferlists/{orderdate}``) for the Dachser driver.

**Table of contents**

.. contents::
   :local:

Installation
============

It depends on the modules delivery_package_number, delivery_state and
stock_picking_volum that can be found on OCA/delivery-carrier.

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

To configure this module:

1. Go to **Inventory > Configuration > Delivery > Shipping Methods** (or
   **Sales > Configuration > Shipping Methods**).
2. Create a new shipping method (or open an existing one) with
   **Provider** = ``Dachser``.
3. In the **Dachser Configuration** tab:

   - Enter your **Dachser Api Key** (``X-API-Key`` token from the
     `Dachser API
     Portal <https://api-portal.dachser.com/bi.b2b.portal/api?2>`__) and
     toggle **Production Environment** as appropriate.
   - Set your **Dachser Branch ID** (e.g. ``193``), **Dachser Customer
     ID**, **Division Code** (``T`` for European Logistics, ``F`` for
     Food Logistics), **Product Code** (``Y`` targoflex, ``Z``
     targospeed, ``N`` classicline/vengoflex, etc.), and **Term Code**
     (``031`` Free delivered, ``021`` EXW, etc.).
   - Choose your **Packaging Code**, **Packaging Type**
     (``stock.package.type``), **Label Format** (``PDF`` or ``ZPL``),
     and target eLogistics **Basket** (``sent``, ``labelled``, or
     ``imported``).

4. *(Optional)* Install ``delivery_price_method`` if you wish to define
   fixed or rule-based local shipping prices instead of querying
   ``POST /rest/v2/quotations``.

Usage
=====

Calculating Shipping Rates on Sales Orders
------------------------------------------

1. Create or open a **Sales Order** and click **Add shipping**.
2. Select **Dachser** and click **Get rate** to fetch the live quotation
   from Dachser REST API v2.
3. Click **Add** to create the delivery line on the sales order.

Sending Shipments & Printing Labels from Pickings
-------------------------------------------------

1. Validate the outgoing **Delivery Order** (``stock.picking``) or click
   **Send to Shipper**.
2. Odoo sends the transport order to Dachser, assigns **SSCC** codes to
   the packages, updates ``delivery_state`` and
   ``tracking_state_history``, records ``carrier_tracking_ref``, and
   attaches the **PDF/ZPL label** in the chatter.
3. From the picking form you can also:

   - Click **Dachser Label** to reprint PDF/ZPL labels.
   - Click **Send to Dachser TMS** when the order was created in
     ``imported`` or ``labelled`` state.
   - Click **Print Return Label** to generate a Dachser return label.
   - Use **Tracking** to open Dachser eLogistics ShipmentPointer, or
     rely on ``delivery_state``'s scheduled action
     (``tracking_state_update``) to automatically synchronize
     ``delivery_state``, ``tracking_state_history``, and download the
     signed **POD PDF** into ``pod_file``.

Downloading the Daily Loading Manifest (Transfer List)
------------------------------------------------------

1. Open the Dachser shipping method and click the **Daily Manifest**
   smart button.
2. Select the **Order Date** (and optional **Order Group**) and click
   **Query and Download PDF Manifest**.

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_dachser%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
-------

* Tecnativa
* Acysos S.L.

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

- `Tecnativa <https://www.tecnativa.com>`__:

  - Víctor Martínez

- `Acysos S.L. <https://www.acysos.com>`__:

  - Ignacio Ibeas ignacio@acysos.com

- `Acysos S.L. <https://www.acysos.com>`__

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
    :target: https://github.com/victoralmau
    :alt: victoralmau

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

|maintainer-victoralmau| 

This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/18.0/delivery_dachser>`_ project on GitHub.

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