Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I try to inherit(models.Model) a model defined with osv.osv that contains a field selection which is computed.
I redefined the whole Selection field with the same parameters as I want to override the function called by the compute.
As value of my compute field option, I put my new compute method.
The new compute method call the super one, set the field and then I do my stuff.
Module install is ok, new compute function is well called.
But when I let debugging continue, I got the Exception : 'undefined get method'.
After deep debugging, it appears that my Selection field got the type osv.fields.selection instead of osv.fields.function => the selection type don't have a get method (see the _column object in openerp.osv.fields).
The original model (without my module) has the good type osv.fields.function...
Is it a framework error?
Many thanks for your help
The code looks like that :
result = super(stock_picking,self)._state_get(None,None)
self.state = result[self.id]
if self.state == 'assigned':
('waiting', 'Waiting Another Operation'),
('confirmed', 'Waiting Availability'),
('partially_available', 'Partially Available'),
('assigned', 'Ready to Transfer'),
], string='Status', readonly=True, select=True, track_visibility='onchange',
* Draft: not confirmed yet and will not be scheduled until confirmed\n
* Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n
* Waiting Availability: still waiting for the availability of products\n
* Partially Available: some products are available and reserved\n
* Ready to Transfer: products reserved, simply waiting for confirmation.\n
* Transferred: has been processed, can't be modified or cancelled anymore\n
* Cancelled: has been cancelled, can't be confirmed anymore"""
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/10/15, 9:33 AM|
|Seen: 3190 times|
|Last updated: 8/11/15, 9:29 AM|