Sendcloud Shipping

by
Odoo
v 14.0 Third Party 1198
Download for v 14.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Sales (sale_management)
Discuss (mail)
Invoicing (account)
Inventory (stock)
Lines of code 5023
Technical Name delivery_sendcloud_official
LicenseOPL-1
Versions 14.0 13.0 15.0 16.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Sales (sale_management)
Discuss (mail)
Invoicing (account)
Inventory (stock)
Lines of code 5023
Technical Name delivery_sendcloud_official
LicenseOPL-1
Versions 14.0 13.0 15.0 16.0

Sendcloud Shipping

This module is part of the Sendcloud official connector for Odoo.

At the moment, the Sendcloud official connector for Odoo consists of two modules: delivery_sendcloud_official and website_sendcloud_official.

  1. delivery_sendcloud_official. This module works for the backend.
  2. website_sendcloud_official. This module is for the frontend (webshop) and it depends on delivery_sendcloud_official.

This module mostly implements what’s described in https://docs.sendcloud.sc/api/v2/shipping/

Full documentation for developers is in https://docs.sendcloud.sc/.

This module works for the Community Edition as well as the Enterprise Edition.

Table of contents




Installation

In the Odoo configuration file add delivery_sendcloud_official in the list server_wide_modules:

[options]
(...)
server_wide_modules = web,delivery_sendcloud_official
(...)

A restart of the Odoo server is required afterwards.




Configuration

Create an account on sendcloud.com and choose a plan.

Go to integrations and select Odoo integration to use the Odoo integration or select api integration if you only want to use the api integration (see readme for more information).




Odoo Integration

Go to Sendcloud > Configuration > Wizards > Setup the Sendcloud Integration. Click on Setup Integration. A wizard will pop up.

Image_10.png

Select Odoo Integration. Start Setup. You will be redirected to a Sendcloud page asking you to authorize OdooShop to access your Sendcloud account. Click on Connect in the Sendcloud page.

Image_20.png

Go back to the Odoo Integration configuration. An integration “OdooShop” is now present in the Integration list view. Open the OdooShop Integration form. Edit the OdooShop Integration. The changes you make will be in sync, Sendcloud side, with the integration configuration.

Image_30.png

In case multiple integrations are present, sort the integrations by sequence, to allow Odoo to choose the default one that will be used.

Please note that when using the Odoo integration an "incoming order" is created in Sendcloud as soon as you validate the salesorder. The “incoming order” has status “in process” in Sendcloud and is not forwarded to the carrier yet.

Image_40.png

When you validate the delivery in Odoo the label is created and the pick-up assignment is send to the carrier.

Image_50.png

In previous version there was a possibility to connect to the API integration instead of the Odoo integration. To benefit from Sendcloud support we highly recommend you to upgrade to the latest version of this module with the Odoo integration.




Sendcloud panel settings

