跳至內容
選單
此問題已被標幟
2 回覆
4242 瀏覽次數

I've a model which inherits a field from another one:

class 2ndclass(models.Model):

    _name = 'mymodel_name'

    _inherits = {'1stclass': 'id_1stclass'}

    id_1stclass = fields.Many2one('1stclass', 'First Class', widget="many2one_list")

When I create a new object, there is a small arrow near 'First Class'. If I click on It, I get this popup error:

Odoo Client Error

TypeError: this.sidebar is undefined

http://localhost:8069/web/js/web.assets_backend/c686f43:3994

Below this popup, there is another one which allows to modify the selected 1stclass id.

How can I solve it?

Thanks!


頭像
捨棄

Do you have this widget many2one_list?

最佳答案

Try this:

Python:

class 2ndclass(models.Model):

_name = 'mymodel_name'

_inherits = {'1stclass': 'id_1stclass'}

id_1stclass = fields.Many2one('1stclass', 'First Class')

XML:

<field name="id_1stclass" widget="many2one_list">

Regards.

頭像
捨棄
作者

This haven't solved the problem.

相關帖文 回覆 瀏覽次數 活動
2
12月 22
14791
1
11月 21
4913
0
1月 21
2276
8
5月 20
7792
0
12月 23
2926