Trigered store field can not be overrided 6.0/6.1

Bug #904228 reported by Nicolas Bessi - Camptocamp
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
OpenERP Publisher's Warranty Team

Bug Description

Hello,

A really annoying bug on store function field:

Lets take this line of hr_timesheet_task module on the project.project object:
 store = {
                'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 20),
                'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours','state', 'work_ids'], 20),
                'hr.analytic.timesheet': (_get_project_work, ['task_id','unit_amount','product_uom_id','account_id'], 20),
                'account.analytic.line': (_get_analytic_line, ['unit_amount','product_uom_id','account_id'], 20),
            }),

We just extend the fields that should trigger the store fields computation.

First we have to redefine function in our module:

    def _get_project_task(self, cr, uid, ids, context=None):
        return super(project, self)._get_project_task(cr, uid, ids, context)

The problem appears when I create a new task that trigger the _get_project_task function.
Self is not a subtype of project but it is an instance of project.task. So it raise :

TypeError: super(type, obj): obj must be an instance or subtype of type

Nicolas

Tags: maintenance
Revision history for this message
Numérigraphe (numerigraphe) wrote :

The best would be to not have to redefine the method at all...
Lionel Sausin.

summary: - Tigered store field can not be overrided 6.0/6.1
+ Trigered store field can not be overrided 6.0/6.1
Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.