Skip to content

Commit

Permalink
[IMP] delivery_postlogistics: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bizzappdev committed Jan 20, 2025
1 parent aa463d1 commit 5293e95
Show file tree
Hide file tree
Showing 17 changed files with 152 additions and 132 deletions.
103 changes: 56 additions & 47 deletions delivery_postlogistics/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ PostLogistics Shipping - “Barcode” web service
: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_postlogistics
:target: https://github.com/OCA/delivery-carrier/tree/18.0/delivery_postlogistics
: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_postlogistics
:target: https://translation.odoo-community.org/projects/delivery-carrier-18-0/delivery-carrier-18-0-delivery_postlogistics
: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=16.0
: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 uses `PostLogistics BarCodes WebService`_ to generate labels
for your Delivery Orders.
This module uses `PostLogistics BarCodes
WebService <https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/sending-consignments-web-service-barcode>`__
to generate labels for your Delivery Orders.

It adds a `Create label` button on Delivery Orders.
A generated label will be an attachement of your Delivery Order.
It adds a Create label button on Delivery Orders. A generated label will
be an attachement of your Delivery Order.

To see it, please install documents module.

You can create multiple delivery method to match your diffent package types.

.. _PostLogistics BarCodes WebService: https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/sending-consignments-web-service-barcode
You can create multiple delivery method to match your diffent package
types.

**Table of contents**

Expand All @@ -48,78 +48,87 @@ You can create multiple delivery method to match your diffent package types.
Configuration
=============

.. important::
A "Swiss Post Business customer" account is required to use this module.
Important

See `Log in`_
A "Swiss Post Business customer" account is required to use this module.

See `Log in <https://account.post.ch/selfadmin/?login&lang=en>`__

To configure:

* Go to `Inventory -> Configuration -> Delivery -> Shipping Methods`
* Create new shipping methods for PostLogistics and set your login informations in the "PostLogistics" tab
* Go to `Inventory -> Configuration -> Delivery -> Delivery Packages` to create
the PostLogistics delivery packaging with the relevant `Package Code` (see section 8.10 of https://developer.post.ch/en/digital-commerce-api for available codes)

.. _Log in: https://account.post.ch/selfadmin/?login&lang=en
- Go to Inventory -> Configuration -> Delivery -> Shipping Methods
- Create new shipping methods for PostLogistics and set your login
informations in the "PostLogistics" tab
- Go to Inventory -> Configuration -> Delivery -> Delivery Packages to
create the PostLogistics delivery packaging with the relevant Package
Code (see section 8.10 of
https://developer.post.ch/en/digital-commerce-api for available
codes)

Technical references
~~~~~~~~~~~~~~~~~~~~
--------------------

`"Barcode" web service documentation`_

.. _"Barcode" web service documentation: https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/barcode-support
`"Barcode" web service
documentation <https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/barcode-support>`__

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

* Integration of price webservice :
https://www.post.ch/en/customer-center/all-online-services/preise-berechnen/info

* Not sure if the recursive patch of suds is still needed as there's no need
to use the integration WS anymore. However we still want to patch open to
get meaningful error messages.
- Integration of price webservice :
https://www.post.ch/en/customer-center/all-online-services/preise-berechnen/info
- Not sure if the recursive patch of suds is still needed as there's no
need to use the integration WS anymore. However we still want to
patch open to get meaningful error messages.

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_postlogistics%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/delivery-carrier/issues/new?body=module:%20delivery_postlogistics%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
~~~~~~~
-------

* Camptocamp

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

* Yannick Vaucher <[email protected]>
* Guewen Baconnier <[email protected]>
* Akim Juillerat <[email protected]>
* Julien Coux <[email protected]>
* Dung Tran <[email protected]>
* Phuc Tran <[email protected]>
* Jacques-Etienne Baudoux <[email protected]>
* `Trobz <https://trobz.com>`_:
* Jack Le <[email protected]>
------------

- Yannick Vaucher <[email protected]>

- Guewen Baconnier <[email protected]>

- Akim Juillerat <[email protected]>

- Julien Coux <[email protected]>

- Dung Tran <[email protected]>

- Phuc Tran <[email protected]>

- Jacques-Etienne Baudoux <[email protected]>

- `Trobz <https://trobz.com>`__:

- Jack Le <[email protected]>

Other credits
~~~~~~~~~~~~~
-------------

The development of this module in version 14.0 and its migration from 14.0 to 16.0 has been financially supported by:
The development of this module in version 14.0 and its migration from
14.0 to 16.0 has been financially supported by:

* Camptocamp
- Camptocamp

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -131,6 +140,6 @@ 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_postlogistics>`_ project on GitHub.
This module is part of the `OCA/delivery-carrier <https://github.com/OCA/delivery-carrier/tree/18.0/delivery_postlogistics>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 2 additions & 3 deletions delivery_postlogistics/postlogistics/web_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
}


