Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
2595 Lượt xem

When my record has been created Odoo warns me with that :

WARNING DevNJA openerp.models: Comparing apples and oranges: res.partner(2973,) == 'Aucun' (/usr/lib/python2.7/dist-packages/openerp/models.py:5600)

This is an example of how I use the 'create' method :

self.env['res.partner'].create(
            {
                'name': nameFmt,
                'firstname': self.firstNameOfUser.strip().lower().title(),
                'lastname': self.lastNameOfUser.strip().upper(),
                'birthdate': newDateFmt,
                'birth_place': self.pBirthOfUser,
                'is_company': False
            }
        )


Can someone explain me what does it mean exactly and how do I use correctly ?



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Are you comparing the partner somewhere in your Code? It must be other línea. That create method seems right

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Once I create a record I don't do nothing with this, any comparison, affectation or something else, althought the record has been correctly created...

In 'res_partner' class I saw an override of the 'create' method. I didn't develop the 'res_partner' class but it might be the problem. The definition is in v7 instead of v8 as I use.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Are you sure that this is the line that fails? 

I suppose that the create works (i don't see any problem with your code)

What are you doing with the result of this creation?

Ảnh đại diện
Huỷ bỏ