Community: Framework mailing list archives

expert-framework@mail.odoo.com

v8.0 - Cannot create computed field - Field is accessed before being computed.

by
Maxim Litnitskiy
- 10/14/2014 19:32:03
Hi dear Experts.
In old api we had no problems creating function fields like the following (from ir_attachment.py):

...
'datas': fields.function(_data_get, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True),  
...
 
In new api the following code is working on read / update, but gives error "Field is accessed..."  on create:

...
datas = fields.Binary(compute='_data_get', inverse='_data_set', string=_('File content'), required=True)
...

Is it supposed to work or not?
Thanks.


P.S. May be some concept has changed. I can imagine that in form edit mode I use real Binary field (not computed) and mirror it via @api.depend on computed field?