feat: conditionally show Generate Asset Codes button based on has_asset_moves field

This commit is contained in:
Suherdy Yacob 2026-05-28 20:25:54 +07:00
parent 47e67b8c10
commit ecb49a7a32

View File

@ -6,11 +6,12 @@
<field name="inherit_id" ref="stock.view_picking_form"/> <field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//button[@name='button_validate']" position="before"> <xpath expr="//button[@name='button_validate']" position="before">
<field name="has_asset_moves" invisible="1"/>
<button name="action_generate_asset_codes" <button name="action_generate_asset_codes"
string="Generate Asset Codes" string="Generate Asset Codes"
type="object" type="object"
class="oe_highlight" class="oe_highlight"
invisible="state != 'assigned'" invisible="state != 'assigned' or not has_asset_moves"
groups="ga_asset_management.group_ga_asset_user"/> groups="ga_asset_management.group_ga_asset_user"/>
</xpath> </xpath>
<xpath expr="//field[@name='move_ids']/list/field[@name='product_id']" position="after"> <xpath expr="//field[@name='move_ids']/list/field[@name='product_id']" position="after">