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

self.create() command in OpenERP Model object not working well?

By
P Mittal
on 5/31/13, 1:57 AM 2,960 views

I am creating a module called obp_client where I have defined a Bank model object. The code for the Bank model is written in the obp_client/obp_client.py file.

I get this error when trying to install the module:

AttributeError: 'Bank' object has no attribute 'pool'

The error is encountered in the following line according to the traceback [1] But I am not able to figure out whats wrong with the command? (I am pretty sure that there is no problem in the accessing attributes of item, its something to do with the create command)

record_id = self.create(cr, uid,

      {'full_name': item['bank']['full_name'],
        'logo' : item['bank']['logo'],
        'website': item['bank']['website'],
        'bank_id': item['bank']['id'],
        'short_name': item['bank']['short_name'],},
      context)

[1] [Traceback](http://pastebin.com/EGkPKRGz)

[2] [obp_client.py](http://pastebin.com/fDFFbSPm) (Note: File slightly changed - Line numbers may vary)

1

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 5/31/13, 5:28 AM

HI,

no need put attribute ['bank'].

record_id = self.create(cr, uid,

  {'full_name': item['full_name'],
    'logo' : item['logo'],
    'website': item['website'],
    'bank_id': item['id'],
    'short_name': item['short_name'],},
  context)

Bye

There is NO issue with the attribute 'bank'. (Yes, I know its a bit odd looking, but thats the kind of object I get from an old API). There is something wrong with the create command itself.

P Mittal
on 5/31/13, 10:09 PM
0
kalmenchia
On 6/3/13, 9:26 AM

Hi ,

you have forgot to import pooler ...

from openerp import pooler

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

0 follower(s)

Stats

Asked: 5/31/13, 1:57 AM
Seen: 2960 times
Last updated: 3/16/15, 8:10 AM