Skip to content

Commit

Permalink
delivery_package_number: remove set_default_package workaround
Browse files Browse the repository at this point in the history
because it's not anymore in base_delivery_carrier_label
  • Loading branch information
hparfr committed Sep 23, 2024
1 parent ac08aaa commit 556fdaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ class StockBackorderConfirmation(models.TransientModel):
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
res = super(
StockBackorderConfirmation, self.with_context(set_default_package=False)
).process()
res = super().process()
if self.print_package_label:
report = (
self.pick_ids.picking_type_id.report_number_of_packages
Expand Down
5 changes: 1 addition & 4 deletions delivery_package_number/wizard/stock_inmediate_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ class StockImmediateTransfer(models.TransientModel):
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
res = super(
StockImmediateTransfer, self.with_context(set_default_package=False)
).process()
res = super().process()
if self.print_package_label:
report = (
self.pick_ids.picking_type_id.report_number_of_packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ class StockNumberPackageValidateWiz(models.TransientModel):
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
res = self.pick_ids.with_context(
set_default_package=False, bypass_set_number_of_packages=True
).button_validate()
res = self.pick_ids.button_validate()

Check warning on line 16 in delivery_package_number/wizard/stock_number_package_validate_wiz.py

View check run for this annotation

Codecov / codecov/patch

delivery_package_number/wizard/stock_number_package_validate_wiz.py#L16

Added line #L16 was not covered by tests
if self.print_package_label:
self._print_package_label()
return res
Expand Down

0 comments on commit 556fdaa

Please sign in to comment.