Move vps notebook to smartbutton

This commit is contained in:
Mario
2024-08-04 01:36:22 +02:00
parent 04d1057a8a
commit 19c80e2b2e
4 changed files with 31 additions and 17 deletions

View File

@@ -5,21 +5,15 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="VPS Servers" attrs="{'invisible': [('is_company', '=', False)]}">
<field name="is_company" invisible="1"/>
<field name="vps_server_ids" readonly="1">
<tree>
<field name="name"/>
<field name="ip_address"/>
<field name="cpu"/>
<field name="ram"/>
<field name="storage"/>
<field name="os"/>
</tree>
</field>
</page>
</xpath>
<!-- Remove the notebook page if it exists -->
<!-- <xpath expr="//page[@name='vps_servers']" position="replace"/> -->
<!-- Add the smart button -->
<div name="button_box" position="inside">
<button name="action_view_vps_servers" type="object" class="oe_stat_button" icon="fa-server" attrs="{'invisible': [('vps_server_count', '=', 0)]}">
<field name="vps_server_count" widget="statinfo" string="VPS Servers"/>
</button>
</div>
</field>
</record>
</odoo>