تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4251 أدوات العرض

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
ديسمبر 22
14797
1
نوفمبر 21
4923
0
يناير 21
2277
8
مايو 20
7804
0
ديسمبر 23
2927