跳至内容
菜单
此问题已终结
1 回复
1623 查看

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
4月 25
1068
1
4月 25
1180
0
11月 24
1439
0
10月 24
1490
1
5月 24
4717