Odoo Help


Change Boolean field to Boolean(computed)

on 9/8/15, 7:48 AM 4,083 views

I habe a problem to change an existing boolen field to an computed boolean field:

class manatec_project_task_type(models.Model):
_inherit = 'project.task.type'

def _get_value(self):
  print 'inside'
  self.value = True

  value = fields.Boolean(compute='_get_value') 

The field is visible on the form view but the method _get_value ist never called.


i'm changed value = fields.Boolean(compute='_get_value_get_value') to value = fields.Boolean(compute='_get_value'). This is how my code looks. It was just an copy and paste mistake.

on 9/8/15, 8:37 AM

Vale Trood

--Vale Trood--

| 5 2 7
Tunis, France
--Vale Trood--

Vale Trood
On 9/8/15, 10:06 AM

Ok my friend as i see in this link: http://odoo-new-api-guide-line.readthedocs.org/en/latest/fields.html 

We cant add a compute function to a boolean field.

You can do this:


def on_change_value_id(self, cr, uid, ids, field_name, context=None):
print ('------------------------test vente--------------------')
print field_name


Try this and tell me what you have got. Regards.

Where in the link do you see you can't add a compute function to a boolean field?

MONK Software, Leonardo Donelli
on 9/8/15, 10:09 AM

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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/8/15, 7:48 AM
Seen: 4083 times
Last updated: 9/8/15, 10:08 AM