← Back to team overview

c2c-oerpscenario team mailing list archive

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

 

Hello Daniel,

I have checked the issue again in the web client and met with the
traceback. But this is not a bug and it occurs due to the execution of
wizard without saving the current form.

Here in fill_inventory() method 'inventory_id':
context['active_ids'][0], this will return the active_id of current
model. GTK client allows the access of active_id without saving the
form, so we did not face such problems in GTK client.

But whenever you are executing the wizard in web-client, you should have
to first save the form of current model so it can get th active_id of
it. This is due to the architecture of web client.

This is in response to your second issue of error message rather than
traceback. So we have made the message that asks at the time of
execution of wizard for saving the data of current form.

I have attached the video again for your reference, please ignore the
comment #1 as I tested first it on GTK-client and sorry for your
inconvenience.

I am closing this bug for now.

Thanks for your participation.
  

** Attachment added: "test-1.ogv"
   https://bugs.launchpad.net/openobject-addons/+bug/722672/+attachment/1870595/+files/test-1.ogv

** Changed in: openobject-addons
       Status: New => Invalid

-- 
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):
  Invalid

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