How to show/hide menu item based on system parameter?
I've this code to create menu item, and it working fine, but i need to hide it depends on system parameter.
Does anyone know how to do that? Thanks.
<!-- this is for test, remove this after testing -->
<record id="check_qty_and_move_from_internal_customer_to_customer" model="ir.actions.server" style="color:#e8bf6a;">>
<field name="name">Cron Run Directly 2</field>
<field name="model_id" ref="model_kiotviet_cron"/>
<field name="binding_model_id" ref="onnet_kiotviet.model_kiotviet_cron"/>
<field name="state">code</field>
<!-- function called -->
<field name="code">model.check_qty_and_move_from_internal_customer_to_customer()</field>
</record>
<!-- this is for test, remove this after testing -->
<menuitem id="check_qty_and_move_from_internal_customer_to_customer" name="Cron Run Directly 2" parent="kiotviet_menu_root"
action="check_qty_and_move_from_internal_customer_to_customer" sequence="6"/>