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

The following domain addition throwing a error while using department_id field in search view.

And tried the openerp doc doc.openerp.com/v6.0/developer/2_6_views_events/views/search_view.html#fields

How can i solve this?

<field name="type">search</field>            
<field name="arch" type="xml">
   <search string="Home">
          <field name="company_id"/>
          <field name="department_id" domain="[('company_id','=',company_id)]"/>
   </search>
</field>

Thanks in advance

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

perhaps:

<field name="department_id" domain="[('company_id','=',context.get('company_id', False)]"/>

bye

الصورة الرمزية
إهمال
الكاتب

While using the suggested condition the following error popup ValueError: Error during evaluation of this domain: "[('company_id','=',company_id.id)]", message: "name 'company_id' is not defined"

answer update

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 24
4208
5
يونيو 23
35674
1
ديسمبر 23
19460
1
يوليو 15
6147
2
مارس 15
6389