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

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
6月 24
4208
5
6月 23
35682
1
12月 23
19463
1
7月 15
6147
2
3月 15
6391