It is currently Sun Feb 12, 2012 7:09 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: can't select anything from my own object in a wizard
PostPosted: Tue Oct 20, 2009 10:16 am 
Offline

Joined: Tue Nov 06, 2007 5:50 pm
Posts: 12
Location: Germany, Emmerich am Rhein
Hi,

I have the problem, that I can't select anything from my own object 'thingtpl'.
As you can see my object has only one field: 'thing_no'.
I get the error message that there's no field called 'name'
How can I tell the system, that it should search for the field 'thing_no'?

It is interessting, that if I use another relation it will work fine.
e.g with account.account, product.product, res.partner etc

thanx for your help

Code:
import wizard
import pooler

class wiz_create_thing(wizard.interface):

    _transaction_form = '''<xml>
    <form>
        <field>
    </form>'''

    _transaction_fields = {
        'thing_no': {'string': 'Thing No',
                     'type': 'many2one',
                     'relation': 'thingtpl',
                     'required': True  },
    }

    def _thing_create(self, cr, uid, data, context):
        return {}

    states = {
        'init': {
            'actions': [_get_defaults],
            'result': {'type': 'form',
                        'arch':_transaction_form,
                        'fields':_transaction_fields,
                        'state':[('end', 'Cancel', 'gtk-cancel'),('thing_copy', 'Make new thing', 'gtk-new')]}
        },
        'thing_copy': {
            'actions': [],
            'result': {'type': 'state',
                       'state':'end'}
        }
    }
wiz_create_thing('wizard_create_thing')


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 20, 2009 10:45 am 
Offline

Joined: Mon Dec 03, 2007 8:22 am
Posts: 1472
Location: Belgium
There must be one name field in your object 'thingtpl'
or define a rec_name in your object.

_________________
OpenERP=Easier, Adaptable, Affordable, Modular


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 20, 2009 11:39 am 
Offline

Joined: Tue Nov 06, 2007 5:50 pm
Posts: 12
Location: Germany, Emmerich am Rhein
Thanx,

shame on me.
I should have read this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP