Skip to Content
Menu
This question has been flagged
2 Replies
3889 Views

How to fix warning message

warnings.warn(f"The tag is deprecated, use a for {xml_id!r}.", DeprecationWarning)

Avatar
Discard
Best Answer

Hi,
The warning message you provided indicates that the

<act_window>


tag is deprecated in Odoo 16 and suggests using a

<record>


instead for the specified xml_id.

<act_window id="wizard_action_stock_check"
         name="Check Stock"
         src_model="stock.inventory"
res_model="bi.stock.check.report"
         view_type="form" view_mode="form"
         key2="client_action_multi" target="new"
     groups="base.group_no_one"/>




 In odoo 16 using

<record>

instead of

<act_window>

like this:-

<record id="action_stock_inventory_check" model="ir.actions.act_window">
            <field name="name">Stock Check</field>
<field name="res_model">bi.stock.check.report</field>
            <field name="view_mode">form</field>
<field name="view_id" ref="bi_stock_inventory_check_form"/>
            <field name="target">new</field>
</record>


Hope it helps

Avatar
Discard
Best Answer

Hi,

If you have tried to create a window action using the tag:  act_window, you have to replace this with record as follows:

<record id="product_template_action" model="ir.actions.act_window">
record>

Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
May 24
1521
1
Apr 24
1297
1
Feb 24
1872
0
Feb 24
10
0
Jan 24
1794