Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
1629 Prikazi

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.

Avatar
Opusti

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

Avtor

I found the reason.Thanks for your replying.

Avtor Best Answer

I found the reason.

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


                
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
apr. 25
1073
1
apr. 25
1186
0
nov. 24
1450
0
okt. 24
1494
1
maj 24
4721