[IMP] delivery: Hide generate return label

Now we hide the generate return label if this option is not available for the current carrier.
Before this fix, we could set the field to true even if the option was not available for this particular carrier.

Task-Id: 1956970

closes odoo/odoo#35178

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Robin Heinz
2019-08-09 15:31:26 +00:00
committed by Pierre Masereel
parent 912f6cb23d
commit af91527929
+1 -1
View File
@@ -71,7 +71,7 @@ class DeliveryCarrier(models.Model):
@api.depends('delivery_type')
def _compute_can_generate_return(self):
for carrier in self:
carrier.can_generate_return = hasattr(self, '%s_get_return_label' % carrier.delivery_type)
carrier.can_generate_return = False
def toggle_prod_environment(self):
for c in self: