Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1162 Представления

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


                
Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
апр. 25
282
Odoo Server Error Решено
1
апр. 25
344
0
нояб. 24
660
0
окт. 24
771
1
мая 24
3903