summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHardik Prajapati <hpr@odoo.com>2020-03-18 10:41:03 +0000
committerBarad Mahendra <mba@openerp.com>2020-03-19 09:52:39 +0000
commit0ebbd1848f1c6fbf56cf3df7e4b5ac0baa6e63b3 (patch)
tree67009cb369addfe7172563351ea4efe5288f48f2
parent900dad016dd77031254a5d68c330fef58ed06e84 (diff)
[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>
-rw-r--r--addons/lunch/views/lunch_alert_views.xml33
-rw-r--r--addons/lunch/views/lunch_location_views.xml28
-rw-r--r--addons/lunch/views/lunch_product_views.xml38
3 files changed, 96 insertions, 3 deletions
diff --git a/addons/lunch/views/lunch_alert_views.xml b/addons/lunch/views/lunch_alert_views.xml
index ea8b838aca0..27fa6d939da 100644
--- a/addons/lunch/views/lunch_alert_views.xml
+++ b/addons/lunch/views/lunch_alert_views.xml
@@ -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"/>
diff --git a/addons/lunch/views/lunch_location_views.xml b/addons/lunch/views/lunch_location_views.xml
index 7eb13fb98cf..1a921732f66 100644
--- a/addons/lunch/views/lunch_location_views.xml
+++ b/addons/lunch/views/lunch_location_views.xml
@@ -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 -->
diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml
index 2b7312baf4e..0c5fb5d0319 100644
--- a/addons/lunch/views/lunch_product_views.xml
+++ b/addons/lunch/views/lunch_product_views.xml
@@ -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