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

2 projects are created when create one in project.project

By
daouda
on 6/26/13, 10:24 AM 646 views

Hi, i have a problem. When i create a project via project->create 2 projects are created. How this can be fixed?

0

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
On 6/26/13, 10:33 AM

Hi daouda,

I have faced this kind of problem before. And I came to know that I've override create() method & then called super() and in return value I called super. So because of calling super two times I got record created two times.

Here is my problematic code,

def create(self, cr, uid, vals, context=None):
    # My calculation & code
    res = super(class_name, self).create(cr, uid, vals, context)
    return super(class_name, self).create(cr, uid, vals, context)

By calling super two times record was created twice.

Instead that I did like this,

def create(self, cr, uid, vals, context=None):
    # My calculation & code
    res = super(class_name, self).create(cr, uid, vals, context)
    return res

I am not sure you have done like this or not? But it is my suggestion, it is one of the possibility which is why records are created two times.

Hope this is helpful to solve your problem.

Thanks.

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/26/13, 10:24 AM
Seen: 646 times
Last updated: 3/16/15, 8:10 AM