Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
10292 Widoki

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)

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 22
5568
2
lip 21
6027
0
lip 18
2749
1
maj 18
8888
1
lip 17
2906