Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1642 Zobrazení

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
Zrušit

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

Autor

I found the reason.Thanks for your replying.

Autor Nejlepší odpověď

I found the reason.

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


                
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
dub 25
1089
1
dub 25
1200
0
lis 24
1462
0
říj 24
1502
1
kvě 24
4738