-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Closed
paradoxxxzero
wants to merge
15
commits into
OCA:14.0
from
akretion:14.0-mig-delivery_carrier_label_gls-hda
Closed
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
736b633
[MOV] move addons out of __unported__ (they remain not installable)
sbidoul f78a32d
[MIG] Rename manifest files
pedrobaeza e01132d
remove obsolete .pot files [ci skip]
sbidoul 99da2e4
[10.0][MIG][REF][IMP] delivery_carrier_label_gls: using the internati…
e08c945
[IMP] delivery_carrier_label_gls: black, isort, prettier
glitchov 6b25d12
[MIG] delivery_carrier_label_gls: Migration to 16.0
glitchov 91a69ed
[MIG][16.0] delivery_carrier_label_gls: add migration script
glitchov aadb71d
[IMP] delivery_carrier_label_gls : fr translation
glitchov b1035a4
[FIX] delivery_carrier_label_gls : uncomplete report definition
glitchov bb66790
[FIX] delivery_carrier_label_gls : typo in fr translation
glitchov 957c9ae
[IMP] delivery_carrier_label_gls : header info in report
glitchov f6066a4
[FIX] delivery_carrier_label_gls: bootstrap class text-right rplaced …
glitchov 94430fd
[IMP] delivery_carrier_label_gls: black, isort, prettier
paradoxxxzero 8b8b019
[MIG] delivery_carrier_label_gls: Migration to 14.0
paradoxxxzero e584b91
[FIX] delivery_carrier_label_gls: Fix wrong carrier tracking url
paradoxxxzero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[MIG][16.0] delivery_carrier_label_gls: add migration script
- Loading branch information
commit 91a69ed1c30269abd3af89e0ebdf11104479ef9e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,113 @@ | ||
TODO | ||
========================== | ||
Delivery Carrier Label GLS | ||
========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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/16.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-16-0/delivery-carrier-16-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/webui/builds.html?repo=OCA/delivery-carrier&target_branch=16.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 smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_carrier_label_gls%0Aversion:%2016.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/16.0/delivery_carrier_label_gls>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
45 changes: 45 additions & 0 deletions
45
delivery_carrier_label_gls/migrations/16.0.1.0.0/post-migrate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
import logging | ||
|
||
from openupgradelib import openupgrade | ||
|
||
from odoo.tools import sql | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
def _update_from_res_company_to_delivery_carrier(env): | ||
_logger.info("update from res_company to delivery_carrier") | ||
company_id = env.ref("base.main_company").id | ||
if sql.column_exists(env.cr, "res_company", "gls_contact_id"): | ||
# update value in delivery.carrier from res_company gls_contact_id | ||
env.cr.execute( | ||
f"""UPDATE delivery_carrier | ||
SET gls_contact_id = | ||
(SELECT gls_contact_id FROM res_company WHERE id={company_id}) | ||
WHERE delivery_type like 'gls'""" | ||
) | ||
# remove gls_contact_id from res_company | ||
env.cr.execute("ALTER TABLE res_company DROP COLUMN gls_contact_id") | ||
|
||
|
||
def _update_from_delivery_carrier_to_carrier_account(env): | ||
_logger.info("update value in carrier.account from delivery.carrier") | ||
for column in ("gls_login", "gls_password"): | ||
if sql.column_exists(env.cr, "delivery.carrier", column): | ||
# update column value in carrier_account | ||
env.cr.execute( | ||
f"""UPDATE carrier_account | ||
SET {column} = | ||
(SELECT {column} FROM delivery_carrier WHERE delivery_type like 'gls') | ||
WHERE delivery_type like 'gls'""" | ||
) | ||
# remove column from delivery.carrier | ||
env.cr.execute(f"ALTER TABLE delivery_carrier DROP COLUMN {column}") | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
_update_from_res_company_to_delivery_carrier(env) | ||
_update_from_delivery_carrier_to_carrier_account(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename version ? 16.0.1.0.0 => 14.0.0.0