Skip to content

Commit dbe2017

Browse files
committed
[IMP] delivery_carrier_package_measure_required: dimension control exceptions
greater granularity is implemented to control possible dimension control exceptions.
1 parent 9d544d6 commit dbe2017

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

delivery_carrier_package_measure_required/models/stock_quant_package.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ class StockQuantPackage(models.Model):
1818
@api.constrains("pack_length", "width", "height", "shipping_weight", "quant_ids")
1919
def _check_required_dimension(self):
2020
ignore_pack_content = self.env.context.get(
21-
"delivery_pkg_measure__ignore_package_content"
21+
"delivery_pkg_measure__ignore_package_content", False
22+
)
23+
force_validation = self.env.context.get(
24+
"delivery_pkg_measure__force_validation_package", False
2225
)
2326
for package in self:
24-
if not ignore_pack_content and not package.quant_ids:
27+
if ignore_pack_content or (not force_validation and not package.quant_ids):
2528
# Only validate a package when it contains goods
2629
continue
2730
required_dimension = []

0 commit comments

Comments
 (0)