Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
10274 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
jul. 22
5565
2
jul. 21
6024
0
jul. 18
2744
1
mei 18
8851
1
jul. 17
2903