Files
odoo_source/addons/fleet/views/fleet_vehicle_model_views.xml
T
wan 864f962145 [IMP] base: do not resize module icons
Most of the modules have a square icon but some don't. For instance, the
flags of l10n modules, or other third party modules.
Flags have very specific proportions, and we don't want them to be
resized when rendered.
While we could hardcode a square icon for each problematic icon, it
would be more manipulations, and the flags are already in the repo
without the right proportions; we don't want to duplicate binaries.

The many2many `module_ids` kanban field of the uninstall wizard has also
been updated to look more like the generic kanban view for the modules.

The classes in the kanban view of `fleet_vehicle_model_view_form` seem
to have been copy-pasted and are useless. It has been removed to reduce
future possible side effects of changing css.

closes odoo/odoo#56421

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-01-15 15:56:47 +00:00

189 lines
8.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id='fleet_vehicle_model_view_form' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.form</field>
<field name="model">fleet.vehicle.model</field>
<field name="arch" type="xml">
<form string="Model">
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="image_128" widget='image' class="oe_avatar"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="e.g. Model S"/>
</h1>
<label for="brand_id" class="oe_edit_only"/>
<h2>
<field name="brand_id" placeholder="e.g. Tesla"/>
</h2>
</div>
<group>
<group>
<field name="active" invisible="1"/>
<field name="vehicle_type"/>
<field name="manager_id" groups="fleet.fleet_group_manager"/>
</group>
</group>
<notebook>
<page string="Vendors" name="vendors">
<field name="vendors">
<kanban quick_create="false" create="true">
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div style="position: relative" class="oe_kanban_global_click">
<div>
<div class="o_kanban_record_title">
<field name="name"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id='fleet_vehicle_model_view_tree' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.tree</field>
<field name="model">fleet.vehicle.model</field>
<field name="arch" type="xml">
<tree string="Models">
<field name="brand_id" />
<field name="name" />
<field name="vehicle_type"/>
</tree>
</field>
</record>
<record id='fleet_vehicle_model_view_kanban' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.kanban</field>
<field name="model">fleet.vehicle.model</field>
<field name="arch" type="xml">
<kanban string="Models">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_details">
<div><strong><field name="name"/></strong></div>
<div><field name="brand_id"/></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id='fleet_vehicle_model_view_search' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.search</field>
<field name="model">fleet.vehicle.model</field>
<field name="arch" type="xml">
<search string="Vehicles costs" >
<field name="brand_id" />
<group expand="1" string="Group By">
<filter name="groupby_brand" context="{'group_by' : 'brand_id'}" string="Make"/>
</group>
</search>
</field>
</record>
<record id='fleet_vehicle_model_action' model='ir.actions.act_window'>
<field name="name">Vehicles Model</field>
<field name="res_model">fleet.vehicle.model</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_groupby_brand" : True,}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new model
</p><p>
You can define several models (e.g. A3, A4) for each make (Audi).
</p>
</field>
</record>
<menuitem name="Fleet" id="menu_root" sequence="115" groups="fleet_group_user" web_icon="fleet,static/description/icon.png"/>
<menuitem name="Configuration" parent="menu_root" id="fleet_configuration" sequence="100" groups="fleet_group_manager"/>
<record id='fleet_vehicle_model_brand_view_tree' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.brand.tree</field>
<field name="model">fleet.vehicle.model.brand</field>
<field name="arch" type="xml">
<tree string="Model Make">
<field name="name" />
</tree>
</field>
</record>
<record id='fleet_vehicle_model_brand_view_form' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.brand.form</field>
<field name="model">fleet.vehicle.model.brand</field>
<field name="arch" type="xml">
<form string="Model Make">
<sheet>
<group>
<div>
<field name="image_128" widget="image" class="oe_avatar"/>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name"/>
</h1>
</div>
</group>
</sheet>
</form>
</field>
</record>
<record id='fleet_vehicle_model_brand_view_kanban' model='ir.ui.view'>
<field name="name">fleet.vehicle.model.brandkanban</field>
<field name="model">fleet.vehicle.model.brand</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="name" />
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override oe_kanban_global_click">
<a type="open" href="#" class="o_kanban_image oe_kanban_action">
<img alt="Open" t-att-src="kanban_image('fleet.vehicle.model.brand', 'image_128', record.id.raw_value)" class="img-fluid" style="width:100px;"/>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">
<a type="open" class="o_kanban_record_title">
<field name="name"/>
</a>
</h4>
</div>
<div class="o_kanban_button">
<a type="object" name="action_brand_model" class="oe_kanban_action oe_kanban_action_a">
<field name="model_count"/>
MODELS
</a>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id='fleet_vehicle_model_brand_action' model='ir.actions.act_window'>
<field name="name">Manufacturers</field>
<field name="res_model">fleet.vehicle.model.brand</field>
<field name="view_mode">kanban,tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new manufacturer
</p>
</field>
</record>
<menuitem action="fleet_vehicle_model_brand_action" parent="fleet_configuration" id="fleet_vehicle_model_brand_menu" sequence="2"/>
<menuitem action="fleet_vehicle_model_action" parent="fleet_configuration" id="fleet_vehicle_model_menu" sequence="2"/>
</odoo>