← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 722672] Re: "Import inventory" errors when inventory is unsaved

 

Hi Azazahmed,

After filling in a name for the inventory, you saved it.  The bug
happens when you do not save the Inventory before performing the action.
I'll modify the description to make this more obvious.


Thanks.

** Description changed:

  Steps to reproduce:
-   1) Navigate to Warehouse > Inventory Control > Physical Inventories and create a new Inventory.
-   2) Click on "Import inventory".
-   3) Fill in a stock location, and click Fill Inventory.
+   1) Navigate to Warehouse > Inventory Control > Physical Inventories and open the new Inventory screen.
+   2) Do not save the Inventory.
+   3) Click on "Import inventory".
+   4) Fill in a stock location, and click Fill Inventory.
  
  Expected behaviour:
-   A filled inventory.
+   A filled inventory.
  
  Actual behaviour:
  
  Traceback (most recent call last):
-   File "/usr/share/openerp-server/netsvc.py", line 489, in dispatch
-     result = ExportService.getService(service_name).dispatch(method, auth, params)
-   File "/usr/share/openerp-server/service/web_services.py", line 599, in dispatch
-     res = fn(db, uid, *params)
-   File "/usr/share/openerp-server/osv/osv.py", line 122, in wrapper
-     return f(self, dbname, *args, **kwargs)
-   File "/usr/share/openerp-server/osv/osv.py", line 176, in execute
-     res = self.execute_cr(cr, uid, obj, method, *args, **kw)
-   File "/usr/share/openerp-server/osv/osv.py", line 167, in execute_cr
-     return getattr(object, method)(cr, uid, *args, **kw)
-   File "/usr/local/openerp/addons/stock/wizard/stock_fill_inventory.py", line 105, in fill_inventory
-     'inventory_id': context['active_ids'][0],
+   File "/usr/share/openerp-server/netsvc.py", line 489, in dispatch
+     result = ExportService.getService(service_name).dispatch(method, auth, params)
+   File "/usr/share/openerp-server/service/web_services.py", line 599, in dispatch
+     res = fn(db, uid, *params)
+   File "/usr/share/openerp-server/osv/osv.py", line 122, in wrapper
+     return f(self, dbname, *args, **kwargs)
+   File "/usr/share/openerp-server/osv/osv.py", line 176, in execute
+     res = self.execute_cr(cr, uid, obj, method, *args, **kw)
+   File "/usr/share/openerp-server/osv/osv.py", line 167, in execute_cr
+     return getattr(object, method)(cr, uid, *args, **kw)
+   File "/usr/local/openerp/addons/stock/wizard/stock_fill_inventory.py", line 105, in fill_inventory
+     'inventory_id': context['active_ids'][0],
  IndexError: list index out of range
  
  I would think that either the user should receive an error dialog before
  this happens (i.e. they shouldn't be able to start the wizard at all).
  Alternatively, the record could be saved if it's not.
  
  At the very least, a nice error message should replace the traceback.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/722672

Title:
  "Import inventory" errors when inventory is unsaved

Status in OpenERP Modules (addons):
  New

Bug description:
  Steps to reproduce:
    1) Navigate to Warehouse > Inventory Control > Physical Inventories and open the new Inventory screen.
    2) Do not save the Inventory.
    3) Click on "Import inventory".
    4) Fill in a stock location, and click Fill Inventory.

  Expected behaviour:
    A filled inventory.

  Actual behaviour:

  Traceback (most recent call last):
    File "/usr/share/openerp-server/netsvc.py", line 489, in dispatch
      result = ExportService.getService(service_name).dispatch(method, auth, params)
    File "/usr/share/openerp-server/service/web_services.py", line 599, in dispatch
      res = fn(db, uid, *params)
    File "/usr/share/openerp-server/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/usr/share/openerp-server/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/usr/share/openerp-server/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/usr/local/openerp/addons/stock/wizard/stock_fill_inventory.py", line 105, in fill_inventory
      'inventory_id': context['active_ids'][0],
  IndexError: list index out of range

  I would think that either the user should receive an error dialog
  before this happens (i.e. they shouldn't be able to start the wizard
  at all).  Alternatively, the record could be saved if it's not.

  At the very least, a nice error message should replace the traceback.



References