Skip to content

Commit

Permalink
Don't Merge
Browse files Browse the repository at this point in the history
PR: OCA#786

[FIX] Unittests base_delivery_carrier_label: Separate github test run

For dependents addons
  • Loading branch information
mt-software-de committed Mar 18, 2024
1 parent 1ec5420 commit 079aaf5
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,18 @@ jobs:
include:
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
name: test with Odoo
exclude: "base_delivery_carrier_label,delivery_carrier_label_batch,delivery_roulier,delivery_roulier_option,delivery_roulier_laposte_fr,delivery_roulier_chronopost_fr,carrier_account_environment"
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
name: test with OCB
makepot: "true"
exclude: "base_delivery_carrier_label,delivery_carrier_label_batch,delivery_roulier,delivery_roulier_option,delivery_roulier_laposte_fr,delivery_roulier_chronopost_fr,carrier_account_environment"
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
name: test with Odoo
include: "base_delivery_carrier_label,delivery_carrier_label_batch,delivery_roulier,delivery_roulier_option,delivery_roulier_laposte_fr,delivery_roulier_chronopost_fr,carrier_account_environment"
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
name: test with OCB
makepot: "true"
include: "base_delivery_carrier_label,delivery_carrier_label_batch,delivery_roulier,delivery_roulier_option,delivery_roulier_laposte_fr,delivery_roulier_chronopost_fr,carrier_account_environment"
services:
postgres:
image: postgres:9.6
Expand All @@ -49,6 +58,9 @@ jobs:
POSTGRES_DB: odoo
ports:
- 5432:5432
env:
INCLUDE: "${{ matrix.include }}"
EXCLUDE: "${{ matrix.exclude }}"
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion delivery_cttexpress/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Delivery CTT Express
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:efe5b3f4a10b36fe4716430005bf493c7dff939003e6298cdd8839f2a9f5687d
!! source digest: sha256:99cdf17bfe832d52ac72ec2c8b8f2b3a96b0b1a518fce0c0b1d3725c424311fd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -132,6 +132,8 @@ Contributors

* David Vidal

* Michael Tietz (MT Software) <[email protected]>

