[7.0] adding custom fields to stock.picking.out / stock.picking.in should either work or be prevented
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Wishlist
|
OpenERP R&D Addons Team 2 |
Bug Description
In the MP (that I approved...) https:/
Before that MP, it was possible to add custom fields to stock.picking.in and stock.picking.out, and to search these models with a domain specific to this custom field.
Now, this crashes because we delegate the searching to stock.picking which does not have that specific field. The read method is also affected.
Among other side effects, the customized views using that new field will fail to load.
Steps to reproduce on runbot:
* as admin/admin, using the web interface, add a Field to stock.picking.out (e.g a boolean field called reproduce_bug)
* visit the Delivery Orders view, and create a custom search on reproduce_bug is True
Expected: no lines (because no such delivery orders have been created
Actual: Error message saying that stock.picking has no field reproduce_bug.
Server Traceback (most recent call last):
File "/home/
return openerp.
File "/home/
result = ExportService.
File "/home/
res = fn(db, uid, *params)
File "/home/
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/
return f(self, dbname, *args, **kwargs)
File "/home/
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/
return fct_src(cr, uid, model, method, *args, **kw)
File "/home/
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/
return self.pool.
File "/home/
return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
File "/home/
query = self._where_
File "/home/
e = expression.
File "/home/
self.parse(cr, uid, context=context)
File "/home/
raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'x_reproduce_bug' in leaf "<osv.ExtendedLeaf: ('x_reproduce_bug', '=', True) on stock_picking (ctx: )>"
description: | updated |
summary: |
- 7.0 : crash when searching on stock.picking.out / stock.picking.in - specific fields + 7.0 : delivery module is no longer installable |
summary: |
- 7.0 : delivery module is no longer installable + 7.0 : .0 : crash when searching on stock.picking.out / stock.picking.in + specific fields |
description: | updated |
description: | updated |
tags: | added: maintenance |
Workaround: when writing custom modules, never add custom fields directly on stock.picking.in or stock.picking.out, always do so in stock.picking.