Skip to content

Commit

Permalink
[ADD] delivery_schenker: New module
Browse files Browse the repository at this point in the history
TT31005
  • Loading branch information
chienandalu committed Sep 22, 2021
1 parent 615899c commit 7ec7909
Show file tree
Hide file tree
Showing 25 changed files with 2,716 additions and 0 deletions.
170 changes: 170 additions & 0 deletions delivery_schenker/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
=================
Delivery Schenker
=================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/13.0/delivery_schenker
: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-13-0/delivery-carrier-13-0-delivery_schenker
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/99/13.0
:alt: Try me on Runbot

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

This module links the `DB Schenker <https://www.dbschenker.com>`_ booking and tracking
APIs with Odoo delivery system.

**Table of contents**

.. contents::
:local:

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

This module depends on the `zeep` python library and the OCA/delivery-carrier
`delivery_package_number` and `delivery_state` modules.

The Schenker API doesn't provide delivery rating methods, so OCA's
`delivery_price_method` is advised in order to use this carrier in a sales workflow.

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

To configure a Schenker delivery method:

#. Go to *Inventory > Configuration > Delivery > Shipping methods* and create a new one.
#. Choose *DB Schenker* as provider.
#. Configure the service parameters according to your contract considerations.
#. Choose a delivery product and a default packaging. This is mandatory for the booking
request as it needs the packaging code.

To make tests, set the carrier environment to test from the smart button. Don't forget
to set it to production once you're ready to use the delivery method!

Usage
=====

These are the operations possible with this module:

Place shipping bookings
~~~~~~~~~~~~~~~~~~~~~~~

#. When the picking is validated, the shipping will be booked at Schenker.
#. With the response, we'll receive the delivery tracking number and the pdf label in a
chatter message and it will be kept as attachment to the document.
#. You can manage packages number either with the proper Odoo workflows or with the
package number field available in the *Additional Info* tab. You'll get as many
labels as declared packages.

Cancel bookings
~~~~~~~~~~~~~~~

#. As in other carriers, we can cancel the shipping after the picking is done. To do
so, go to *Additional Info* tab and click on the *Cancel* action on the side of the
tracking number.
#. We can generate a new shipping if necessary.

Get labels
~~~~~~~~~~

#. If by chance we delete the generated labels, we can obtain them again hitting the
*Schenker Label* buttons in the header of the picking form.

Tracking
~~~~~~~~

#. The module is integrated with `delivery_state` to be able to get the tracking info
directly from the DB Schenker API.
#. To do so, go to a picking shipped with Schenker. In the *Additional Info* tab you'll
find an action button to *Update tracking state* so the state will be updated from
the Schenker API.

Debugging
~~~~~~~~~

The API calls and responses are tracked in two special fields in the picking that can
be viewed by technical users. You can also log them in as `ir.logging` records setting
the carrier debug on from the smart button.

Known issues / Roadmap
======================

* There's no dummy access key to test API calls so no tests can be performed.
* The test booking and shipping APIs databases aren't connected so it isn't possible to
perform trackings on test mode.
* Only land shipping is implemented, although the module is prepared for extend to
air and ocean just considering the mandatory request fields for those methods.
Some additional adaptations could be needed (e.g.: origin and destination airport,
port) anyway.
* Only volume is supported as a measure unit and with the limitations of Odoo itself. To
enjoy a full fledged volume support, install and configure the OCA’s
`stock_quant_package_dimension` module and its dependencies. The connector is ready to
make use of their volume computations.
* It’d be needed to extend the method to support Schenker measure units such as loading
pieces or pallet space.
* Some more booking features aren’t yet supported although can be extended in the
future. Some of those, although the complete list would be really extensive:

* Dangerous goods.
* Driver pre-advise.
* Transport temperature.
* Customs clearance.
* Cargo insurance.
* Cash on delivery.

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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_schenker%0Aversion:%2013.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

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

* `Tecnativa <https://www.tecnativa.com>`_:

* David Vidal

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/13.0/delivery_schenker>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions delivery_schenker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions delivery_schenker/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Delivery Schenker",
"summary": "Delivery Carrier implementation for DB Schenker API",
"version": "13.0.1.0.0",
"category": "Stock",
"website": "https://github.com/OCA/delivery-carrier",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["delivery_package_number", "delivery_state"],
"external_dependencies": {"python": ["zeep"]},
"data": [
"views/delivery_schenker_view.xml",
"views/stock_picking_views.xml",
"data/delivery_schenker_data.xml",
],
}
186 changes: 186 additions & 0 deletions delivery_schenker/api/fat_bookingWebServiceV1_1.wsdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?xml version='1.0' encoding='UTF-8'?><definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://www.schenker.com/Booking/v1_1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="BookingWebService" targetNamespace="http://www.schenker.com/Booking/v1_1">
<types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://www.schenker.com/Booking/v1_1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">

