Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
10429 Ansichten

I have this error when i want to install any module on odoo 9

can you help me please

this is the server error:

 File "/odoo/odoo-9.0c-20170217/openerp/fields.py", line 1718, in convert_to_write
    return value.id
AttributeError: 'int' object has no attribute 'id'

this is the part of my code fields.py:


    def convert_to_write(self, value):
        return value.id

    def convert_to_export(self, value, env):
        return value.name_get()[0][1] if value else ''

    def convert_to_display_name(self, value, record=None):
        return ustr(value.display_name)

    def convert_to_onchange(self, value, fnames=None):
        if not value.id:
            return False
        return super(Many2one, self).convert_to_onchange(value, fnames)

Avatar
Verwerfen
Beste Antwort

Hi,

if you are getting the same error on installing any module, then you have to check whether there is any module which is currently in cancel install state. If so please uninstall it .

Then the above problem is due to for a integer field you are given .id , in above case it may be value.id, not sure . Just print the value in the field and check whether it is a record or not. you will have id only for records not for a integer field.

Thanks

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Juli 22
5715
2
Juli 21
6164
0
Juli 18
2872
1
Mai 18
9192
1
Juli 17
3033