Skip to content

Commit

Permalink
[FIX] delivery: delivery_set returns a result
Browse files Browse the repository at this point in the history
The delivery_set() method has no return statement.
Calling this method through xmlrpc produce an error since None is not valid.

Closes odoo#1033
  • Loading branch information
Robin Lucbernet authored and beledouxdenis committed Jun 25, 2015
1 parent 384b60b commit 8ab6865
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/delivery/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def delivery_set(self, cr, uid, ids, context=None):
acc_fp_obj = self.pool.get('account.fiscal.position')
self._delivery_unset(cr, uid, ids, context=context)
currency_obj = self.pool.get('res.currency')
line_ids = []
for order in self.browse(cr, uid, ids, context=context):
grid_id = carrier_obj.grid_get(cr, uid, [order.carrier_id.id], order.partner_shipping_id.id)
if not grid_id:
Expand All @@ -84,7 +85,7 @@ def delivery_set(self, cr, uid, ids, context=None):
price_unit = currency_obj.compute(cr, uid, order.company_id.currency_id.id, order.pricelist_id.currency_id.id,
price_unit, context=dict(context or {}, date=order.date_order))
#create the sale order line
line_obj.create(cr, uid, {
line_id = line_obj.create(cr, uid, {
'order_id': order.id,
'name': grid.carrier_id.name,
'product_uom_qty': 1,
Expand All @@ -94,3 +95,5 @@ def delivery_set(self, cr, uid, ids, context=None):
'tax_id': [(6, 0, taxes_ids)],
'is_delivery': True
}, context=context)
line_ids.append(line_id)
return line_ids

0 comments on commit 8ab6865

Please sign in to comment.