diff --git a/delivery_postlogistics/README.rst b/delivery_postlogistics/README.rst index bb5e57afe7..e137dcefd5 100644 --- a/delivery_postlogistics/README.rst +++ b/delivery_postlogistics/README.rst @@ -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 `__ +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** @@ -48,37 +48,37 @@ 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 `__ 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 `__ 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 =========== @@ -86,7 +86,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -94,32 +94,41 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp Contributors -~~~~~~~~~~~~ - -* Yannick Vaucher -* Guewen Baconnier -* Akim Juillerat -* Julien Coux -* Dung Tran -* Phuc Tran -* Jacques-Etienne Baudoux -* `Trobz `_: - * Jack Le +------------ + +- Yannick Vaucher + +- Guewen Baconnier + +- Akim Juillerat + +- Julien Coux + +- Dung Tran + +- Phuc Tran + +- Jacques-Etienne Baudoux + +- `Trobz `__: + + - Jack Le 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. @@ -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 `_ project on GitHub. +This module is part of the `OCA/delivery-carrier `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/delivery_postlogistics/postlogistics/web_service.py b/delivery_postlogistics/postlogistics/web_service.py index b2248089c5..d43c53fe00 100644 --- a/delivery_postlogistics/postlogistics/web_service.py +++ b/delivery_postlogistics/postlogistics/web_service.py @@ -34,8 +34,7 @@ } -class PostlogisticsWebService(object): - +class PostlogisticsWebService: """Connector with PostLogistics for labels using post.ch API Handbook available here: @@ -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): diff --git a/delivery_postlogistics/pyproject.toml b/delivery_postlogistics/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/delivery_postlogistics/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/delivery_postlogistics/readme/CONFIGURE.md b/delivery_postlogistics/readme/CONFIGURE.md new file mode 100644 index 0000000000..ae3afb416f --- /dev/null +++ b/delivery_postlogistics/readme/CONFIGURE.md @@ -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 + 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) diff --git a/delivery_postlogistics/readme/CONFIGURE.rst b/delivery_postlogistics/readme/CONFIGURE.rst deleted file mode 100644 index 42c7392d17..0000000000 --- a/delivery_postlogistics/readme/CONFIGURE.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. important:: - A "Swiss Post Business customer" account is required to use this module. - - See `Log in`_ - - -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 - -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 diff --git a/delivery_postlogistics/readme/CONTRIBUTORS.md b/delivery_postlogistics/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..f0c7fdfb40 --- /dev/null +++ b/delivery_postlogistics/readme/CONTRIBUTORS.md @@ -0,0 +1,16 @@ +- Yannick Vaucher \<\> + +- Guewen Baconnier \<\> + +- Akim Juillerat \<\> + +- Julien Coux \<\> + +- Dung Tran \<\> + +- Phuc Tran \<\> + +- Jacques-Etienne Baudoux \<\> + +- [Trobz](https://trobz.com): + - Jack Le \<\> diff --git a/delivery_postlogistics/readme/CONTRIBUTORS.rst b/delivery_postlogistics/readme/CONTRIBUTORS.rst deleted file mode 100644 index b67e927ba8..0000000000 --- a/delivery_postlogistics/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,9 +0,0 @@ -* Yannick Vaucher -* Guewen Baconnier -* Akim Juillerat -* Julien Coux -* Dung Tran -* Phuc Tran -* Jacques-Etienne Baudoux -* `Trobz `_: - * Jack Le diff --git a/delivery_postlogistics/readme/CREDITS.md b/delivery_postlogistics/readme/CREDITS.md new file mode 100644 index 0000000000..06c78caaae --- /dev/null +++ b/delivery_postlogistics/readme/CREDITS.md @@ -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 diff --git a/delivery_postlogistics/readme/CREDITS.rst b/delivery_postlogistics/readme/CREDITS.rst deleted file mode 100644 index de0b96b24f..0000000000 --- a/delivery_postlogistics/readme/CREDITS.rst +++ /dev/null @@ -1,3 +0,0 @@ -The development of this module in version 14.0 and its migration from 14.0 to 16.0 has been financially supported by: - -* Camptocamp diff --git a/delivery_postlogistics/readme/DESCRIPTION.md b/delivery_postlogistics/readme/DESCRIPTION.md new file mode 100644 index 0000000000..bd11941b32 --- /dev/null +++ b/delivery_postlogistics/readme/DESCRIPTION.md @@ -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. diff --git a/delivery_postlogistics/readme/DESCRIPTION.rst b/delivery_postlogistics/readme/DESCRIPTION.rst deleted file mode 100644 index 8158eeb665..0000000000 --- a/delivery_postlogistics/readme/DESCRIPTION.rst +++ /dev/null @@ -1,11 +0,0 @@ -This module uses `PostLogistics BarCodes WebService`_ 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. - -.. _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 diff --git a/delivery_postlogistics/readme/ROADMAP.md b/delivery_postlogistics/readme/ROADMAP.md new file mode 100644 index 0000000000..430aab3c06 --- /dev/null +++ b/delivery_postlogistics/readme/ROADMAP.md @@ -0,0 +1,5 @@ +- Integration of price webservice : + +- 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. diff --git a/delivery_postlogistics/readme/ROADMAP.rst b/delivery_postlogistics/readme/ROADMAP.rst deleted file mode 100644 index 6780fcb5cf..0000000000 --- a/delivery_postlogistics/readme/ROADMAP.rst +++ /dev/null @@ -1,6 +0,0 @@ -* 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. diff --git a/delivery_postlogistics/static/description/index.html b/delivery_postlogistics/static/description/index.html index 84607f7d2c..ae1e7b2886 100644 --- a/delivery_postlogistics/static/description/index.html +++ b/delivery_postlogistics/static/description/index.html @@ -369,13 +369,15 @@

PostLogistics Shipping - “Barcode” web service

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:9d078ad6b2092c6e36929b761e1500a8605156e02fadc930202cbe8da8831445 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runboat

-

This module uses PostLogistics BarCodes WebService 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.

+

Beta License: AGPL-3 OCA/delivery-carrier Translate me on Weblate Try me on Runboat

+

This module uses PostLogistics BarCodes +WebService +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.

+

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

Table of contents

    @@ -396,21 +398,24 @@

    PostLogistics Shipping - “Barcode” web service

Configuration

-
-

Important

+

Important

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

-

See Log in

-
+

See Log in

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)
  • +
  • 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)
@@ -418,9 +423,9 @@

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.
  • +
  • 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.
@@ -428,7 +433,7 @@

Bug Tracker

Bugs are tracked on GitHub 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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -449,19 +454,16 @@

Contributors

  • Dung Tran <dungtd@trobz.com>
  • Phuc Tran <phuc@trobz.com>
  • Jacques-Etienne Baudoux <je@bcim.be>
  • -
  • -
    Trobz:
    -
    -
  • 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
    @@ -475,7 +477,7 @@

    Maintainers

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

    +

    This module is part of the OCA/delivery-carrier project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/delivery_postlogistics/tests/test_postlogistics.py b/delivery_postlogistics/tests/test_postlogistics.py index 786e6b9ad5..521d72c2fd 100644 --- a/delivery_postlogistics/tests/test_postlogistics.py +++ b/delivery_postlogistics/tests/test_postlogistics.py @@ -47,7 +47,7 @@ def test_store_label(self): self.assertEqual(len(cassette.requests), 2) ref = "996001321700005959" self.assertEqual(res[0]["file_type"], "pdf") - self.assertEqual(res[0]["name"], "{}.pdf".format(ref)) + self.assertEqual(res[0]["name"], f"{ref}.pdf") self.assertEqual(res[0]["file"][:30], b"JVBERi0xLjQKJeLjz9MKMiAwIG9iag") self.assertEqual(self.picking.carrier_tracking_ref, ref) @@ -64,7 +64,7 @@ def test_store_label_postlogistics_tracking_format_picking_num(self): self.assertEqual(len(cassette.requests), 2) ref = "996001321700005959" self.assertEqual(res[0]["file_type"], "pdf") - self.assertEqual(res[0]["name"], "{}.pdf".format(ref)) + self.assertEqual(res[0]["name"], f"{ref}.pdf") self.assertEqual(res[0]["file"][:30], b"JVBERi0xLjQKJeLjz9MKMiAwIG9iag") self.assertEqual(self.picking.carrier_tracking_ref, ref) diff --git a/delivery_postlogistics/views/stock.xml b/delivery_postlogistics/views/stock.xml index b9e458b0ef..911dac27d8 100644 --- a/delivery_postlogistics/views/stock.xml +++ b/delivery_postlogistics/views/stock.xml @@ -17,7 +17,7 @@ diff --git a/delivery_postlogistics/views/stock_package_type_view.xml b/delivery_postlogistics/views/stock_package_type_view.xml index fd5e1e3aab..fae00e02e3 100644 --- a/delivery_postlogistics/views/stock_package_type_view.xml +++ b/delivery_postlogistics/views/stock_package_type_view.xml @@ -17,9 +17,9 @@ colspan="2" attrs="{'invisible': [('package_carrier_type', '!=', 'postlogistics')]}" >See section 8.10 of the documentation for available codes. + target="new" + href="https://developer.post.ch/en/digital-commerce-api" + >the documentation for available codes.