Other credits
~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion delivery_cttexpress/models/delivery_carrier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2022 Tecnativa - David Vidal
# Copyright 2024 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo.exceptions import UserError
Expand Down Expand Up @@ -168,7 +169,7 @@ def _prepare_cttexpress_shipping(self, picking):
return {
"ClientReference": reference, # Optional
"ClientDepartmentCode": None, # Optional (no core field matches)
"ItemsCount": picking.number_of_packages,
"ItemsCount": picking.number_of_packages or 1,
"IsClientPodScanRequired": None, # Optional
"RecipientAddress": recipient.street,
"RecipientCountry": recipient.country_id.code,
Expand Down
2 changes: 2 additions & 0 deletions delivery_cttexpress/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* David Vidal

* Michael Tietz (MT Software) <[email protected]>
3 changes: 2 additions & 1 deletion delivery_cttexpress/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Delivery CTT Express</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:efe5b3f4a10b36fe4716430005bf493c7dff939003e6298cdd8839f2a9f5687d
!! source digest: sha256:99cdf17bfe832d52ac72ec2c8b8f2b3a96b0b1a518fce0c0b1d3725c424311fd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/delivery-carrier/tree/14.0/delivery_cttexpress"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_cttexpress"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?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>
<p>CTT Express Iberic Web Services API intration with Odoo. Valid for Portugal and Spain.</p>
Expand Down Expand Up @@ -479,6 +479,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<li>David Vidal</li>
</ul>
</li>
<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>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
3 changes: 2 additions & 1 deletion delivery_package_fee/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Delivery Package Fees
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1bd03bdc59edfe4e2046329326afe107e8738bee72bd01862cae29fadd798647
!! source digest: sha256:2a7faf7ca4a955b3296dc72b61d0a72871437d1a453ce7677128fb30aaef8335
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -79,6 +79,7 @@ Contributors
~~~~~~~~~~~~

* Guewen Baconnier <[email protected]>
* Michael Tietz (MT Software) <[email protected]>

Maintainers
~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions delivery_package_fee/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Guewen Baconnier <[email protected]>
* Michael Tietz (MT Software) <[email protected]>
3 changes: 2 additions & 1 deletion delivery_package_fee/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Delivery Package Fees</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1bd03bdc59edfe4e2046329326afe107e8738bee72bd01862cae29fadd798647
!! source digest: sha256:2a7faf7ca4a955b3296dc72b61d0a72871437d1a453ce7677128fb30aaef8335
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/delivery-carrier/tree/14.0/delivery_package_fee"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_package_fee"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?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>
<p>Add delivery fees on Sales Orders based on the delivered packages.</p>
Expand Down Expand Up @@ -424,6 +424,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<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>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
3 changes: 2 additions & 1 deletion delivery_package_fee/tests/test_package_fee.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2020 Camptocamp
# Copyright 2024 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.tests.common import Form, SavepointCase
Expand Down Expand Up @@ -322,7 +323,7 @@ def test_package_no_package(self):
self.assertEqual(picking.state, "assigned")
picking.move_line_ids[0].qty_done = 10.0
picking.move_line_ids[1].qty_done = 10.0
picking.with_context(set_default_package=False)._action_done()
picking._action_done()
self.assertEqual(picking.state, "done")

self.assertRecordValues(
Expand Down
4 changes: 3 additions & 1 deletion delivery_package_number/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Picking Package Number
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3ed5adf0029e78322866727bc33ad34c20aeca25abb3ddf4604e85cd60d13d8c
!! source digest: sha256:ff9990b646408ab222fbcb027456d78cccc6319f52302959c9e7cae8965931fc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -89,6 +89,8 @@ Contributors

* Ángel García de la Chica Herrera <[email protected]>

* Michael Tietz (MT Software) <[email protected]>

Maintainers
~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions delivery_package_number/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
* `Sygel <https://www.sygel.es>`_:

* Ángel García de la Chica Herrera <[email protected]>

* Michael Tietz (MT Software) <[email protected]>
5 changes: 4 additions & 1 deletion delivery_package_number/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Stock Picking Package Number</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3ed5adf0029e78322866727bc33ad34c20aeca25abb3ddf4604e85cd60d13d8c
!! source digest: sha256:ff9990b646408ab222fbcb027456d78cccc6319f52302959c9e7cae8965931fc
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/delivery-carrier/tree/14.0/delivery_package_number"><img alt="OCA/delivery-carrier" src="https://img.shields.io/badge/github-OCA%2Fdelivery--carrier-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_package_number"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?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>
<p>This module recovers the number of packages field that was present in previous
Expand Down Expand Up @@ -440,6 +440,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
</ul>
</blockquote>
</blockquote>
<ul class="simple">
<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>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2023 Ángel García de la Chica Herrera <[email protected]>
# Copyright 2024 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
Expand All @@ -24,7 +25,4 @@ def _compute_ask_number_of_packages(self):
def process(self):
if self.number_of_packages:
self.pick_ids.write({"number_of_packages": self.number_of_packages})
# put context key for avoiding `base_delivery_carrier_label` auto-packaging feature
return super(
StockBackorderConfirmation, self.with_context(set_default_package=False)
).process()
return super().process()
6 changes: 2 additions & 4 deletions delivery_package_number/wizard/stock_inmediate_transfer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2020 Tecnativa - David Vidal
# Copyright 2024 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models

Expand All @@ -23,7 +24,4 @@ def _compute_ask_number_of_packages(self):
def process(self):
if self.number_of_packages:
self.pick_ids.write({"number_of_packages": self.number_of_packages})
# put context key for avoiding `base_delivery_carrier_label` auto-packaging feature
return super(
StockImmediateTransfer, self.with_context(set_default_package=False)
).process()
return super().process()
2 changes: 1 addition & 1 deletion delivery_schenker/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Delivery Schenker
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d4bb07ec262f28ebf12722c6b529cee813a3022a5f73e4010970171abe752de3
!! source digest: sha256:4f0a596c6bac6914af4ecc42714c6f39e446a09b4404bca36651af0fd55792ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion delivery_schenker/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["delivery_package_number", "delivery_state"],
"depends": ["delivery_state"],
"external_dependencies": {"python": ["zeep"]},
"data": [
"views/delivery_schenker_view.xml",
Expand Down
19 changes: 11 additions & 8 deletions delivery_schenker/models/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _schenker_shipping_information_with_packages(self, picking):
for package in picking.package_ids
]

def _schenker_shipping_information_without_packages_volume(self, picking):
def _schenker_shipping_information_without_packages_volume(self, move_lines):
# Obviously products should be well configured. This parameter is mandatory.
return sum(
[
Expand All @@ -414,13 +414,16 @@ def _schenker_shipping_information_without_packages_volume(self, picking):
ml.qty_done, ml.product_id.uom_id
),
)
for ml in picking.move_line_ids
for ml in move_lines
if not ml.result_package_id
]
)

def _schenker_shipping_information_without_packages(self, picking):
if all(move_line.result_package_id for move_line in picking.move_line_ids):
move_lines_without_package = picking.move_line_ids.filtered(
lambda ml: not ml.result_package_id
)
if not move_lines_without_package:
return []
weight = picking.shipping_weight or picking.weight
return [
Expand All @@ -429,15 +432,15 @@ def _schenker_shipping_information_without_packages(self, picking):
"dgr": False,
"cargoDesc": picking.name,
# For a more complex solution use packaging properly
"grossWeight": self._schenker_shipping_information_round_weight(
weight / picking.number_of_packages
),
"grossWeight": self._schenker_shipping_information_round_weight(weight),
"volume": self._schenker_shipping_information_round_volume(
self._schenker_shipping_information_without_packages_volume(picking)
self._schenker_shipping_information_without_packages_volume(
move_lines_without_package
)
),
"packageType": self.schenker_default_packaging_id.shipper_package_code,
"stackable": self.schenker_default_packaging_id.schenker_stackable,
"pieces": picking.number_of_packages,
"pieces": 1,
}
]

Expand Down
2 changes: 1 addition & 1 deletion delivery_schenker/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Delivery Schenker</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d4bb07ec262f28ebf12722c6b529cee813a3022a5f73e4010970171abe752de3
!! source digest: sha256:4f0a596c6bac6914af4ecc42714c6f39e446a09b4404bca36651af0fd55792ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" 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 image-reference" 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 image-reference" href="https://runboat.odoo-community.org/builds?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>
<p>This module links the <a class="reference external" href="https://www.dbschenker.com">DB Schenker</a> booking and tracking
Expand Down

0 comments on commit 079aaf5

Please sign in to comment.