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"""
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/10/15, 9:33 AM|
|Seen: 2343 times|
|Last updated: 8/11/15, 9:29 AM|