[IMP] lunch: Add kanban view for alert, location and product category
Purpose of the task is to add Kanban views on the Configuration menu of the Lunch Application for a better interface on smaller devices. So in this commit added for kanban for alert, location and product category but keep the current list view by default for all this menu. closes odoo/odoo#47905 Taskid: 2210929 Closes: #47905 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Barad Mahendra
parent
900dad016d
commit
0ebbd1848f
@@ -72,11 +72,42 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_alert_view_kanban" model="ir.ui.view">
|
||||
<field name="name">lunch.alert.kanban</field>
|
||||
<field name="model">lunch.alert</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="oe_kanban_content">
|
||||
<div class="o_kanban_record_top">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title"><field name="name"/></strong>
|
||||
<span><br/><field name="mode"/></span>
|
||||
<span attrs="{'invisible':[['mode', '!=', 'chat']]}">
|
||||
to <field name="recipients"/>
|
||||
on <field name="notification_time"/>
|
||||
<field name="notification_moment"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_body">
|
||||
<field name="location_ids" widget="many2many_tags"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_alert_action" model="ir.actions.act_window">
|
||||
<field name="name">Lunch Alerts</field>
|
||||
<field name="res_model">lunch.alert</field>
|
||||
<field name="search_view_id" ref="lunch_alert_view_search"/>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="view_id" ref="lunch_alert_view_tree"/>
|
||||
|
||||
@@ -41,10 +41,36 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_location_kanban_view" model="ir.ui.view">
|
||||
<field name="name">lunch.location.view.kanban</field>
|
||||
<field name="model">lunch.location</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="oe_kanban_content">
|
||||
<div class="o_kanban_record_top">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title"><field name="name"/></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_body">
|
||||
<field name="company_id" groups="base.group_multi_company"/><br/>
|
||||
<field name="address"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_location_action" model="ir.actions.act_window">
|
||||
<field name="name">Lunch Locations</field>
|
||||
<field name="res_model">lunch.location</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="search_view_id" ref="lunch_location_view_search"/>
|
||||
<field name="help" type="html">
|
||||
<!-- TODO: better help message -->
|
||||
|
||||
@@ -278,6 +278,42 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_product_category_view_kanban" model="ir.ui.view">
|
||||
<field name="name">Product category Kanban</field>
|
||||
<field name="model">lunch.product.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<field name="id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
|
||||
<div class="o_kanban_image_fill_left d-none d-md-block"
|
||||
t-attf-style="background-image:url('#{kanban_image('lunch.product.category', 'image_128', record.id.raw_value)}')"/>
|
||||
<div class="oe_kanban_details">
|
||||
<div class="o_kanban_record_top">
|
||||
<div class="o_kanban_record_headings">
|
||||
<div class="float-right">
|
||||
<button class="badge badge-primary" type="action"
|
||||
name="%(lunch.lunch_product_action_statbutton)d"
|
||||
context="{'search_default_category_id': active_id,'default_category_id': active_id}"
|
||||
attrs="{'invisible': [('product_count', '=', 0)]}">
|
||||
<field string="Products" name="product_count" widget="statinfo"/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_body">
|
||||
<strong><field name="name"/></strong><br/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="lunch_product_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="res_model">lunch.product</field>
|
||||
@@ -310,7 +346,7 @@
|
||||
<record id="lunch_product_category_action" model="ir.actions.act_window">
|
||||
<field name="name">Product Categories</field>
|
||||
<field name="res_model">lunch.product.category</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create a new product category
|
||||
|
||||
Reference in New Issue
Block a user