[FIX] delivery: No option of delivery packaging when "Based on Rules"

Issue

	- Ensure that the provider of "The Poste" delivery method is "Based on Rules".
	- Create a quotation with "The Poste" as shipping method.
	- Confirm, then click on "Delivery" stat button.
	- Click on "Put in Pack" and create a "Delivery Packaging".
	- Save, go back to quotation and duplicate it.
	- Confirm, then click on "Delivery" stat button.
	- Click on "Put in Pack".

	The "Delivery Packaging" created previously is not available.

Solution

	If 'current_package_carrier_type' is equal to 'fixed' or 'base_on_rule',
	replace it by 'none' since there are the equivalents in
	'package_carrier_type' for 'delivery_type'.

Related fix : https://github.com/odoo/odoo/pull/37427

opw-2310258

closes odoo/odoo#57444

X-original-commit: 5898d31025eacad3e8c37f7a105e20c81831ed17
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
Nasreddin (bon)
2020-09-10 14:50:10 +00:00
parent 2b3c6a2d7f
commit 4d902b9d35
+3 -3
View File
@@ -148,11 +148,11 @@ class StockPicking(models.Model):
current_package_carrier_type=self.carrier_id.delivery_type,
default_picking_id=self.id
)
# As we pass the `delivery_type` ('fixed' by default) in a key who correspond
# to the `package_carrier_type` ('none' to default), we make a conversion.
# As we pass the `delivery_type` ('fixed' or 'base_on_rule' by default) in a key who
# correspond to the `package_carrier_type` ('none' to default), we make a conversion.
# No need conversion for other carriers as the `delivery_type` and
#`package_carrier_type` will be the same in these cases.
if context['current_package_carrier_type'] == 'fixed':
if context['current_package_carrier_type'] in ['fixed', 'base_on_rule']:
context['current_package_carrier_type'] = 'none'
return {
'name': _('Package Details'),