When you configure the Integration settings in the online Sendcloud panel (https://panel.sendcloud.sc/) those settings are also sync-ed with the Integration settings Odoo side.




Synchronize Sendcloud objects

After the setup of the integration with Sendcloud server is completed, second step is to synchronize the objects present in Sendcloud server to Odoo. To synchronize Sendcloud objects for the first time:

Go to Sendcloud > Configuration > Wizards >Sync the Sendcloud Objects. A wizard will pop up.

Image_70.png

Select all the objects. Confirm. This will retrieve the required data from Sendcloud server.

Image_80.png

Some Sendcloud objects will be automatically synchronized from the Sendcloud server to Odoo. Those Sendcloud objects are:

  • Parcel Statuses
  • Invoices
  • Shipping Methods
  • Sender Addresses

To configure how often those objects should be retrieved from the Sendcloud server:

Go to Settings > Technical > Automation > Scheduled Actions. Search Scheduled Actions for “Sendcloud”.

Image_90.png

Set the “Execute Every” value according to your needs.




Sender Addresses and Warehouses

In case of multiple warehouses configured in Odoo (eg.: user belongs to group “Manage multiple Warehouse”):

Go to Sendcloud > Configuration > Integration. Click on Configure Warehouse Addresses. A wizard will pop up. Set the corresponding Sendcloud Sender Address for each of the warehouse addresses.

Image_100.png

Alternatively, in Inventory > Configuration > Warehouses, select an address. In the address form, go to Sales and Purchase tab and set the Sencloud Sender Address. In Sale Order > Delivery: select the Warehouse. Check that the address of the Warehouse has a Sendcloud Senser Address.

Image_110.png



Test Mode

Enabling the Test Mode allows you to access extra functionalities that are useful to test the connector.

To enable the Test Mode, go to the “General Settings”: under the Sendcloud section you can find the “Enable Test Mode” flag.

There is no seperate test environment available on the Sendcloud portal. This means that as soon as you create labels the carries is given the order to pickup the goods. You can use carrier "unstamped letter" for testing. When testing with other carriers make sure that you cancel the labels in the Sendcloud portal within a couple of hours otherwise the label will be billed and picked up.

Since there is no test environment it's very important to know that Sendcloud stores it records based on the delivery number, for instance WH/OUT/0001, this field is idempotent. So when you start testing and you will use delivery number WH/OUT/00001 this number is stored in Sendcloud. When you go live and use the same delivery numbers, in this case WH/OUT/00001, Sendcloud will treat this as an update of the existing record and will send back the shipping-address that was already stored (created while testing). To avoid this problem you should set a different prefix on the sequence out in your testenvironment. In debug mode, Technical/Sequences Identifiers/Sequences, select the sequence out and adjust this to WH/OUT/TEST for instance.

Image_120.png






Quickstart

In short this is how the module works:

  • the user creates a sale order in Odoo; the user clicks on “Add shipping” button and selects one of the shipping methods provided by Sendcloud
  • when confirming the sale order, a delivery document is generated (stock.picking)
  • when confirming the picking, a parcel (or multiple parcels) for the specific sales order are created in Sendcloud under Shipping > Created labels
  • the picking is updated with the information from Sendcloud (tracking number, tracking url, label etc…)



Map of Sendcloud-Odoo data models

Sendcloud Odoo
Integration  
Brand Website Shop
Order Sales Order
Shipment Picking
Parcel (colli) Picking packs
Sender address Warehouse address
Shipping Method Shipping Method



Multicollo parcels

In Inventory > Configuration > Delivery Packages, set the carrier to Sendcloud. In the out picking, put the products in different Sendcloud packages to create Multicollo parcels.




Service Point Picker

The module contains a widget, the Service Point Picker, that allows the selection of the service point. The widget is placed in the “Sendcloud Shipping” tab of the picking. The widget is visible in case the following is true:

  • the configuration in the Sendcloud panel has the Service Point flag to True (in the Sendcloud integration config)
  • the Shipping Method selected in the picking is provided by Sendcloud
  • the Shipping Method has field sendcloud_service_point_input == “required”
  • all the criteria (from country, to country, weight) match with the current order



Cancel parcels

When canceling parcels a confirmation popup will ask for confirmation.




Shipping outside EU

Install OCA module 'product_harmonized_system' for delivery outside of EU. Includes extra field 'country of origin'.




Troubleshooting

If the communication to the Sendcloud server fails (eg.: while creating a parcel), the exchanged message is stored in a Log section, under Logging > Actions.







TODO

  • Enable different Shipping Methods for different Websites



Credits

Authors

  • Onestein
Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
There are no ratings yet!
by
Giacomo Grasso
on 4/7/22, 4:17 AM

Dear Onestein, 

 we managed to finalize the flow, but we would need to delete/re-create labels with a different tracking number. In SendCloud website, this is done by entering into a cancelled label and clicking on "Duplicate". I get updated labels with new data and a NEW tracking number. How can I implement this with your module? Thank you in advance!

BTW: I found out how to test locally. I create an SO without the delivery method. Once validated, I add manually the carrier in the WH/OUT and I am able to create labels.... 




by
Giacomo Grasso
on 3/23/22, 1:01 PM

Dear Onestein, 
 thank you for you previous answer. One more questons: once I did the delivery, the outgoing parcel is created with its attachement/label that I can download.

I then click on "Create Return Parcel", follow all the steps and I get the return parcel. 

The return parcels has a printer url "https://panel.sendcloud.sc/api/v2/labels/label_printer/171168698" but does not have an attachment/label. if I click on "Get label" I get the following error "Sendcloud: Bad Request (error code 400). Please use the normal_printer endpoint when printing A4 labels".

What should I do?

thank you, Giacomo


by
Giacomo Grasso
on 3/21/22, 6:50 AM

Dear Onestein, 

 the module works well. However I have problems testing in my Localhost, the integration does not automatically works (I also copy/paste keys from another config, I updated the shipping methods but I can not validate a SO). How do you configure the integration (eventually) the webhook? thank you!


Giacomo

Re:
by
Andrea Stirpe
on 3/21/22, 7:23 AM Author

Hi Giacomo,

the easiest way is to setup an Odoo server having public IP, so that you can integrate it with Sendcloud.
I don't think there's an easy way to make it working with localhost (unless you have enough expertise on networking), as there is not any public IP exposed to Sendcloud.

If you need further information, or if you are interested in using a demo server, please send an email to Onestein. Thank you!
Andrea


Error
by
Renata Neusinger
on 10/20/21, 9:44 AM

Guten Tag, 

können Sie uns Helfen.

Wenn wir versuchen ein Angebot zu bestätigen erhalten wir diesen Fehler.

Verwenden Sie die Kopier-Schaltfläche, um den Fehler an Ihren Support-Dienst zu melden.

Odoo Server Error

Traceback (most recent call last):

  File "/opt/odoo-13/odoo/odoo/http.py", line 619, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/opt/odoo-13/odoo/odoo/http.py", line 309, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/opt/odoo-13/odoo/odoo/tools/pycompat.py", line 14, in reraise

    raise value

  File "/opt/odoo-13/odoo/odoo/http.py", line 664, in dispatch

    result = self._call_function(**self.params)

  File "/opt/odoo-13/odoo/odoo/http.py", line 345, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/opt/odoo-13/odoo/odoo/service/model.py", line 93, in wrapper

    return f(dbname, *args, **kwargs)

  File "/opt/odoo-13/odoo/odoo/http.py", line 338, in checked_call

    result = self.endpoint(*a, **kw)

  File "/opt/odoo-13/odoo/odoo/http.py", line 910, in __call__

    return self.method(*args, **kw)

  File "/opt/odoo-13/odoo/odoo/http.py", line 510, in response_wrap

    response = f(*args, **kw)

  File "/opt/odoo-13/odoo/addons/web/controllers/main.py", line 1324, in call_button

    action = self._call_kw(model, method, args, kwargs)

  File "/opt/odoo-13/odoo/addons/web/controllers/main.py", line 1312, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/opt/odoo-13/odoo/odoo/api.py", line 395, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

  File "/opt/odoo-13/odoo/odoo/api.py", line 382, in _call_kw_multi

    result = method(recs, *args, **kwargs)

  File "/opt/odoo-13/odoo/addons/sale_management/models/sale_order.py", line 124, in action_confirm

    res = super(SaleOrder, self).action_confirm()

  File "/opt/odoo-13/odoo/addons/sale/models/sale.py", line 747, in action_confirm

    self._action_confirm()

  File "/opt/odoo-13/custom/addons/delivery_sendcloud_official/models/sale_order.py", line 117, in _action_confirm

    to_sync._sync_picking_to_sendcloud()

  File "/opt/odoo-13/custom/addons/delivery_sendcloud_official/models/stock_picking.py", line 570, in _sync_picking_to_sendcloud

    err_msg = self._sync_shipment_to_sendcloud(err_msg, integration, vals)

  File "/opt/odoo-13/custom/addons/delivery_sendcloud_official/models/stock_picking.py", line 601, in _sync_shipment_to_sendcloud

    status = confirmation.get("status")

AttributeError: 'str' object has no attribute 'get'

Güße

Thomas