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

AttributeError: 'tuple' object has no attribute 'replace'???

By
eoin ahern
on 3/23/14, 5:46 AM 2,840 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

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.

eoin ahern
on 3/23/14, 8:12 AM
0

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 3/23/14, 6:59 PM

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?

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: 3/23/14, 5:46 AM
Seen: 2840 times
Last updated: 3/16/15, 8:10 AM