コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
10048 ビュー

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)

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
7月 22
5390
2
7月 21
5866
0
7月 18
2575
1
5月 18
8547
1
7月 17
2665