This question has been flagged
1 Reply
18688 Views

in openerp-server.log i get this error message.

File "C:\OpenERP 7.0-20140221-003045\Server\server.\openerp\modules\registry.py", line 118, in load File "C:\OpenERP 7.0-20140221-003045\Server\server.\openerp\osv\orm.py", line 937, in create_instance File "C:\OpenERP 7.0-20140221-003045\Server\server.\openerp\osv\orm.py", line 988, in __init__ AttributeError: 'tuple' object has no attribute 'replace'

cant really figure out what it is as i have another module with a different name that has roughly the same syntax and it starts up fine? here is my model

from openerp.osv import osv, fields


class Products(osv.Model):
    _name = 'products.products',
    _columns = {
        'Name': fields.text('Prod Name', size=100),
        'Code': fields.text('Code'),
        'Sku': fields.text('SKU', size=30),
        'Description': fields.text('Description'),
        'SalePriceWithVAT': fields.float('Sale Price + VAT'),
        'Group': fields.float('Group'),
        'Id': fields.text('ID'),
        'ApplicationId': fields.text('App ID'),
    }

iam stumped yet again with this stuff. at least the module is actually showing up in the list now though. any help is appreciated

Avatar
Discard
Author

for some reason orm.py thinks my _name value is a tuple. i seem to be fixing other errors in orm.py also. dont want to mess around with the source too much tbh. i just want to create my own module.

Best Answer

Hi,

Rename Products.py to products.py

No comma after "_name = 'products.products'"

webcall = WebCall.WebCall(" my....)

Check Indentation in your files.

On my side i'm getting this error:

ile "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 165, in load_module_graph init_module_models(cr, package.name, models)

File "/usr/lib/pymodules/python2.7/openerp/modules/module.py", line 378, in init_module_models obj.init(cr)

File "/usr/lib/pymodules/python2.7/openerp/addons/produits/produits.py", line 16, in init webcall.makecall()

File "/usr/lib/pymodules/python2.7/openerp/addons/produits/WebCall.py", line 16, in makecall self.response = urllib2.urlopen(request,timeout=10)

File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout)

File "/usr/lib/python2.7/urllib2.py", line 392, in open protocol = req.get_type()

File "/usr/lib/python2.7/urllib2.py", line 254, in get_type raise ValueError, "unknown url type: %s" % self.__original ValueError: unknown url type: my web url goes here!!

What do you think?

Avatar
Discard