return result
+ def _progress_tasks(self, cr, uid, ids, field, arg, context=None):
+ result = {}
+ for topic in self.browse(cr, uid, ids, context=context):
+ result[topic.id] = topic.number_tasks and topic.number_tasks_done*100./topic.number_tasks or 0.
+ return result
+
+
_name = "todolist.topic"
_states = [("Active", "Active"), ("Inactive", "Inactive")]
"nb_lists": fields.function(_get_nb_lists, type="integer", string="Number of lists"),
"number_tasks": fields.function(_get_number_tasks, type="integer", string="Number of lists"),
"number_tasks_done": fields.function(_get_number_tasks_done, type="integer", string="Number of lists"),
+ "progress_tasks": fields.function(_progress_tasks, type="float", string="Number of lists"),
}
_defaults = {
<field name="description" nolabel="1"/>
<label for="nb_lists" />
<field name="nb_lists" nolabel="1" />
+ <field name="progress_tasks" colspan="3" widget="progressbar" />
</group>
</sheet>
</form>