[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:
committed by
Pierre Masereel
parent
912f6cb23d
commit
af91527929
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user