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

I run odoo16 on docker, and I am coding a search view like this:




<record id="purchase_plan_line_search" model="ir.ui.view">
<field name="name">purchase_plan_line.searchfield>
<field name="model">purchase.plan.linefield>
<field name="arch"type="xml">
<field name="task_id"/>
<field name="created_by"/>
<search string="Search Purchase Plan Line">
<separator/>
<group expand="1"string="Group By">
<filter name="group_by_task_id"string="Task"context="{'group_by':'task_id', 'group_expand':True}"/>
<filter name="group_by_request_type"string="Plan Type"context="{'group_by':'request_type'}"/>
<filter name="group_by_verify_option"string="Verify Option"context="{'group_by':'verify_option'}"/>
group>
<filter name="request_type"string="device"domain="[('request_type','=','device_budget')]"/>
<filter name="request_type"string="item"domain="[('request_type','=','item_budget')]"/>
<filter name="request_type"string="maintain"domain="[('request_type','=','maintain_budget')]"/>
search>
field>
record>
<record id='purchase_plan_line_view' model='ir.actions.act_window'>

<field name='name'>Purchas Plan Linesfield>
<field name='type'>ir.actions.act_windowfield>
<field name='res_model'>purchase.plan.linefield>
<field name='view_mode'>tree,formfield>
<field name='search_view_id'ref='purchase_plan_line_search'/>
record>

But when I try to update the application, I raises a ValueError like this:

ValueError: Wrong value for ir.ui.view.type: 'data'

And the following code looks like this:

<record id="purchase_plan_line_search"model="ir.ui.view">
<field name="name">purchase_plan_line.searchfield>
<field name="model">purchase.plan.linefield>
<field name="arch"type="xml">
<data><field name="task_id"/>
<field name="created_by"/>
<search string="Search Purchase Plan Line">
<separator/>
<group expand="1"string="Group By">
<filter name="group_by_task_id"string="Task"context="{'group_by':'task_id', 'group_expand':True}"/>
<filter name="group_by_request_type"string="Plan Type"context="{'group_by':'request_type'}"/>
<filter name="group_by_verify_option"string="Verify Option"context="{'group_by':'verify_option'}"/>
group>
<filter name="request_type"string="device"domain="[('request_type','=','device_budget')]"/>
<filter name="request_type"string="item"domain="[('request_type','=','item_budget')]"/>
<filter name="request_type"string="maintain"domain="[('request_type','=','maintain_budget')]"/>
search>
data>field>
record>

 It adds a in the search view record.

It confuses me a lot, and I have no idea to solve it.

Does anyone know the reason for this?And how to fix it?

Thank you and Regards.

الصورة الرمزية
إهمال

if you can share an image of the full file as an image, it will be easier

الكاتب

I found the reason.Thanks for your replying.

الكاتب أفضل إجابة

I found the reason.

It's caused by missing the 'type' field in the record


                
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 25
1079
Odoo Server Error تم الحل
1
أبريل 25
1194
0
نوفمبر 24
1456
0
أكتوبر 24
1496
1
مايو 24
4733