Skip to content
Snippets Groups Projects
Commit 9bf52959 authored by Pierre Masereel's avatar Pierre Masereel
Browse files

[FIX] delivery: return label compute field incomplete


Since new ORM in Odoo, the compute methods should always return values.

In the case of return label in delivery, nothing was returned when there
was no carrier on picking.

So we are now setting the field to False when there are no carrier on
picking.

ISSUE-43270

closes odoo/odoo#43386

Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
parent e5387054
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,8 @@ class StockPicking(models.Model):
for picking in self:
if picking.carrier_id:
picking.return_label_ids = self.env['ir.attachment'].search([('res_model', '=', 'stock.picking'), ('res_id', '=', picking.id), ('name', 'like', '%s%%' % picking.carrier_id.get_return_label_prefix())])
else:
picking.return_label_ids = False
@api.depends('move_lines')
def _cal_weight(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment