V6.02 . Hardcoded stock name location in mrp_repair

Bug #831543 reported by Corinne Cobbel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

Hi,

It seems there are some hardcode regarding stock name location in mrp_repair module.

Rename the physical stock name for example : "Stock warehouse 1"
Create an order repair
Chose the product, Lot # etc..
Create a line, chose "add" or "remove" and the following error message appears :

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/mrp_repair/mrp_repair.py", line 711, in onchange_operation_type
    stock_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Stock')])[0]
IndexError: list index out of range

Same thing if there is a change in the virtual production location name
Rename the virtual production stock name for example : "Repair"
Create an order repair
Chose the product, Lot # etc..
Create a line, chose "add" or "remove" and the following error message appears :

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/addons/mrp_repair/mrp_repair.py", line 702, in onchange_operation_type
    product_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0]
IndexError: list index out of range

Thanks

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Atik Agewan(OpenERP) (aag-openerp) wrote :

Hello Corinne,

Thanks for reporting,
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-831543-aag
Revision ID: <email address hidden>
Revision num: 4945.
It will be available in trunk soon,

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
qdp (OpenERP) (qdp) wrote :

final fix landed in trunk in revision 5465

thanks for the contribution,
Quentin

Changed in openobject-addons:
status: Fix Committed → 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.