summaryrefslogtreecommitdiff
path: root/addons/lunch/views
diff options
context:
space:
mode:
authorKevin Baptiste <kba@odoo.com>2019-06-27 14:24:41 +0000
committerYannick Tivisse <yti@odoo.com>2019-07-16 11:44:35 +0000
commit50163143a915635eda08dc1f053e057c38871f42 (patch)
tree71c1dcdb08ac95a7a65ac0e9c5bb1be277e3a2e2 /addons/lunch/views
parent8f137f66bc4a43a43da111cfde04d4fd27e455ea (diff)
[IMP] lunch: Improve the general UX (back2basics)
- Reorganize configure your order screen - Alert users through chat: Alerts can now be configured to send a chat message to the employees. - Replace toppings by extras closes odoo/odoo#34470 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/lunch/views')
-rw-r--r--addons/lunch/views/lunch_alert_views.xml13
-rw-r--r--addons/lunch/views/lunch_cashmove_views.xml2
-rw-r--r--addons/lunch/views/lunch_orders_views.xml14
-rw-r--r--addons/lunch/views/lunch_product_views.xml6
-rw-r--r--addons/lunch/views/lunch_templates.xml1
-rw-r--r--addons/lunch/views/lunch_views.xml8
6 files changed, 27 insertions, 17 deletions
diff --git a/addons/lunch/views/lunch_alert_views.xml b/addons/lunch/views/lunch_alert_views.xml
index 15fc85fb0ca..fefea3ca7e5 100644
--- a/addons/lunch/views/lunch_alert_views.xml
+++ b/addons/lunch/views/lunch_alert_views.xml
@@ -18,10 +18,11 @@
<field name="model">lunch.alert</field>
<field name="arch" type="xml">
<tree>
- <field name="active" widget="boolean_toggle"/>
<field name="name"/>
+ <field name="mode"/>
<field name="message" invisible="1"/>
<field name="available_today"/>
+ <field name="active" widget="boolean_toggle"/>
</tree>
</field>
</record>
@@ -40,6 +41,8 @@
</div>
<group>
<group>
+ <field name="mode" widget="radio"/>
+ <field name="recipients" attrs="{'invisible': [['mode', '!=', 'chat']]}" widget="radio"/>
<field name="location_ids" widget="many2many_tags"/>
<field name="until"/>
<field name="active"/>
@@ -52,6 +55,12 @@
<field name="recurrency_friday"/>
<field name="recurrency_saturday"/>
<field name="recurrency_sunday"/>
+ <label for="notification_time" attrs="{'invisible': [['mode', '!=', 'chat']]}"/>
+ <div class="o_row" attrs="{'invisible': [['mode', '!=', 'chat']]}">
+ <field name="notification_time" attrs="{'required': [('mode', '=', 'chat')]}" widget="float_time"/>
+ <field name="notification_moment"/>
+ </div>
+ <field name="tz" groups="base.group_no_one"/>
</group>
<group>
<field name="message"/>
@@ -67,7 +76,7 @@
<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="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
<field name="view_id" ref="lunch_alert_view_tree"/>
- <field name="context">{'search_default_inactive': 1, 'search_default_active': 1}</field>
</record>
</odoo>
diff --git a/addons/lunch/views/lunch_cashmove_views.xml b/addons/lunch/views/lunch_cashmove_views.xml
index b970cfb10ae..dec3bbf9e50 100644
--- a/addons/lunch/views/lunch_cashmove_views.xml
+++ b/addons/lunch/views/lunch_cashmove_views.xml
@@ -88,7 +88,7 @@
</record>
<record id="lunch_cashmove_action_payment" model="ir.actions.act_window">
- <field name="name">Register Cash Moves</field>
+ <field name="name">Cash Moves</field>
<field name="res_model">lunch.cashmove</field>
<field name="view_mode">tree,kanban,form</field>
<field name="search_view_id" ref="lunch_cashmove_view_search"/>
diff --git a/addons/lunch/views/lunch_orders_views.xml b/addons/lunch/views/lunch_orders_views.xml
index b2b6f03177c..0995e6cf484 100644
--- a/addons/lunch/views/lunch_orders_views.xml
+++ b/addons/lunch/views/lunch_orders_views.xml
@@ -17,7 +17,7 @@
<field name="user_id"/>
<group expand="0" string="Group By">
<filter name="group_by_supplier" string="By Vendor" context="{'group_by':'supplier_id'}"/>
- <filter name="group_by_date" string="Order Date" context="{'group_by':'date'}" help="Vendor Orders by Date"/>
+ <filter name="group_by_date" string="Order Date" context="{'group_by':'date:day'}" help="Vendor Orders by Date"/>
</group>
</search>
</field>
@@ -27,7 +27,7 @@
<field name="name">lunch.order.tree</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
- <tree string="Order lines Tree" create="false" edit="false" decoration-muted="state == 'cancelled'">
+ <tree string="Order lines Tree" create="false" edit="false" decoration-muted="state == 'cancelled'" class="o_lunch_list">
<field name='date'/>
<field name='supplier_id' invisible='1'/>
<field name='product_id'/>
@@ -36,10 +36,10 @@
<field name='user_id'/>
<field name="currency_id" invisible="1"/>
<field name='price' sum="Total" string="Price" widget="monetary"/>
- <button name="action_confirm" string="Confirm" type="object" icon="fa-phone text-success" attrs="{'invisible': [('state', '!=', 'ordered')]}" groups="lunch.group_lunch_manager"/>
- <button name="action_cancel" string="Cancel" type="object" icon="fa-times-circle text-danger" attrs="{'invisible': [('state', 'in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager"/>
<field name='state'/>
<field name="company_id" groups="base.group_multi_company"/>
+ <button name="action_confirm" string="Confirm" type="object" icon="fa-phone text-success" attrs="{'invisible': [('state', '!=', 'ordered')]}" groups="lunch.group_lunch_manager"/>
+ <button name="action_cancel" string="Cancel" type="object" icon="fa-times-circle text-danger" attrs="{'invisible': [('state', 'in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager"/>
</tree>
</field>
</record>
@@ -120,11 +120,11 @@
</record>
<record id="lunch_order_action" model="ir.actions.act_window">
- <field name="name">Your Orders</field>
+ <field name="name">My Orders</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">tree,kanban,pivot</field>
<field name="search_view_id" ref="lunch_order_view_search"/>
- <field name="context">{"search_default_is_mine":1}</field>
+ <field name="context">{"search_default_is_mine":1, "search_default_group_by_date": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No previous order found
@@ -135,7 +135,7 @@
</record>
<record id="lunch_order_action_by_supplier" model="ir.actions.act_window">
- <field name="name">Orders by Vendor</field>
+ <field name="name">Today's Orders</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">tree,kanban</field>
<field name="search_view_id" ref="lunch_order_view_search"/>
diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml
index 6b0179c988c..b6012781b10 100644
--- a/addons/lunch/views/lunch_product_views.xml
+++ b/addons/lunch/views/lunch_product_views.xml
@@ -126,7 +126,7 @@
<field name="model">lunch.product</field>
<field name="priority">5</field>
<field name="arch" type="xml">
- <kanban class="o_kanban_mobile">
+ <kanban create="1" edit="0" class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="category_id"/>
@@ -168,7 +168,7 @@
<record id="lunch_product_action_statbutton" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
- <field name="view_mode">tree,kanban,form</field>
+ <field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_group_by_supplier': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -184,7 +184,7 @@
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<tree string="Products List">
- <field name='name' string="Product Category: "/>
+ <field name='name' string="Product Category"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
diff --git a/addons/lunch/views/lunch_templates.xml b/addons/lunch/views/lunch_templates.xml
index 40c57da0b79..b39211bf3af 100644
--- a/addons/lunch/views/lunch_templates.xml
+++ b/addons/lunch/views/lunch_templates.xml
@@ -3,6 +3,7 @@
<template id="assets_backend" name="lunch assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/scss" href="/lunch/static/src/scss/lunch_kanban.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/lunch/static/src/scss/lunch_list.scss"/>
<script type="text/javascript" src="/lunch/static/src/js/lunch_kanban_widget.js"></script>
<script type="text/javascript" src="/lunch/static/src/js/lunch_payment_dialog.js"></script>
diff --git a/addons/lunch/views/lunch_views.xml b/addons/lunch/views/lunch_views.xml
index 88e5d61a280..c0254e906cc 100644
--- a/addons/lunch/views/lunch_views.xml
+++ b/addons/lunch/views/lunch_views.xml
@@ -7,13 +7,13 @@
<menuitem name="Configuration" parent="menu_lunch" id="menu_lunch_config" sequence="53" groups="group_lunch_manager"/>
<menuitem name="New Order" parent="menu_lunch_title" id="lunch_order_menu_form" action="lunch.lunch_product_action_order" sequence="1"/>
- <menuitem name="My Orders" parent="menu_lunch_title" id="lunch_order_menu_tree" action="lunch_order_action" sequence="2"/>
- <menuitem name="My Lunch Account" parent="menu_lunch_title" id="lunch_cashmove_report_menu_form" action="lunch_cashmove_report_action_account" sequence="3"/>
+ <menuitem name="My Order History" parent="menu_lunch_title" id="lunch_order_menu_tree" action="lunch_order_action" sequence="2"/>
+ <menuitem name="My Account History" parent="menu_lunch_title" id="lunch_cashmove_report_menu_form" action="lunch_cashmove_report_action_account" sequence="3"/>
<menuitem name="Today's Orders" parent="menu_lunch_admin" id="lunch_order_menu_by_supplier" action="lunch_order_action_by_supplier" />
- <menuitem name="Orders by Vendor" parent="menu_lunch_admin" id="lunch_order_menu_control_suppliers" action="lunch_order_action_control_suppliers" />
+ <menuitem name="Control Vendors" parent="menu_lunch_admin" id="lunch_order_menu_control_suppliers" action="lunch_order_action_control_suppliers" />
<menuitem name="Control Accounts" parent="menu_lunch_admin" id="lunch_cashmove_report_menu_control_accounts" action="lunch_cashmove_report_action_control_accounts"/>
- <menuitem name="Employee Payments" parent="menu_lunch_admin" id="lunch_cashmove_report_menu_payment" action="lunch_cashmove_action_payment"/>
+ <menuitem name="Cash Moves" parent="menu_lunch_admin" id="lunch_cashmove_report_menu_payment" action="lunch_cashmove_action_payment"/>
<menuitem name="Settings" parent="menu_lunch_config" id="lunch_settings_menu" action="lunch_config_settings_action" sequence="1"/>
<menuitem name="Vendors" parent="menu_lunch_config" id="lunch_vendors_menu" action="lunch_vendors_action" sequence="2"/>