It is currently Sat Feb 11, 2012 8:55 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Simple Wizard Trouble
PostPosted: Tue Sep 29, 2009 7:29 pm 
Offline

Joined: Tue Sep 29, 2009 7:08 pm
Posts: 23
Hi guys,

I am having problem installing a simple wizard. No matter what I do the server keeps saying that there's no such service. I suppose that the file wizard/__init__.pyc is being used by openERP and because (for some reason) is not being recompiled, the server cannot locate the new service.

Any help will be appreciated :D

Here is my code:

wizard/__init__.py
Code:
import wizard_price
import wizardBarcode


barcode_wizard.xml
Wizard TAG: id="barcode_wizard_id" string="Barcode" model="product" name="wizardBarcode"
Code:
<openerp>
   <data>
   <wizard>
   </data>
</openerp>


wizard/wizard_barcode.py
Field NAMES: name="country_id", name="company_name", name="company_id", name="product_id"
Code:
import wizard

def _get_default(obj, cr, uid, data, context=None):
    return { 'country_id':'539', 'company_name':'TSFY', 'company_id':'12345' }

def make_barcode(obj, cr, uid, data, context=None):
    '''Create Barcode'''
    return {}

barcode_form = """<xml>
<form>
    <field>
    <field>
    <field>
    <field>
</form>"""
barcode_fields = {
        'country_id': {'string' : 'Country ID', 'type':'string', 'default': lambda a*:'539'},
        'company_name':{'string': 'Company Name', 'type':'string'},
        'company_id':{'string': 'Company ID', 'type':'string'},
        'product_id':{'string': 'Product ID', 'type':'string'}
}


class wizardBarcode(wizard.interface):
    states = {
        'init':
        {
            'actions': [_get_default],
            'result': {'type':'form', 'arch':barcode_form, 'fields':barcode_fields, 'state':[('end','Cancel'), ('create', 'Create Barcode')]}
        },
        'create':
        {
            'actions': [],
            'result': {'type':'action', 'action':make_barcode, 'state': 'done'}
        }
   }
wizardBarcode('wizardBarcode')


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

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