diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/lunch/views | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/lunch/views')
| -rw-r--r-- | addons/lunch/views/lunch_alert_views.xml | 120 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_cashmove_views.xml | 106 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_location_views.xml | 82 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_orders_views.xml | 251 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_product_views.xml | 390 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_supplier_views.xml | 123 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_templates.xml | 42 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_views.xml | 25 | ||||
| -rw-r--r-- | addons/lunch/views/res_config_settings.xml | 45 |
9 files changed, 1184 insertions, 0 deletions
diff --git a/addons/lunch/views/lunch_alert_views.xml b/addons/lunch/views/lunch_alert_views.xml new file mode 100644 index 00000000..27fa6d93 --- /dev/null +++ b/addons/lunch/views/lunch_alert_views.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="lunch_alert_view_search" model="ir.ui.view"> + <field name="name">lunch.alert.search</field> + <field name="model">lunch.alert</field> + <field name="arch" type="xml"> + <search string="Search"> + <field name="message"/> + <filter name="inactive_today" string="Currently inactive" domain="[('available_today', '=', False)]"/> + <separator/> + <filter name="active" string="Active" domain="[('active', '=', True)]"/> + <filter name="inactive" string="Archived" domain="[('active', '=', False)]"/> + </search> + </field> + </record> + + <record id="lunch_alert_view_tree" model="ir.ui.view"> + <field name="name">lunch.alert.tree</field> + <field name="model">lunch.alert</field> + <field name="arch" type="xml"> + <tree> + <field name="name"/> + <field name="mode"/> + <field name="message" invisible="1"/> + <field name="available_today"/> + <field name="active" widget="boolean_toggle"/> + </tree> + </field> + </record> + + <record id="lunch_alert_view_form" model="ir.ui.view"> + <field name="name">lunch.alert.form</field> + <field name="model">lunch.alert</field> + <field name="arch" type="xml"> + <form string="alert form"> + <sheet> + <div class="oe_title" name="title"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name"/> + </h1> + </div> + <group> + <group> + <field name="mode" widget="radio"/> + <field name="recipients" attrs="{'invisible': [['mode', '!=', 'chat']]}" widget="radio"/> + <field name="location_ids" widget="many2many_tags" required="1"/> + <field name="until"/> + <field name="active" widget="boolean_toggle"/> + </group> + <group> + <field name="recurrency_monday"/> + <field name="recurrency_tuesday"/> + <field name="recurrency_wednesday"/> + <field name="recurrency_thursday"/> + <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"/> + </group> + </group> + </sheet> + </form> + </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,kanban</field> + <field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field> + <field name="context">{}</field> + <field name="view_id" ref="lunch_alert_view_tree"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create new lunch alerts + </p> + </field> + </record> +</odoo> diff --git a/addons/lunch/views/lunch_cashmove_views.xml b/addons/lunch/views/lunch_cashmove_views.xml new file mode 100644 index 00000000..de3ad7ae --- /dev/null +++ b/addons/lunch/views/lunch_cashmove_views.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="lunch_cashmove_view_search" model="ir.ui.view"> + <field name='name'>lunch.cashmove.search</field> + <field name='model'>lunch.cashmove</field> + <field name='arch' type='xml'> + <search string="lunch employee payment"> + <field name="description"/> + <field name="user_id"/> + <filter name='is_mine_group' string="My Account grouped" domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/> + <filter name="group_by_user" string="By User" context="{'group_by':'user_id'}"/> + </search> + </field> + </record> + + <record id="lunch_cashmove_view_tree" model="ir.ui.view"> + <field name="name">lunch.cashmove.tree</field> + <field name="model">lunch.cashmove</field> + <field name="arch" type="xml"> + <tree string="cashmove tree"> + <field name="currency_id" invisible="1"/> + <field name="date"/> + <field name="user_id"/> + <field name="description"/> + <field name="amount" sum="Total" widget="monetary"/> + </tree> + </field> + </record> + + <record id="lunch_cashmove_view_form" model="ir.ui.view"> + <field name="name">lunch.cashmove.form</field> + <field name="model">lunch.cashmove</field> + <field name="arch" type="xml"> + <form string="cashmove form"> + <sheet> + <group> + <field name="currency_id" invisible="1"/> + <field name="user_id" required="1"/> + <field name="date"/> + <field name="amount" widget="monetary"/> + </group> + <label for='description'/> + <field name="description"/> + </sheet> + </form> + </field> + </record> + + <record id="view_lunch_cashmove_kanban" model="ir.ui.view"> + <field name="name">lunch.cashmove.kanban</field> + <field name="model">lunch.cashmove</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <field name="date"/> + <field name="user_id"/> + <field name="description"/> + <field name="amount"/> + <field name="currency_id" invisible="1"/> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_global_click"> + <div class="row mb4"> + <div class="col-8"> + <span> + <strong class="o_kanban_record_title"><t t-esc="record.description.value"/></strong> + </span> + </div> + <div class="col-4 text-right"> + <span class="badge badge-pill"> + <strong><i class="fa fa-money" role="img" aria-label="Amount" title="Amount"/> <field name="amount" widget="monetary"/></strong> + </span> + </div> + </div> + <div class="row"> + <div class="col-6"> + <i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/> + <t t-esc="record.date.value"/> + </div> + <div class="col-6"> + <div class="float-right"> + <field name="user_id" widget="many2one_avatar_user"/> + </div> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="lunch_cashmove_action_payment" model="ir.actions.act_window"> + <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"/> + <field name="view_id" ref="lunch_cashmove_view_tree"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Register a payment + </p><p> + Payments are used to register liquidity movements. You can process those payments by your own means or by using installed facilities. + </p> + </field> + </record> +</odoo> diff --git a/addons/lunch/views/lunch_location_views.xml b/addons/lunch/views/lunch_location_views.xml new file mode 100644 index 00000000..1a921732 --- /dev/null +++ b/addons/lunch/views/lunch_location_views.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="lunch_location_view_search" model="ir.ui.view"> + <field name="name">lunch.location.view.search</field> + <field name="model">lunch.location</field> + <field name="arch" type="xml"> + <search> + <field name="name"/> + <field name="address"/> + </search> + </field> + </record> + + <record id="lunch_location_form_view" model="ir.ui.view"> + <field name="name">lunch.location.view.form</field> + <field name="model">lunch.location</field> + <field name="arch" type="xml"> + <form> + <sheet> + <group> + <group> + <field name="name"/> + <field name="address"/> + <field name="company_id" groups="base.group_multi_company"/> + </group> + </group> + </sheet> + </form> + </field> + </record> + + <record id="lunch_location_tree_view" model="ir.ui.view"> + <field name="name">lunch.location.view.form</field> + <field name="model">lunch.location</field> + <field name="arch" type="xml"> + <tree editable="bottom"> + <field name="name"/> + <field name="address"/> + <field name="company_id" groups="base.group_multi_company"/> + </tree> + </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,kanban</field> + <field name="search_view_id" ref="lunch_location_view_search"/> + <field name="help" type="html"> + <!-- TODO: better help message --> + <p class="o_view_nocontent_smiling_face"> + To see some locations, create one using the create button + </p> + </field> + </record> +</odoo> diff --git a/addons/lunch/views/lunch_orders_views.xml b/addons/lunch/views/lunch_orders_views.xml new file mode 100644 index 00000000..9ea8265c --- /dev/null +++ b/addons/lunch/views/lunch_orders_views.xml @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="lunch_order_view_search" model="ir.ui.view"> + <field name="name">lunch.order.search</field> + <field name="model">lunch.order</field> + <field name="arch" type="xml"> + <search string="Search"> + <field name="name" string="Product" filter_domain="['|', ('name', 'ilike', self), ('note', 'ilike', self)]"/> + <field name="user_id"/> + <filter name='is_mine' string="My Orders" domain="[('user_id', '=', uid)]"/> + <separator/> + <filter name="not_confirmed" string="Not Received" domain="[('state', '!=', ('confirmed'))]"/> + <filter name="confirmed" string="Received" domain="[('state', '=', 'confirmed')]"/> + <filter name="cancelled" string="Cancelled" domain="[('state', '=', 'cancelled')]"/> + <separator/> + <filter name="date_filter" string="Today" domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]" /> + <separator/> + <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + <group expand="0" string="Group By"> + <filter name="group_by_user" string="User" context="{'group_by': 'user_id'}"/> + <filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/> + <filter name="group_by_date" string="Order Date" context="{'group_by': 'date:day'}" help="Vendor Orders by Date"/> + </group> + </search> + </field> + </record> + + <record id="lunch_order_view_tree" model="ir.ui.view"> + <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'" class="o_lunch_list"> + <header> + <button name="action_confirm" type="object" string="Receive"/> + </header> + <field name='date'/> + <field name='supplier_id' invisible='1'/> + <field name='product_id'/> + <field name="display_toppings" class="o_text_overflow"/> + <field name='note' class="o_text_overflow"/> + <field name='user_id'/> + <field name="currency_id" invisible="1"/> + <field name='price' sum="Total" string="Price" widget="monetary"/> + <field name='state'/> + <field name="company_id" groups="base.group_multi_company"/> + <button name="action_confirm" string="Confirm" type="object" icon="fa-check" attrs="{'invisible': [('state', '!=', 'ordered')]}" groups="lunch.group_lunch_manager"/> + <button name="action_cancel" string="Cancel" type="object" icon="fa-times" attrs="{'invisible': [('state', 'in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager"/> + </tree> + </field> + </record> + + <record id='lunch_order_view_kanban' model='ir.ui.view'> + <field name="name">lunch.order.kanban</field> + <field name="model">lunch.order</field> + <field name="arch" type="xml"> + <kanban create="false" edit="false"> + <field name="product_id"/> + <field name="note"/> + <field name="state"/> + <field name="user_id"/> + <field name="date"/> + <field name="price"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"><field name="product_id"/></strong> + </div> + <field name="state" widget="label_selection" options="{'classes': {'new': 'default', 'confirmed': 'success', 'cancelled':'danger'}}"/> + </div> + <div> + <field name="note"/> + </div> + <div class="row"> + <div class="col-6"> + <i class="fa fa-money" role="img" aria-label="Money" title="Money"/> <field name="price"/> + </div> + <div class="col-6 text-right"> + <i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/> <field name="date"/> + </div> + </div> + <div class="row mt4"> + <div class="col-6"> + <a class="btn btn-sm btn-success" role="button" name="action_order" string="Order" type="object" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}" groups="lunch.group_lunch_manager"> + <i class="fa fa-phone" role="img" aria-label="Order button" title="Order button"/> + </a> + <a class="btn btn-sm btn-info" role="button" name="action_confirm" string="Receive" type="object" attrs="{'invisible': [('state','!=','ordered')]}" groups="lunch.group_lunch_manager"> + <i class="fa fa-check" role="img" aria-label="Receive button" title="Receive button"/> + </a> + <a class="btn btn-sm btn-danger" role="button" name="action_cancel" string="Cancel" type="object" attrs="{'invisible': [('state','=','cancelled')]}" groups="lunch.group_lunch_manager"> + <i class="fa fa-times" role="img" aria-label="Cancel button" title="Cancel button"/> + </a> + </div> + <div class="col-6"> + <span class="float-right"> + <field name="user_id" widget="many2one_avatar_user"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="lunch_order_view_pivot" model="ir.ui.view"> + <field name="name">lunch.order.pivot</field> + <field name="model">lunch.order</field> + <field name="arch" type="xml"> + <pivot sample="1"> + <field name="date" type="col"/> + <field name="supplier_id" type="row"/> + </pivot> + </field> + </record> + + <record id="lunch_order_view_graph" model="ir.ui.view"> + <field name="name">lunch.order.graph</field> + <field name="model">lunch.order</field> + <field name="arch" type="xml"> + <graph sample="1"> + <field name="product_id" type="col"/> + </graph> + </field> + </record> + + <record id="lunch_order_action" model="ir.actions.act_window"> + <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, "search_default_group_by_date": 1}</field> + <field name="help" type="html"> + <p class="o_view_nocontent_empty_folder"> + No previous order found + </p><p> + There is no previous order recorded. Click on "My Lunch" and then create a new lunch order. + </p> + </field> + </record> + + <record id="lunch_order_action_by_supplier" model="ir.actions.act_window"> + <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"/> + <field name="context">{"search_default_group_by_supplier":1, "search_default_date_filter":1}</field> + <field name="help" type="html"> + <p class="o_view_nocontent_empty_folder"> + Nothing to order today + </p><p> + Here you can see today's orders grouped by vendors. + </p> + </field> + </record> + + <record id="lunch_order_action_control_suppliers" model="ir.actions.act_window"> + <field name="name">Control Vendors</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_group_by_supplier":1}</field> + <field name="help" type="html"> + <p class="o_view_nocontent_empty_folder"> + No lunch order yet + </p><p> + Summary of all lunch orders, grouped by vendor and by date. + </p><p> + Click on the <span class="fa fa-phone text-success" role="img" aria-label="Order button" title="Order button"/> to announce that the order is ordered.<br/> + Click on the <span class="fa fa-check text-success" role="img" aria-label="Receive button" title="Receive button"/> to announce that the order is received.<br/> + Click on the <span class="fa fa-times-circle text-danger" role="img" aria-label="Cancel button" title="Cancel button"/> red X to announce that the order isn't available. + </p> + </field> + </record> + + <record id="lunch_order_view_form" model="ir.ui.view"> + <field name="name">lunch.order.view.form</field> + <field name="model">lunch.order</field> + <field name="arch" type="xml"> + <form> + <field name="currency_id" invisible="1"/> + <field name="quantity" invisible="1"/> + <field name="product_id" invisible="1"/> + <field name="category_id" invisible="1"/> + <field name="available_toppings_1" invisible="1"/> + <field name="available_toppings_2" invisible="1"/> + <field name="available_toppings_3" invisible="1"/> + <div class="d-flex"> + <div class="flex-grow-0 pr-5"> + <field name="image_1920" widget="image" class="o_lunch_image" options="{'image_preview': 'image_128'}"/> + </div> + <div class="flex-grow-1 pr-5"> + <h2><field name="name"/></h2> + <h3 class="pt-3"><field name="price" widget="monetary"/></h3> + </div> + </div> + <div class="o_lunch_wizard"> + <div class="row"> + <div class="col-2"> + <field name="topping_label_1" nolabel="1" attrs="{'invisible': [('available_toppings_1', '=', False)]}" class="font-weight-bold"/> + </div> + <div class="col-10"> + <field name="topping_ids_1" attrs="{'invisible': [('available_toppings_1', '=', False)]}" widget="many2many_checkboxes" nolabel="1"/> + </div> + </div> + <div class="row"> + <div class="col-2"> + <field name="topping_label_2" nolabel="1" attrs="{'invisible': [('available_toppings_2', '=', False)]}" class="font-weight-bold"/> + </div> + <div class="col-10"> + <field name="topping_ids_2" attrs="{'invisible': [('available_toppings_2', '=', False)]}" widget="many2many_checkboxes" nolabel="1"/> + </div> + </div> + <div class="row"> + <div class="col-2"> + <field name="topping_label_3" nolabel="1" attrs="{'invisible': [('available_toppings_3', '=', False)]}" class="font-weight-bold"/> + </div> + <div class="col-10"> + <field name="topping_ids_3" attrs="{'invisible': [('available_toppings_3', '=', False)]}" widget="many2many_checkboxes" nolabel="1"/> + </div> + </div> + <div class="row"> + <div class="col-2"> + <label for="product_description" class="font-weight-bold"/> + </div> + <div class="col-10"> + <field name="product_description" nolabel="1"/> + </div> + </div> + <div class="row"> + <div class="col-2"> + <label for="note" class="font-weight-bold" /> + </div> + <div class="col-10"> + <field name="note" nolabel="1" placeholder="Information, allergens, ..." /> + </div> + </div> + </div> + <footer> + <button string="Save" special="save" class="oe_highlight" invisible="not context.get('active_id', False)"/> + <button string="Add To Cart" name="add_to_cart" type="object" class="oe_highlight" invisible="context.get('active_id', False)"/> + <button string="Discard" special="cancel"/> + </footer> + </form> + </field> + </record> + +</odoo> diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml new file mode 100644 index 00000000..99f002c9 --- /dev/null +++ b/addons/lunch/views/lunch_product_views.xml @@ -0,0 +1,390 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="lunch_product_view_search" model="ir.ui.view"> + <field name="name">lunch.product.search</field> + <field name="model">lunch.product</field> + <field name="arch" type="xml"> + <search string="Product Search"> + <field name="name" string="Product"/> + <field name="category_id" string="Category"/> + <field name="supplier_id"/> + <field name="description"/> + <separator/> + <filter name="inactive" string="Archived" domain="[('active', '=', False)]"/> + <group expand="0" string="Group By"> + <filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/> + <filter name="group_by_category" string="Category" context="{'group_by': 'category_id'}"/> + </group> + <searchpanel> + <field name="category_id" select="multi" string="Categories" icon="fa-cutlery" color="#875A7B" enable_counters="1"/> + <field name="supplier_id" select="multi" string="Vendors" icon="fa-truck" enable_counters="1"/> + </searchpanel> + </search> + </field> + </record> + + <record id="lunch_product_report_view_search" model="ir.ui.view"> + <field name="name">lunch.product.report.search</field> + <field name="model">lunch.product.report</field> + <field name="arch" type="xml"> + <search string="Product Search"> + <field name="name" string="Product"/> + <field name="category_id" string="Category"/> + <field name="supplier_id"/> + <field name="description"/> + <group expand="0" string="Group By"> + <filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/> + <filter name="group_by_category" string="Category" context="{'group_by': 'category_id'}"/> + </group> + <searchpanel> + <field name="category_id" select="multi" string="Categories" icon="fa-cutlery" color="#875A7B"/> + <field name="supplier_id" select="multi" string="Vendors" icon="fa-truck"/> + </searchpanel> + </search> + </field> + </record> + + <record id="lunch_product_view_tree" model="ir.ui.view"> + <field name="name">lunch.product.tree</field> + <field name="model">lunch.product</field> + <field name="arch" type="xml"> + <tree string="Products Tree"> + <field name="currency_id" invisible="1"/> + <field name="name"/> + <field name="category_id"/> + <field name="supplier_id"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="description"/> + <field name="price" widget="monetary"/> + </tree> + </field> + </record> + + <record id="lunch_product_view_form" model="ir.ui.view"> + <field name="name">lunch.product.form</field> + <field name="model">lunch.product</field> + <field name="arch" type="xml"> + <form string="Products Form"> + <field name="currency_id" invisible="1"/> + <sheet> + <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> + <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/> + <div class="oe_title"> + <label for="name" class="oe-edit-only"/> + <h1> + <field name='name'/> + </h1> + </div> + <group> + <group> + <field name="active" invisible="1"/> + <field name='category_id'/> + <field name='supplier_id'/> + <field name='price' widget="monetary"/> + </group> + <group> + <field name="new_until"/> + <field name='description'/> + <field name="company_id" groups="base.group_multi_company"/> + </group> + </group> + </sheet> + </form> + </field> + </record> + <record id="lunch_product_report_view_tree" model="ir.ui.view"> + <field name="name">lunch.product.tree</field> + <field name="model">lunch.product.report</field> + <field name="priority">999</field> + <field name="arch" type="xml"> + <tree js_class="lunch_list"> + <field name="name"/> + <field name="category_id"/> + <field name="supplier_id"/> + <field name="description"/> + <field name="product_id" invisible="1"/> + <field name="price" widget="monetary"/> + <field name="currency_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="view_lunch_product_kanban_order" model="ir.ui.view"> + <field name="name">lunch.product.kanban</field> + <field name="model">lunch.product.report</field> + <field name="priority">999</field> + <field name="arch" type="xml"> + <kanban js_class="lunch_kanban" create="0" edit="0" group_create="0" class="o_kanban_mobile"> + <field name="id"/> + <field name="name"/> + <field name="category_id"/> + <field name="supplier_id"/> + <field name="description"/> + <field name="currency_id"/> + <field name="user_id"/> + <field name="product_id"/> + <field name="is_new"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record"> + <field name="image_128" class="o_lunch_image o_kanban_image_fill_left d-none d-md-block" options="{'placeholder': '/lunch/static/img/lunch.png', 'size': [94, 94]}" widget="image"/> + <div class="oe_kanban_details ml8"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"> + <div> + <span class="pr-1"><field name="is_favorite" widget="boolean_favorite" nolabel="1"/></span> + <div class="float-right o_lunch_purple"> + <field name="price" widget="monetary"/> + </div> + <div t-if="record.is_new.raw_value" class="float-right o_lunch_new_product mr-1 badge-pill badge-success"> + New + </div> + <strong><span t-esc="record.name.value"/></strong> + </div> + </strong> + <span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span> + </div> + </div> + <div class="o_kanban_record_bottom"> + <ul> + <li t-esc="record.description.value" class="text-muted"/> + </ul> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="view_lunch_product_kanban" model="ir.ui.view"> + <field name="name">lunch.product.kanban</field> + <field name="model">lunch.product</field> + <field name="priority">5</field> + <field name="arch" type="xml"> + <kanban create="1" edit="0" class="o_kanban_mobile"> + <field name="id"/> + <field name="name"/> + <field name="category_id"/> + <field name="supplier_id"/> + <field name="description"/> + <field name="currency_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', 'image_128', record.id.raw_value)}')"/> + <div class="oe_kanban_details"> + <div class="o_kanban_record_top"> + <div class="o_kanban_record_headings"> + <strong class="o_kanban_record_title"> + <div> + <div class="float-right"> + <field name="price" widget="monetary"/> + </div> + <strong><span t-esc="record.name.value"/></strong> + </div> + </strong> + <span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span> + </div> + </div> + <div class="o_kanban_record_bottom"> + <ul> + <li t-esc="record.description.value" class="text-muted"/> + </ul> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <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">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"> + Create a new product for lunch + </p><p> + A product is defined by its name, category, price and vendor. + </p> + </field> + </record> + + <record id="lunch_product_category_view_tree" model="ir.ui.view"> + <field name="name">Product category Tree</field> + <field name="model">lunch.product.category</field> + <field name="arch" type="xml"> + <tree string="Products List"> + <field name='name' string="Product Category"/> + <field name="company_id" groups="base.group_multi_company"/> + </tree> + </field> + </record> + + <record id="lunch_product_category_view_form" model="ir.ui.view"> + <field name="name">Product category Form</field> + <field name="model">lunch.product.category</field> + <field name="arch" type="xml"> + <form string="Product Categories Form"> + <sheet> + <div class="oe_button_box" name="button_box"> + <button class="oe_stat_button" 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)]}" + icon="fa-cutlery"> + <field string="Products" name="product_count" widget="statinfo"/> + </button> + </div> + <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/> + <div class="oe_title"> + <label for="name" class="oe-edit-only"/> + <h1> + <field name="name"/> + </h1> + </div> + <label for="company_id" groups="base.group_multi_company"/> + <field name="company_id" groups="base.group_multi_company"/> + <group> + <group> + <field name="active" invisible="1"/> + <field name="topping_label_1"/> + <field name="topping_quantity_1"/> + </group> + <div> + <field name="topping_ids_1" nolabel="1"> + <tree editable="bottom"> + <field name="name"/> + <field name="currency_id" invisible="1"/> + <field name="price" widget="monetary"/> + </tree> + </field> + </div> + <group> + <field name="topping_label_2"/> + <field name="topping_quantity_2"/> + </group> + <div> + <field name="topping_ids_2" nolabel="1"> + <tree editable="bottom"> + <field name="name"/> + <field name="currency_id" invisible="1"/> + <field name="price" widget="monetary"/> + </tree> + </field> + </div> + <group> + <field name="topping_label_3"/> + <field name="topping_quantity_3"/> + </group> + <div> + <field name="topping_ids_3" nolabel="1"> + <tree editable="bottom"> + <field name="name"/> + <field name="currency_id" invisible="1"/> + <field name="price" widget="monetary"/> + </tree> + </field> + </div> + </group> + </sheet> + </form> + </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_category_view_search" model="ir.ui.view"> + <field name="name">lunch.product.category.search</field> + <field name="model">lunch.product.category</field> + <field name="arch" type="xml"> + <search> + <field name="name"/> + <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + </search> + </field> + </record> + + <record id="lunch_product_action" 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="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new product for lunch + </p><p> + A product is defined by its name, category, price and vendor. + </p> + </field> + </record> + + <record id="lunch_product_action_order" model="ir.actions.act_window"> + <field name="name">Order Your Lunch</field> + <field name="res_model">lunch.product.report</field> + <field name="view_mode">kanban,tree</field> + <field name="view_id" ref="view_lunch_product_kanban_order"/> + <field name="search_view_id" ref="lunch_product_report_view_search"/> + <field name="domain">[('supplier_id.available_today', '=', True), '|', ('user_id', '=', False), ('user_id', '=', uid)]</field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + There is no product available today + </p><p> + To see some products, check if your vendors are available today and that you have configured some products + </p> + </field> + </record> + + <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,kanban</field> + <field name="search_view_id" ref="lunch_product_category_view_search"/> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Create a new product category + </p><p> + Here you can access all categories for the lunch products. + </p> + </field> + </record> +</odoo> diff --git a/addons/lunch/views/lunch_supplier_views.xml b/addons/lunch/views/lunch_supplier_views.xml new file mode 100644 index 00000000..73393736 --- /dev/null +++ b/addons/lunch/views/lunch_supplier_views.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="lunch_supplier_view_tree" model="ir.ui.view"> + <field name="name">lunch.supplier.view.tree</field> + <field name="model">lunch.supplier</field> + <field name="arch" type="xml"> + <tree> + <field name="name"/> + <field name="phone" class="o_force_ltr"/> + <field name="email"/> + </tree> + </field> + </record> + + <record id="lunch_supplier_view_form" model="ir.ui.view"> + <field name="name">lunch.supplier.view.form</field> + <field name="model">lunch.supplier</field> + <field name="arch" type="xml"> + <form> + <sheet> + <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> + <div class="oe_title"> + <label for="name" class="oe_edit_only"/> + <h1><field name="name" required="1"/></h1> + </div> + <group> + <group> + <field name="partner_id" context="{'default_is_company': True, 'default_city': city, 'default_name': name, 'default_street': street, 'default_street2': street2, 'default_state_id': state_id, 'default_zip': zip_code, 'default_country_id': country_id, 'default_phone': phone}"/> + <label for="street" string="Address"/> + <div class="o_address_format"> + <field name="street" placeholder="Street..." class="o_address_street"/> + <field name="street2" placeholder="Street 2..." class="o_address_street"/> + <field name="city" placeholder="City" class="o_address_city"/> + <field name="state_id" class="o_address_state" placeholder="State" options="{'no_open': True}" context="{'country_id': country_id, 'zip': zip_code}"/> + <field name="zip_code" placeholder="ZIP" class="o_address_zip"/> + <field name="country_id" placeholder="Country" class="o_address_country" options="{'no_open': True, 'no_create': True}"/> + </div> + </group> + <group> + <field name="active" invisible="1"/> + <field name="email" attrs="{'required': [('send_by', '=', 'mail')]}"/> + <field name="phone" class="o_force_ltr" attrs="{'required': [('send_by', '=', 'phone')]}"/> + <field name="company_id" groups="base.group_multi_company"/> + <field name="responsible_id" attrs="{'required': [('send_by', '=', 'mail')]}" groups="base.group_no_one" domain="[('share', '=', False)]"/> + </group> + </group> + <group> + <group string="Availability"> + <field name="tz" groups="base.group_no_one"/> + <field name="recurrency_monday"/> + <field name="recurrency_tuesday"/> + <field name="recurrency_wednesday"/> + <field name="recurrency_thursday"/> + <field name="recurrency_friday"/> + <field name="recurrency_saturday"/> + <field name="recurrency_sunday"/> + <field name="recurrency_end_date" groups="base.group_no_one"/> + </group> + <group string="Orders"> + <field name="delivery"/> + <field name="available_location_ids" widget="many2many_tags"/> + <field name="send_by" widget="radio"/> + <label for="automatic_email_time" attrs="{'invisible': [('send_by', '!=', 'mail')]}"/> + <div class="o_row" attrs="{'invisible': [('send_by', '!=', 'mail')]}"><field name="automatic_email_time" widget="float_time"/> <field name="moment"/></div> + </group> + </group> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" groups="base.group_user"/> + <field name="activity_ids"/> + <field name="message_ids"/> + </div> + </form> + </field> + </record> + + <record id="lunch_supplier_view_kanban" model="ir.ui.view"> + <field name="name">lunch.supplier.view.kanban</field> + <field name="model">lunch.supplier</field> + <field name="arch" type="xml"> + <kanban> + <field name="partner_id"/> + <field name="city"/> + <field name="country_id"/> + <field name="email"/> + <templates> + <t t-name="kanban-box"> + <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban"> + <div class="oe_kanban_details"> + <strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong> + <ul> + <li t-if="record.city.raw_value and !record.country_id.raw_value"><field name="city"/></li> + <li t-if="!record.city.raw_value and record.country_id.raw_value"><field name="country_id"/></li> + <li t-if="record.city.raw_value and record.country_id.raw_value"><field name="city"/>, <field name="country_id"/></li> + <li t-if="record.email.raw_value" class="o_text_overflow"><field name="email"/></li> + </ul> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="lunch_supplier_view_search" model="ir.ui.view"> + <field name="name">lunch.supplier.view.search</field> + <field name="model">lunch.supplier</field> + <field name="arch" type="xml"> + <search> + <field name="name"/> + <separator/> + <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> + </search> + </field> + </record> + + <record id="lunch_vendors_action" model="ir.actions.act_window"> + <field name="name">Vendors</field> + <field name="res_model">lunch.supplier</field> + <field name="view_mode">kanban,tree,form</field> + <field name="search_view_id" ref="lunch_supplier_view_search"/> + </record> +</odoo> diff --git a/addons/lunch/views/lunch_templates.xml b/addons/lunch/views/lunch_templates.xml new file mode 100644 index 00000000..ff943deb --- /dev/null +++ b/addons/lunch/views/lunch_templates.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <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_view.scss"/> + <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_controller_common.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_widget.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_mobile.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_payment_dialog.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_kanban_view.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_kanban_controller.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_kanban_renderer.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_kanban_record.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_model_extension.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_list_view.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_list_controller.js"></script> + <script type="text/javascript" src="/lunch/static/src/js/lunch_list_renderer.js"></script> + </xpath> + </template> + + <template id="qunit_suite" name="lunch tests" inherit_id="web.qunit_suite_tests"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/lunch/static/tests/lunch_test_utils.js"></script> + <script type="text/javascript" src="/lunch/static/tests/lunch_kanban_tests.js"></script> + <script type="text/javascript" src="/lunch/static/tests/lunch_list_tests.js"></script> + </xpath> + </template> + + <template id="qunit_mobile_suite" name="lunch mobile tests" inherit_id="web.qunit_mobile_suite_tests"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/lunch/static/tests/lunch_test_utils.js"></script> + <script type="text/javascript" src="/lunch/static/tests/lunch_kanban_mobile_tests.js"></script> + </xpath> + </template> + + <template id="lunch_payment_dialog" name="Lunch Payment Dialog"> + To add some money to your wallet, please contact your lunch manager. + </template> +</odoo> diff --git a/addons/lunch/views/lunch_views.xml b/addons/lunch/views/lunch_views.xml new file mode 100644 index 00000000..4a720e8f --- /dev/null +++ b/addons/lunch/views/lunch_views.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <!-- Top menu item --> + <menuitem id='menu_lunch' name='Lunch' sequence="105" groups="group_lunch_user" web_icon="lunch,static/description/icon.png"> + <menuitem name="My Lunch" id="menu_lunch_title" sequence="50"> + <menuitem name="New Order" id="lunch_order_menu_form" action="lunch.lunch_product_action_order" sequence="1"/> + <menuitem name="My Order History" id="lunch_order_menu_tree" action="lunch_order_action" sequence="2"/> + <menuitem name="My Account History" id="lunch_cashmove_report_menu_form" action="lunch_cashmove_report_action_account" sequence="3"/> + </menuitem> + <menuitem name="Manager" id="menu_lunch_admin" sequence="51" groups="group_lunch_manager"> + <menuitem name="Today's Orders" id="lunch_order_menu_by_supplier" action="lunch_order_action_by_supplier" /> + <menuitem name="Control Vendors" id="lunch_order_menu_control_suppliers" action="lunch_order_action_control_suppliers" /> + <menuitem name="Control Accounts" id="lunch_cashmove_report_menu_control_accounts" action="lunch_cashmove_report_action_control_accounts"/> + <menuitem name="Cash Moves" id="lunch_cashmove_report_menu_payment" action="lunch_cashmove_action_payment"/> + </menuitem> + <menuitem name="Configuration" id="menu_lunch_config" sequence="53" groups="group_lunch_manager"> + <menuitem name="Settings" id="lunch_settings_menu" action="lunch_config_settings_action" sequence="1"/> + <menuitem name="Vendors" id="lunch_vendors_menu" action="lunch_vendors_action" sequence="2"/> + <menuitem name="Locations" id="lunch_location_menu" action="lunch_location_action" sequence="3"/> + <menuitem name="Products" id="lunch_product_menu" action="lunch_product_action" sequence="4"/> + <menuitem name="Product Categories" id="lunch_product_category_menu" action="lunch_product_category_action" sequence="5"/> + <menuitem name="Alerts" id="lunch_alert_menu" action="lunch_alert_action" sequence="6"/> + </menuitem> + </menuitem> +</odoo> diff --git a/addons/lunch/views/res_config_settings.xml b/addons/lunch/views/res_config_settings.xml new file mode 100644 index 00000000..27e79e30 --- /dev/null +++ b/addons/lunch/views/res_config_settings.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.inherit.lunch</field> + <field name="model">res.config.settings</field> + <field name="priority" eval="90"/> + <field name="inherit_id" ref="base.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//div[hasclass('settings')]" position="inside"> + <div class="app_settings_block" data-string="Lunch" string="Lunch" data-key="lunch" groups="lunch.group_lunch_manager"> + <field name="currency_id" invisible="1"/> + <h2>Lunch</h2> + <div class="row mt16 o_settings_container" name="lunch_overdraft_setting_container"> + <div class="col-12 col-lg-6 o_setting_box" id="lunch_minimum_threshold" + title="None"> + <div class="o_setting_right_pane"> + <span class="o_form_label">Lunch Overdraft</span> + <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/> + <div class="text-muted"> + Maximum overdraft that your employees can reach + </div> + <div class="content-group"> + <div class="mt16 row"> + <label for="company_lunch_minimum_threshold" string="Overdraft" class="col-3 col-lg-3 o_light_label"/> + <field name="company_lunch_minimum_threshold" widget="monetary"/> + </div> + </div> + </div> + </div> + </div> + </div> + </xpath> + </field> + </record> + + <record id="lunch_config_settings_action" model="ir.actions.act_window"> + <field name="name">Settings</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">res.config.settings</field> + <field name="view_id" ref="res_config_settings_view_form"/> + <field name="view_mode">form</field> + <field name="target">inline</field> + <field name="context">{'module' : 'lunch', 'bin_size': False}</field> + </record> +</odoo> |
