Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
17106 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

perhaps:

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

bye

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 24
4208
5
thg 6 23
35704
1
thg 12 23
19476
1
thg 7 15
6147
2
thg 3 15
6401