class PostlogisticsWebService(object):

class PostlogisticsWebService:
"""Connector with PostLogistics for labels using post.ch API
Handbook available here:
Expand Down Expand Up @@ -294,7 +293,7 @@ def _get_itemid(self, picking, pack_no):

def _cash_on_delivery(self, picking, package=None):
amount = (package or picking).postlogistics_cod_amount()
amount = "{:.2f}".format(amount)
amount = f"{amount:.2f}"
return [{"Type": "NN_BETRAG", "Value": amount}]

def _get_item_additional_data(self, picking, package=None):
Expand Down
3 changes: 3 additions & 0 deletions delivery_postlogistics/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
21 changes: 21 additions & 0 deletions delivery_postlogistics/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Important

A "Swiss Post Business customer" account is required to use this module.

See [Log in](https://account.post.ch/selfadmin/?login&lang=en)

To configure:

- Go to Inventory -\> Configuration -\> Delivery -\> Shipping Methods
- Create new shipping methods for PostLogistics and set your login
informations in the "PostLogistics" tab
- Go to Inventory -\> Configuration -\> Delivery -\> Delivery Packages
to create the PostLogistics delivery packaging with the relevant
Package Code (see section 8.10 of
<https://developer.post.ch/en/digital-commerce-api> for available
codes)

## Technical references

["Barcode" web service
documentation](https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/barcode-support)
21 changes: 0 additions & 21 deletions delivery_postlogistics/readme/CONFIGURE.rst

This file was deleted.

16 changes: 16 additions & 0 deletions delivery_postlogistics/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- Yannick Vaucher \<<[email protected]>\>

- Guewen Baconnier \<<[email protected]>\>

- Akim Juillerat \<<[email protected]>\>

- Julien Coux \<<[email protected]>\>

- Dung Tran \<<[email protected]>\>

- Phuc Tran \<<[email protected]>\>

- Jacques-Etienne Baudoux \<<[email protected]>\>

- [Trobz](https://trobz.com):
- Jack Le \<<[email protected]>\>
9 changes: 0 additions & 9 deletions delivery_postlogistics/readme/CONTRIBUTORS.rst

This file was deleted.

4 changes: 4 additions & 0 deletions delivery_postlogistics/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The development of this module in version 14.0 and its migration from
14.0 to 16.0 has been financially supported by:

- Camptocamp
3 changes: 0 additions & 3 deletions delivery_postlogistics/readme/CREDITS.rst

This file was deleted.

11 changes: 11 additions & 0 deletions delivery_postlogistics/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This module uses [PostLogistics BarCodes
WebService](https://www.post.ch/en/business/a-z-of-subjects/dropping-off-mail-items/business-sending-letters/sending-consignments-web-service-barcode)
to generate labels for your Delivery Orders.

It adds a Create label button on Delivery Orders. A generated label will
be an attachement of your Delivery Order.

To see it, please install documents module.

You can create multiple delivery method to match your diffent package
types.
11 changes: 0 additions & 11 deletions delivery_postlogistics/readme/DESCRIPTION.rst

This file was deleted.

5 changes: 5 additions & 0 deletions delivery_postlogistics/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Integration of price webservice :
<https://www.post.ch/en/customer-center/all-online-services/preise-berechnen/info>
- Not sure if the recursive patch of suds is still needed as there's no
need to use the integration WS anymore. However we still want to patch
open to get meaningful error messages.
6 changes: 0 additions & 6 deletions delivery_postlogistics/readme/ROADMAP.rst

This file was deleted.

Loading

0 comments on commit 5293e95

Please sign in to comment.