Code review comment for lp:~0k.io/openobject-server/use-priority-attribute-for-store-function

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

Not sure I got what you want to achieve. There is no priority attribute on the field definition. The 10 value is when you don't define any trigger, so the priority does not really apply here.
When you define several triggers, you can set a priority. For instance look at the definition of the field planned_hours in the model project.project

'planned_hours': fields.function(_progress_rate, multi="progress", string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.",
    store = {
        'project.project': (_get_project_and_parents, ['tasks', 'parent_id', 'child_ids'], 10),
        'project.task': (_get_projects_from_tasks, ['planned_hours', 'remaining_hours', 'work_ids', 'state'], 20),
    }),

review: Needs Information

« Back to merge proposal