Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1abdeaa

Browse files
mt-software-deferran-S73
authored andcommittedApr 18, 2023
[FIX] delivery_schenker: fix missing dependency, before there was no volume field for stock.picking
1 parent 376ab16 commit 1abdeaa

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed
 

‎delivery_schenker/README.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Delivery Schenker
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
2020
:target: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_schenker
2121
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/99/14.0
24-
:alt: Try me on Runbot
22+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
23+
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/delivery-carrier&target_branch=14.0
24+
:alt: Try me on Runboat
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

@@ -157,6 +157,8 @@ Contributors
157157

158158
* Ethan Hildick
159159

160+
* Michael Tietz (MT Software) <mtietz@mt-software.de>
161+
160162
Maintainers
161163
~~~~~~~~~~~
162164

‎delivery_schenker/models/delivery_carrier.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ def _schenker_shipping_information(self, picking):
367367
}
368368
]
369369

370-
def _schenker_measures(self, picking):
370+
def _schenker_measures(self, picking, vals):
371371
"""Only volume is supported as a pallet calculations structure should be
372372
provided to use the other API options. This hook can be used to communicate
373373
with the API in the future
374374
:param picking record with picking to deliver
375375
:returns dict values for the proper unit key and value
376376
"""
377377
if self.schenker_measure_unit == "VOLUME":
378-
return {"measureUnitVolume": round(picking.volume, 2) or 0.01}
378+
return {"measureUnitVolume": vals["shippingInformation"]["volume"]}
379379
return {}
380380

381381
def _prepare_schenker_shipping(self, picking):
@@ -389,6 +389,7 @@ def _prepare_schenker_shipping(self, picking):
389389
# account to acomplish a properly formed request.
390390
vals = {}
391391
vals.update(self._prepare_schenker_barcode())
392+
shipping_information = self._schenker_shipping_information(picking)
392393
vals.update(
393394
{
394395
"address": self._schenker_shipping_address(picking),
@@ -401,9 +402,9 @@ def _prepare_schenker_shipping(self, picking):
401402
"measurementType": self._schenker_metric_system(),
402403
"grossWeight": round(picking.shipping_weight, 2),
403404
"shippingInformation": {
404-
"shipmentPosition": self._schenker_shipping_information(picking),
405+
"shipmentPosition": shipping_information,
405406
"grossWeight": round(picking.shipping_weight, 2),
406-
"volume": round(picking.volume, 2) or 0.01,
407+
"volume": shipping_information["volume"],
407408
},
408409
"measureUnit": self.schenker_measure_unit,
409410
# Customs Clearance not supported for now as it needs a full customs
@@ -426,7 +427,7 @@ def _prepare_schenker_shipping(self, picking):
426427
"pharmaceuticals": self.schenker_pharmaceuticals,
427428
}
428429
)
429-
vals.update(self._schenker_measures(picking))
430+
vals.update(self._schenker_measures(picking, vals))
430431
return vals
431432

432433
def schenker_send_shipping(self, pickings):

‎delivery_schenker/readme/CONTRIBUTORS.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
* `Studio73 <https://www.studio73.es>`_:
66

77
* Ethan Hildick
8+
* Michael Tietz (MT Software) <mtietz@mt-software.de>

‎delivery_schenker/static/description/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
77
<title>Delivery Schenker</title>
88
<style type="text/css">
99

@@ -367,7 +367,7 @@ <h1 class="title">Delivery Schenker</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/14.0/delivery_schenker"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_schenker"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/99/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/delivery-carrier/tree/14.0/delivery_schenker"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_schenker"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/delivery-carrier&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371371
<p>This module links the <a class="reference external" href="https://www.dbschenker.com">DB Schenker</a> booking and tracking
372372
APIs with Odoo delivery system.</p>
373373
<p><strong>Table of contents</strong></p>
@@ -516,6 +516,7 @@ <h2><a class="toc-backref" href="#id13">Contributors</a></h2>
516516
<li>Ethan Hildick</li>
517517
</ul>
518518
</li>
519+
<li>Michael Tietz (MT Software) &lt;<a class="reference external" href="mailto:mtietz&#64;mt-software.de">mtietz&#64;mt-software.de</a>&gt;</li>
519520
</ul>
520521
</div>
521522
<div class="section" id="maintainers">

0 commit comments

Comments
 (0)
Please sign in to comment.