Help

0

not able to add buttons in tree view beside of create button only on particular model in v13

Avatar
paidy kumar

i am using below code..below code migrated from v10 to v13

<template id="template" xml:space="preserve">
<t t-extend="ListView.buttons" t-name="customListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="before">
<!-- Sale Unit -->
<!-- -->
<button t-if="widget.modelName == 'account.asset.asset' and widget.options.action['xml_id'] == 'bi_property_management_extend.action_property_assets_view_from_sale'"
class="btn btn-primary btn-sm oe_action_buttons addMore"
style="width:50px;" type="button">
<span class="fa fa-search-plus" title="Advance Search Sale Unit"/>
</button>
<button t-if="widget.modelName == 'account.asset.asset' and widget.options.action['xml_id'] == 'bi_property_management_extend.action_property_assets_view_from_sale'"
class="btn btn-primary btn-sm oe_action_refresh_buttons"
type="button"><span class="fa fa-refresh" style="font-size:18px" title="Refresh"/></button>

</t>
</t>
</template>
Avatar
Discard
1 Answer
0
Avatar
Equick ERP
Best Answer

Hello 

for doing this you can take reference from the Inventory Report.

In tree view you have to add the attribute class like below.

<tree string="Inventory Valuation" js_class="inventory_report_list" create="0" delete="0" decoration-danger="quantity &lt; 0">



1 Comment
Avatar
Discard
Avatar
paidy kumar
-

Thanks for your response i am able to get button using above my code if i remove syntax widget.options.action['xml_id'] == 'bi_property_management_extend.action_property_assets_view_from_sale'"...but the problem is ia m getting button everywhere the account.asset.asset model exists....i need to check xml id to restrict this