<xsd:import namespace="http://www.schenker.com/Booking/v1_1" schemaLocation="https://eschenker-fat.dbschenker.com/webservice/bookingWebServiceV1_1?xsd=BookingWebService_v1.1.xsd"/>

</xsd:schema>
</types>
<message name="getBookingRequestLand">
<part element="tns:getBookingRequestLand" name="parameters">
</part>
</message>
<message name="getBookingRequestOceanFCL">
<part element="tns:getBookingRequestOceanFCL" name="parameters">
</part>
</message>
<message name="getBookingCancelRequest">
<part element="tns:getBookingCancelRequest" name="parameters">
</part>
</message>
<message name="getBookingResponse">
<part element="tns:getBookingResponse" name="parameters">
</part>
</message>
<message name="getBookingBarcodeResponse">
<part element="tns:getBookingBarcodeResponse" name="parameters">
</part>
</message>
<message name="getBookingRequestAir">
<part element="tns:getBookingRequestAir" name="parameters">
</part>
</message>
<message name="schenkerServiceException">
<part element="tns:schenkerServiceException" name="fault">
</part>
</message>
<message name="getBookingBarcodeRequest">
<part element="tns:getBookingBarcodeRequest" name="parameters">
</part>
</message>
<message name="getBookingCancelResponse">
<part element="tns:getBookingCancelResponse" name="parameters">
</part>
</message>
<message name="getBookingRequestOceanLCL">
<part element="tns:getBookingRequestOceanLCL" name="parameters">
</part>
</message>
<portType name="BookingWebService">
<documentation>Booking Web Service to create Land, Ocean and Air bookings</documentation>
<operation name="getBookingRequestLand">
<documentation>Booking Web Service operation to create Land bookings</documentation>
<input message="tns:getBookingRequestLand" name="in" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingRequestLand">
</input>
<output message="tns:getBookingResponse" name="out" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/getBookingResponseLand">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
<operation name="getBookingRequestAir">
<documentation>Booking Web Service operation to create Air bookings</documentation>
<input message="tns:getBookingRequestAir" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingRequestAir">
</input>
<output message="tns:getBookingResponse" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/getBookingResponseAir">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
<operation name="getBookingRequestOceanLCL">
<documentation>Booking Web Service operation to create Ocean LCL bookings</documentation>
<input message="tns:getBookingRequestOceanLCL" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingRequestOceanLCL">
</input>
<output message="tns:getBookingResponse" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/getBookingResponseOcean">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
<operation name="getBookingRequestOceanFCL">
<documentation>Booking Web Service operation to create Ocean FCL bookings</documentation>
<input message="tns:getBookingRequestOceanFCL" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingRequestOceanFCL">
</input>
<output message="tns:getBookingResponse" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/OceanResponse">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
<operation name="getBookingBarcodeRequest">
<documentation>Booking Web Service operation to get a barcode based on a booking id</documentation>
<input message="tns:getBookingBarcodeRequest" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingBarcodeRequest">
</input>
<output message="tns:getBookingBarcodeResponse" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/BarcodeResponse">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
<operation name="getBookingCancelRequest">
<documentation>Booking Web Service operation to cancel a booking by booking id</documentation>
<input message="tns:getBookingCancelRequest" wsam:Action="http://www.schenker.com/Booking/v1_1/getBookingCancelRequest">
</input>
<output message="tns:getBookingCancelResponse" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/CancelResponse">
</output>
<fault message="tns:schenkerServiceException" name="SchenkerServiceException" wsam:Action="http://www.schenker.com/Booking/v1_1/BookingWebService/Fault/SchenkerServiceException">
</fault>
</operation>
</portType>
<binding name="BookingWebServiceServiceSOAPBinding" type="tns:BookingWebService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getBookingRequestLand">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingRequestLand"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
<operation name="getBookingRequestAir">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingRequestAir"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
<operation name="getBookingRequestOceanLCL">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingRequestOceanLCL"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
<operation name="getBookingRequestOceanFCL">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingRequestOceanFCL"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
<operation name="getBookingBarcodeRequest">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingBarcodeRequest"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
<operation name="getBookingCancelRequest">
<soap:operation soapAction="http://www.schenker.com/Booking/v1_1/getBookingCancelRequest"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="SchenkerServiceException">
<soap:fault name="SchenkerServiceException" use="literal"/>
</fault>
</operation>
</binding>
<service name="BookingWebService">
<port binding="tns:BookingWebServiceServiceSOAPBinding" name="BookingWebServiceServiceSOAPBinding">
<soap:address location="https://eschenker-fat.dbschenker.com/webservice/bookingWebServiceV1_1"/>
</port>
</service>
</definitions>
Loading

0 comments on commit 7ec7909

Please sign in to comment.