Odoo Help

Welcome!

This community 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.

0

Error using inheritance from project.project model in odoo.

By
Nirav Jani
on 6/17/15, 9:02 AM 470 views

Hello All,

I have created a new model "my.project" which inherits from project.project model.

class my_project(models.Model):
    _name = "my.project"   
    _inherits = {'project.project':'project_id'}
   
   
    project_id = fields.Many2one('project.project', 'Project', ondelete="cascade", required=True)
    is_approved = fields.Boolean(string='Is Valid Project')
    manger_amt = fields.Float(string='Approval Amt')
    approval_note = fields.Char(string="Approval Note", size=32)

When I create a new record in the form and click on the Save button, I got this error:

File "/home/nirav/OpenERP/odoo/openerp/sql_db.py", line 235, in execute
    res = self._obj.execute(query, params)
ProgrammingError: invalid reference to FROM-clause entry for table "project_project"
LINE 2: ...project_id" = "my_project__project_id"."id") AND ("project_p...
                                                             ^
HINT:  Perhaps you meant to reference the table alias "my_project__project_id".

Thank you.

Please check that the field project_id introduced by you is included in form view or not ? If not check after adding it.

Ajay
on 6/17/15, 9:34 AM

I found one solution if we use other user like "demo" that time work find. But we use "Admin" that time is not working.

Nirav Jani
on 6/17/15, 9:39 AM

Check my suggestion.

Ajay
on 6/17/15, 9:42 AM

Sorry Dear it is not working..

Nirav Jani
on 6/17/15, 9:44 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/17/15, 9:02 AM
Seen: 470 times
Last updated: 6/17/15, 9:44 AM