Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] [MIG] delivery_carrier_label_gls #778

Open
wants to merge 15 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions delivery_carrier_label_gls/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
==========================
Delivery Carrier Label GLS
==========================

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

.. |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_carrier_label_gls
: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_carrier_label_gls
: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|

Integration with GLS shipping webservices.
Documentation:
http://gls-shipit.gls-group.eu/webservices/2_8_11/doxygen/WS-REST-API/index.html

**Table of contents**

.. contents::
:local:

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

To start using GLS, you need to configure two types of settings in
*Inventory - Configuration- Delivery* or *Inventory - Configuration - Settings*
which leads to the right section in inventory global settings.
First you have the *Carrier Account* where you find account number
and password then you also have *Shipping Methods* with other GLS
parameters to configure such as contact ID, urls and return address.
These 2 types of settings use **"GLS"** as delivery type.
The contact ID corresponds to the sender which needs to be a contact in the
GLS database. This determines the default return address, as well as the billing.
You can also configure the tracking url that is used for each carrier.

For client integration tests you need to fill your credentials in the tests/common.py.

Usage
=====

Create the packages on GLS which returns a tracking ID.
If there is any kind of mistake (address, weight),
it is possible to cancel it as long as it has not been scanned yet.
If the package is not cancelled, it is invoiced even if it never ships.

When sending a picking, all products should be put in one or multiple packages.
These packages need to have a GLS packaging either Parcel, Express, or Freight.
These are already pre-configured in the module data.

The end of day report should be printed when the delivery takes place.
At the last resort, this function should be called at the end of the day.
If it had already run, it would have no impact.
In case the delivery is delayed, the report should simply be kept for the
next day, and provided with the next report if there is one.

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_carrier_label_gls%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
~~~~~~~

* Acsone
* Akretion

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

* David Beal @ Akretion
* Nans Lefebvre <nans.lefebvre@acsone.eu>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Hughes Damry <hughes.damry@acsone.eu>

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_carrier_label_gls>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions delivery_carrier_label_gls/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .hooks import post_init_hook
from . import models
from . import wizards
37 changes: 37 additions & 0 deletions delivery_carrier_label_gls/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# © 2015 David BEAL @ Akretion
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Delivery Carrier Label GLS",
"version": "14.0.1.0.0",
"author": "Acsone,Akretion,Odoo Community Association (OCA)",
"maintener": "Akretion",
"category": "Warehouse",
"summary": "GLS carrier label printing",
"depends": ["base_delivery_carrier_label", "delivery"],
"website": "https://github.com/OCA/delivery-carrier",
"data": [
"security/groups.xml",
"security/ir.model.access.csv",
"data/ir_cron.xml",
"data/product_product.xml",
"data/carrier_account.xml",
"data/delivery_carrier.xml",
"data/product_packaging.xml",
"views/res_config_settings.xml",
"views/delivery_carrier.xml",
"views/delivery_report_gls.xml",
"views/sale_order.xml",
"views/stock.xml",
"views/carrier_account.xml",
"wizards/delivery_report_gls_wizard.xml",
"report/report_delivery_report_gls.xml",
"report/delivery_report_gls_view.xml",
],
"license": "AGPL-3",
"installable": True,
"auto_install": False,
"application": False,
"post_init_hook": "post_init_hook",
}
17 changes: 17 additions & 0 deletions delivery_carrier_label_gls/data/carrier_account.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="carrier_account_gls" model="carrier.account">
<field name="name">GLS</field>
<field name="delivery_type">gls</field>
<field name="account">CHANGE ME</field>
<field name="password">CHANGE ME</field>
</record>
<record forcecreate="True" id="carrier_account_id_gls" model="ir.property">
<field name="name">carrier_account_id</field>
<field
name="fields_id"
search="[('model','=','delivery.carrier'),('name','=','carrier_account_id')]"
/>
<field name="value" eval="'carrier.account,'+str(ref('carrier_account_gls'))" />
</record>
</odoo>
24 changes: 24 additions & 0 deletions delivery_carrier_label_gls/data/delivery_carrier.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="delivery_carrier_gls" model="delivery.carrier">
<field name="name">GLS</field>
<field name="delivery_type">gls</field>
<field name="code">GLS</field>
<field name="product_id" ref="delivery_carrier_label_gls.product_product_gls" />
<field
name="carrier_account_id"
ref="delivery_carrier_label_gls.carrier_account_gls"
/>
<field name="gls_contact_id">CHANGE ME</field>
<field
name="gls_url"
>https://shipit-wbm-test01.gls-group.eu:8443/backend/rs/</field>
<field
name="gls_url_test"
>https://shipit-wbm-test01.gls-group.eu:8443/backend/rs/</field>
<field
name="gls_url_tracking"
>https://gls-group.eu/EU/en/parcel-tracking/match=%s</field>
<field name="gls_label_format">pdf</field>
</record>
</odoo>
18 changes: 18 additions & 0 deletions delivery_carrier_label_gls/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record forcecreate="True" id="cron_end_of_day_report" model="ir.cron">
<field name="name">GLS: End of Day Report</field>
<field name="active" eval="True" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
<field
name="model_id"
ref="delivery_carrier_label_gls.model_delivery_report_gls_wizard"
/>
<field name="code">model._cron_end_of_day_report()</field>
<field name="nextcall" eval="(DateTime.now()).strftime('%Y-%m-%d 23:00:01')" />
</record>
</odoo>
23 changes: 23 additions & 0 deletions delivery_carrier_label_gls/data/product_packaging.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="product_packaging_gls_parcel" model="product.packaging">
<field name="name">GLS: Parcel</field>
<field name="package_carrier_type">gls</field>
<field name="shipper_package_code">PARCEL</field>
<field name="max_weight">40</field>
</record>
<record id="product_packaging_gls_express" model="product.packaging">
<field name="name">GLS: Express</field>
<field name="package_carrier_type">gls</field>
<field name="shipper_package_code">EXPRESS</field>
<field name="max_weight">40</field>
</record>
<record id="product_packaging_gls_freight" model="product.packaging">
<field name="name">GLS: Freight</field>
<field name="package_carrier_type">gls</field>
<field name="shipper_package_code">FREIGHT</field>
<field name="max_weight">40</field>
</record>
</odoo>
16 changes: 16 additions & 0 deletions delivery_carrier_label_gls/data/product_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="product_product_gls" model="product.product">
<field name="default_code">SHIP_GLS</field>
<field name="type">service</field>
<field name="sale_ok" eval="False" />
<field name="name">Shipping cost - GLS</field>
<field
name="image_1920"
type="base64"
file="delivery_carrier_label_gls/static/img/gls.jpg"
/>
</record>
</odoo>
11 changes: 11 additions & 0 deletions delivery_carrier_label_gls/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
rcs = env["res.config.settings"].create({"company_id": env.company.id})
rcs.group_stock_tracking_lot = True
rcs.execute()
Loading
Loading