delivery: global name 'except_osv' is not defined if a carrier has no valid grid defined

Bug #307319 reported by Raphaël Valyi - http://www.akretion.com
2
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

Instead of jsut displaying the proper error message, it when trying to add a delivery cost through the wirzard in a quotation, if the carrier has no grid list defined, we get this ugly stack:

  File "/home/rvalyi/DEV/openobject_trunk/openobject-server/bin/netsvc.py", line 387, in run
    r = m(*msg[2:])
  File "/home/rvalyi/DEV/openobject_trunk/openobject-server/bin/service/web_services.py", line 422, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/home/rvalyi/DEV/openobject_trunk/openobject-server/bin/service/web_services.py", line 402, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/home/rvalyi/DEV/openobject_trunk/openobject-server/bin/wizard/__init__.py", line 170, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/home/rvalyi/DEV/openobject_trunk/openobject-server/bin/wizard/__init__.py", line 73, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/home/rvalyi/DEV/openobject_trunk/openobject-addons/delivery/wizard/delivery_sale_order.py", line 76, in _delivery_set
    'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context),
  File "/home/rvalyi/DEV/openobject_trunk/openobject-addons/delivery/delivery.py", line 108, in get_price
    return self.get_price_from_picking(cr, uid, id, total,weight, volume, context)
  File "/home/rvalyi/DEV/openobject_trunk/openobject-addons/delivery/delivery.py", line 127, in get_price_from_picking
    raise except_osv(_('No price avaible !'), _('No line matched this order in the choosed delivery grids !'))
NameError: global name 'except_osv' is not defined

The fix should be simple: just replace that deprecated except_osv API call! Then it will be more obvious for the users why the delievry cost can't be added unless he defines a grid.

Raphaël Valyi

Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.