Wrong use of context on act_windows of Products(for moves)

Bug #615791 reported by Dukai Gábor
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Fix Released
Low
Jay Vora (Serpent Consulting Services)
Trunk
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

Hi!
5.0 latest bzr.
Open the products list, switch to form. Create a stockable product and save it. Click on the all stock moves link. Close the tab. Now you're back on the product form. Click on Next. It should fail now. I tried it with some products already existing with some stock moves.

 Traceback (most recent call last):
   File "bin/osv/osv.py", line 58, in wrapper
     return f(self, dbname, *args, **kwargs)
   File "bin/osv/osv.py", line 119, in execute
     res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
   File "bin/osv/osv.py", line 111, in execute_cr
     return getattr(object, method)(cr, uid, *args, **kw)
   File "bin/osv/orm.py", line 2228, in read
     result = self._read_flat(cr, user, select, fields, context, load)
   File "bin/osv/orm.py", line 2354, in _read_flat
     res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
   File "bin/osv/fields.py", line 659, in get
     res = self._fnct(obj, cr, user, ids, name, self._arg, context)
   File "bin/addons/stock/product.py", line 166, in _product_available
     stock=self.get_product_available(cr,uid,ids,context=c)
   File "bin/addons/stock/product.py", line 72, in get_product_available
     child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)])
   File "bin/osv/orm.py", line 3029, in search
     (qu1, qu2, tables) = self._where_calc(cr, user, args, context=context)
   File "bin/osv/orm.py", line 3009, in _where_calc
     e.parse(cr, user, self, context)
   File "bin/osv/expression.py", line 272, in parse
     ids2 = list(right)
 TypeError: 'long' object is not iterable

Related branches

Changed in openobject-client:
milestone: none → 5.0.13
Changed in openobject-client:
status: New → Confirmed
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Dukai,

   I have checked the issue and its happening due to the update of the context. I have found a solution for this. Would you please check the attached patch and notify us?

Thanks.

Changed in openobject-client:
assignee: nobody → Anup (Open ERP) (ach-openerp)
status: Confirmed → In Progress
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :
Revision history for this message
Dukai Gábor (gdukai) wrote :

The problem is solved, thank you.

affects: openobject-client → openobject-server
Changed in openobject-server:
milestone: 5.0.13 → none
milestone: none → 5.0.13
affects: openobject-server → openobject-client
Changed in openobject-client:
milestone: 5.0.13 → none
milestone: none → 5.0.13
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

I guess this occurs only due to the location_ids are not well-listen in a list.
Anup, can you please check and close this one?
Thanks.

Changed in openobject-client:
importance: Undecided → Low
milestone: 5.0.13 → none
affects: openobject-client → openobject-addons
summary: - Opening links from the product form makes the product form fail (5.0)
+ Wrong use of context on act_windows of Products(for moves)
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

For stable,it has been fixed by revision 2888 <email address hidden>.
Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

For trunk, the fix has currently landed in revision 3885 revision-id: <email address hidden> of the trunk-dev-addons2 branch, and will be merged in trunk soon.

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.