<?xml version="1.0"?>
<openerp>
<data>
- <menuitem name="Lunch Order" parent="base.menu_tools"
- id="menu_lunch" sequence="1" />
-
- <menuitem name="Reporting" parent="base.menu_tools"
- id="base.menu_lunch_reporting" sequence="6" groups="base.group_tool_manager"/>
-
- <menuitem name="Lunch"
- parent="base.menu_reporting"
- id="menu_lunch_reporting_order" sequence="55" />
-
- <menuitem name="Configuration" parent="base.menu_tools"
- id="base.menu_lunch_survey_root" sequence="20" groups="base.group_tool_manager"/>
-
- <menuitem name="Lunch" parent="base.menu_lunch_survey_root"
- id="menu_lunch_category_root_configuration" sequence="1" />
-
-<!-- Lunch order Form view -->
-
- <record model="ir.ui.view" id="view_lunch_order_form">
- <field name="name">Order</field>
- <field name="model">lunch.order</field>
+ <!-- Top menu item -->
+ <menuitem id='menu_lunch' name='Lunch' sequence="100" groups="group_lunch_user"/>
+ <menuitem name="Lunch" parent="menu_lunch" id="menu_lunch_title" sequence="50" />
+ <menuitem name="Administrate Orders" parent="menu_lunch" id="menu_lunch_admin" sequence="51" groups="group_lunch_manager"/>
+ <menuitem name="Administrate Cash Moves" parent="menu_lunch" id="menu_lunch_cash" sequence="52" groups="group_lunch_manager"/>
+ <menuitem name="Configuration" parent="menu_lunch" id="menu_lunch_config" sequence="53" groups="group_lunch_manager"/>
+
+ <!--View Search to group/filter by Supplier and time-->
+ <record model="ir.ui.view" id="lunch_order_line_search_view">
+ <field name="name">Search</field>
+ <field name="model">lunch.order.line</field>
<field name="arch" type="xml">
- <form version="7.0">
- <header>
- <button name="%(action_lunch_order_confirm)d" string="Confirm Order" type="action" attrs="{'invisible':[('state','=','confirmed')]}"/>
- <button name="%(action_lunch_order_cancel)d" string="Cancel Order" type="action"/>
- <field name="state" widget="statusbar" statusbar_visible="draft,confirmed"/>
- </header>
- <sheet string="Order">
- <group>
- <group>
- <field name="product" on_change="onchange_product(product)"/>
- <field name="descript"/>
- <field name="price"/>
- <field name="category"/>
- </group>
- <group>
- <field name="user_id"/>
- <field name="cashmove"/>
- <field name="date"/>
- </group>
+ <search string="Search">
+ <field name="name" filter_domain="['|', ('name', 'ilike', self), ('note', 'ilike', self)]"/>
+ <filter name="not_confirmed" string="Not Received" domain="[('state','!=',('confirmed'))]"/>
+ <filter name="comfirmed" string="Received" domain="[('state','=','confirmed')]"/>
+ <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
+ <separator/>
+ <filter name="today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
+ <field name="user_id"/>
+ <group expand="0" string="Group By...">
+ <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
+ <filter name="group_by_date" string="Order Month" context="{'group_by':'date'}" help="Supplier Order by Month"/>
</group>
- </sheet>
- </form>
+ </search>
</field>
</record>
-<!-- Lunch order Tree view -->
-
- <record model="ir.ui.view" id="view_lunch_order_tree">
- <field name="name">Order</field>
- <field name="model">lunch.order</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree colors="blue:state == 'draft';black:state == 'confirmed'" string="Order">
- <field name="date"/>
+ <!--View Search to group by employee and input/output (cashmoves)-->
+ <record id="view_lunch_employee_payment_filter" model="ir.ui.view">
+ <field name='name'>lunch employee payment</field>
+ <field name='model'>lunch.cashmove</field>
+ <field name='arch' type='xml'>
+ <search string="lunch employee payment">
+ <field name="description"/>
<field name="user_id"/>
- <field name="product"/>
- <field name="descript"/>
- <field name="category"/>
- <field name="price" sum="Total price"/>
- <field name="state"/>
- </tree>
+ <filter name='is_payment' string="Payment" domain="[('state','=','payment')]"/>
+ <separator/>
+ <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>
-<!-- Lunch order Search view -->
-
- <record id="view_lunch_order_filter" model="ir.ui.view">
- <field name="name">lunch.order.list.select</field>
- <field name="model">lunch.order</field>
- <field name="type">search</field>
- <field name="arch" type="xml">
- <search string="Search Lunch Order">
- <field name="date"/>
- <separator orientation="vertical"/>
- <filter icon="terp-check" string="To Confirm" domain="[('state','=','draft')]"/>
- <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=',('confirmed'))]"/>
- <separator orientation="vertical"/>
+ <record id="view_lunch_cashmove_filter" model="ir.ui.view">
+ <field name='name'>lunch cashmove</field>
+ <field name='model'>lunch.cashmove</field>
+ <field name='arch' type='xml'>
+ <search string="lunch cashmove">
+ <field name="description"/>
<field name="user_id"/>
- <newline/>
<group expand="0" string="Group By...">
- <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'category'}"/>
+ <filter name='group_by_user' string="By Employee" context="{'group_by':'user_id'}"/>
</group>
</search>
</field>
</record>
-<!-- Lunch order Action -->
-
- <record model="ir.actions.act_window" id="action_lunch_order_form">
- <field name="name">Lunch Orders</field>
- <field name="res_model">lunch.order</field>
- <field name="view_mode">tree,form</field>
- <field name="search_view_id" ref="view_lunch_order_filter"/>
- <field name="context">{"search_default_Today":1}</field>
+ <!--View search for order-->
+ <record id="view_search_my_order" model="ir.ui.view">
+ <field name='name'>lunch orders</field>
+ <field name='model'>lunch.order</field>
+ <field name='arch' type='xml'>
+ <search string="lunch orders">
+ <field name="user_id"/>
+ <field name="date"/>
+ <field name="order_line_ids"/>
+ <filter name='is_mine' string="My Orders" domain="[('user_id','=',uid)]"/>
+ <filter name='by_users' string="Users" context="{'group_by':'user_id'}"/>
+ </search>
+ </field>
</record>
- <menuitem name="Lunch Orders" parent="menu_lunch"
- id="menu_lunch_order_form" action="action_lunch_order_form" />
-<!-- Cash Box Form view -->
-
- <record model="ir.ui.view" id="view_lunch_cashbox_form">
- <field name="name">Cashboxes</field>
- <field name="model">lunch.cashbox</field>
+ <record model="ir.ui.view" id="alert_search_view">
+ <field name="name">Search</field>
+ <field name="model">lunch.alert</field>
<field name="arch" type="xml">
- <form string="Cashboxes" version="7.0">
- <group>
- <field name="name"/>
- <field name="manager"/>
- </group>
- </form>
+ <search string="Search">
+ <field name="message"/>
+ </search>
</field>
</record>
-<!-- Cash Box Tree view -->
-
- <record model="ir.ui.view" id="view_lunch_cashbox_tree">
- <field name="name">Cashboxes</field>
- <field name="model">lunch.cashbox</field>
- <field name="type">tree</field>
+ <!--view for cashmove-->
+ <record model="ir.ui.view" id="casmove_tree_view">
+ <field name="name">cashmove tree</field>
+ <field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
- <tree string="Cashboxes" colors="red:sum_remain<=0">
- <field name="name"/>
- <field name="manager"/>
- <field name="sum_remain"/>
+ <tree string="cashmove tree">
+ <field name="date"/>
+ <field name="user_id"/>
+ <field name="description"/>
+ <field name="amount" sum="Total"/>
</tree>
</field>
</record>
-<!-- Cash Box Action -->
-
- <record model="ir.actions.act_window" id="action_lunch_cashbox_form">
- <field name="name"> Cashboxes </field>
- <field name="res_model">lunch.cashbox</field>
- </record>
-
- <menuitem name="Cashboxes"
- parent="menu_lunch_category_root_configuration"
- id="menu_lunch_cashbox_form"
- action="action_lunch_cashbox_form" />
-
-<!-- Cash Move Form view -->
-
- <record model="ir.ui.view" id="view_lunch_cashmove_form">
- <field name="name">CashMove</field>
+ <record model="ir.ui.view" id="casmove_form_view">
+ <field name="name">cashmove form</field>
<field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
- <form string="CashMove" version="7.0">
- <group col="4">
- <field name="name"/>
- <field name="user_cashmove"/>
- <field name="amount"/>
- <field name="box"/>
- <field name="create_date"/>
- <field name="active"/>
- </group>
+ <form string="cashmove form" version="7.0">
+ <sheet>
+ <group>
+ <field name="user_id"
+ context="{'default_groups_ref': ['base.group_user', 'lunch.group_lunch_user']}"/>
+ <field name="date"/>
+ <field name="amount"/>
+ </group>
+ <label for='description'/>
+ <field name="description"/>
+ </sheet>
</form>
</field>
</record>
-<!-- Cash Move Tree view -->
- <record model="ir.ui.view" id="view_lunch_cashmove_tree">
- <field name="name">CashMove</field>
+ <!--Action for Your Orders-->
+ <record model="ir.actions.act_window" id="action_lunch_order_form">
+ <field name="name">New Order</field>
+ <field name="res_model">lunch.order</field>
+ <field name="view_mode">form</field>
+ </record>
+ <menuitem name="New Order" parent="menu_lunch_title" id="menu_lunch_order_form" action="action_lunch_order_form" sequence="1"/>
+
+ <record model="ir.actions.act_window" id="action_lunch_order_tree">
+ <field name="name">Your Orders</field>
+ <field name="res_model">lunch.order</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_search_my_order"/>
+ <field name="context">{"search_default_is_mine":1}</field>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a lunch order.
+ </p>
+ <p>
+ A lunch order is defined by its user, date and order lines.
+ Each order line corresponds to a product, an additional note and a price.
+ Before selecting your order lines, don't forget to read the warnings displayed in the reddish area.
+ </p>
+ </field>
+ </record>
+ <menuitem name="Previous Orders" parent="menu_lunch_title" id="menu_lunch_order_tree" action="action_lunch_order_tree" sequence="2"/>
+
+ <record model="ir.ui.view" id="casmove_tree">
+ <field name="name">cashmove tree</field>
<field name="model">lunch.cashmove</field>
- <field name="type">tree</field>
<field name="arch" type="xml">
- <tree string="CashMove" editable="top">
- <field name="create_date"/>
- <field name="box"/>
- <field name="name" required="1"/>
- <field name="user_cashmove"/>
- <field name="amount" sum="Total amount"/>
+ <tree string="cashmove tree" version="7.0" create='false'>
+ <field name="date"/>
+ <field name="user_id"/>
+ <field name="description"/>
+ <field name="amount" sum="Total"/>
</tree>
</field>
</record>
-<!-- Cash Move Search View -->
+ <!--Action for Lunch cashmoves-->
+ <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
+ <field name="name">Your Account</field>
+ <field name="res_model">lunch.cashmove</field>
+ <field name="view_mode">tree</field>
+ <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
+ <field name="context">{"search_default_is_mine_group":1}</field>
+ <field name="view_id" ref="casmove_tree"/>
+ <field name="help" type="html">
+ <p>
+ Here you can see your cash moves.<br/>A cash moves can be either an expense or a payment.
+ An expense is automatically created when an order is received while a payment is a reimbursement to the company encoded by the manager.
+ </p>
+ </field>
+ </record>
+ <menuitem name="Your Lunch Account" parent="menu_lunch_title" id="menu_lunch_cashmove_form" action="action_lunch_cashmove_form" sequence="3"/>
+
+ <!--Action for Administrate Orders group by supplier-->
+ <record model="ir.actions.act_window" id="action_lunch_order_by_supplier_form">
+ <field name="name">Orders by Supplier</field>
+ <field name="res_model">lunch.order.line</field>
+ <field name="view_mode">tree</field>
+ <field name="search_view_id" ref="lunch_order_line_search_view"/>
+ <field name="context">{"search_default_group_by_supplier":1, "search_default_today":1}</field>
+ <field name="help" type="html">
+ <p>
+ Here you can see today's orders grouped by suppliers.
+ </p>
+ <p>
+ - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
+ - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
+ - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> to announce that the order isn't available
+ </p>
+ </field>
+ </record>
+ <menuitem name="Today's Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_order_by_supplier_form" action="action_lunch_order_by_supplier_form" />
+
+ <!--Action for control Supplier-->
+ <record model="ir.actions.act_window" id="action_lunch_control_suppliers">
+ <field name="name">Control Suppliers</field>
+ <field name="res_model">lunch.order.line</field>
+ <field name="view_mode">tree</field>
+ <field name="search_view_id" ref="lunch_order_line_search_view"/>
+ <field name="context">{"search_default_group_by_date":1, "search_default_group_by_supplier":1}</field>
+ <field name="help" type="html">
+ <p>
+ Here you can see every orders grouped by suppliers and by date.
+ </p>
+ <p>
+ - Click on the <img src="../../../web/static/src/img/icons/terp-call-start.png"/> to announce that the order is ordered <br/>
+ - Click on the <img src="../../../web/static/src/img/icons/gtk-apply.png"/> to announce that the order is received <br/>
+ - Click on the <img src="../../../web/static/src/img/icons/gtk-cancel.png"/> red X to announce that the order isn't available
+ </p>
+ </field>
+ </record>
+ <menuitem name="Orders by Supplier" parent="menu_lunch_admin" id="menu_lunch_control_suppliers" action="action_lunch_control_suppliers" />
- <record id="view_lunch_cashmove_filter" model="ir.ui.view">
- <field name="name">lunch.cashmove.list.select</field>
- <field name="model">lunch.cashmove</field>
- <field name="type">search</field>
- <field name="arch" type="xml">
- <search string="Search CashMove">
- <field name="create_date"/>
- <field name="user_cashmove"/>
- <newline/>
- <group expand="0" string="Group By...">
- <filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_cashmove'}"/>
- <separator orientation="vertical"/>
- <filter string="Box" icon="terp-dolar" domain="[]" context="{'group_by':'box'}"/>
- <separator orientation="vertical"/>
- <filter string="Date" icon="terp-go-today" domain="[]" context="{'group_by':'create_date'}"/>
- </group>
- </search>
+ <!--Action for Control Accounts-->
+ <record model="ir.actions.act_window" id="action_lunch_control_accounts">
+ <field name="name">Control Accounts</field>
+ <field name="res_model">lunch.cashmove</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
+ <field name="context">{"search_default_group_by_user":1}</field>
+ <field name="view_id" ref="casmove_tree_view"/>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a new payment.
+ </p>
+ <p>
+ A cashmove can either be an expense or a payment.<br/>
+ An expense is automatically created at the order receipt.<br/>
+ A payment represents the employee reimbursement to the company.
+ </p>
</field>
</record>
+ <menuitem name="Control Accounts" parent="menu_lunch_cash" id="menu_lunch_control_accounts" action="action_lunch_control_accounts" />
-<!-- Cash Move Action -->
- <record model="ir.actions.act_window" id="action_lunch_cashmove_form">
- <field name="name">Cash Moves</field>
- <field name="res_model">lunch.cashmove</field>
- <field name="search_view_id" ref="view_lunch_cashmove_filter"/>
- <field name="context">{"search_default_Today":1}</field>
+ <!--Action for Payment cashmove-->
+ <record model="ir.actions.act_window" id="action_lunch_cashmove">
+ <field name="name">Register Cash Moves</field>
+ <field name="res_model">lunch.cashmove</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="view_lunch_employee_payment_filter"/>
+ <field name="context">{"search_default_is_payment":1}</field>
+ <field name="view_id" ref="casmove_tree_view"/>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a payment.
+ </p>
+ <p>
+ Here you can see the employees' payment. A payment is a cash move from the employee to the company.
+ </p>
+ </field>
</record>
+ <menuitem name="Employee Payments" parent="menu_lunch_cash" id="menu_lunch_cashmove" action="action_lunch_cashmove" />
- <menuitem name="Cash Moves" parent="menu_lunch"
- id="menu_lunch_cashmove_form"
- action="action_lunch_cashmove_form" />
+ <!--Action for Products-->
+ <record model="ir.actions.act_window" id="action_lunch_products">
+ <field name="name">Products</field>
+ <field name="res_model">lunch.product</field>
+ <field name="view_mode">tree,form</field>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a product for lunch.
+ </p>
+ <p>
+ A product is defined by its name, category, price and supplier.
+ </p>
+ </field>
+ </record>
+ <menuitem name="Products" parent="menu_lunch_config" id="menu_lunch_products" action="action_lunch_products" />
-<!-- Lunch Category Form view -->
+ <!--Action for Product categories-->
+ <record model="ir.actions.act_window" id="action_lunch_product_categories">
+ <field name="name">Product Categories</field>
+ <field name="res_model">lunch.product.category</field>
+ <field name="view_mode">tree,form</field>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a lunch category.
+ </p>
+ <p>
+ Here you can find every lunch categories for products.
+ </p>
+ </field>
+ </record>
- <record model="ir.ui.view" id="view_lunch_category_form">
- <field name="name"> Category of product </field>
- <field name="model">lunch.category</field>
+ <record model="ir.ui.view" id="product_category_form_view">
+ <field name="name">Product category Form</field>
+ <field name="model">lunch.product.category</field>
<field name="arch" type="xml">
- <form string="Category" version="7.0">
- <group col="4">
- <field name="name"/>
+ <form string="Products Form" version="7.0">
+ <sheet>
+ <group>
+ <field name='name' string="Product Category: "/>
</group>
+ </sheet>
</form>
</field>
</record>
-<!-- Lunch Category Tree view -->
+ <menuitem name="Product Categories" parent="menu_lunch_config" id="menu_lunch_product_categories" action="action_lunch_product_categories" />
- <record model="ir.ui.view" id="view_lunch_category_tree">
- <field name="name">Category</field>
- <field name="model">lunch.category</field>
- <field name="type">tree</field>
+ <!--Action for Alert-->
+ <record model="ir.actions.act_window" id="action_lunch_alert">
+ <field name="name">Alerts</field>
+ <field name="res_model">lunch.alert</field>
+ <field name="view_mode">tree,form</field>
+ <field name="search_view_id" ref="alert_search_view"/>
+ <field name="help" type="html">
+ <p class="oe_view_nocontent_create">
+ Click to create a lunch alert.
+ </p>
+ <p>
+ Alerts are used to warn employee from possible issues concerning the lunch orders.
+ To create a lunch alert you have to define its recurrency, the time interval during which the alert should be executed and the message to display.
+ </p>
+ <p>
+ Example: <br/>
+ - Recurency: Everyday<br/>
+ - Time interval: from 00h00 am to 11h59 pm<br/>
+ - Message: "You must order before 10h30 am"
+ </p>
+ </field>
+ </record>
+ <menuitem name="Alerts" parent="menu_lunch_config" id="menu_lunch_alert" action="action_lunch_alert" />
+
+ <!--View for Order lines-->
+ <record model="ir.ui.view" id="orders_order_lines_tree_view">
+ <field name="name">Order lines Tree</field>
+ <field name="model">lunch.order.line</field>
<field name="arch" type="xml">
- <tree string="Order">
- <field name="name"/>
+ <tree string="Order lines Tree" create="false" edit="false">
+ <field name='date'/>
+ <field name='user_id'/>
+ <field name='supplier' invisible='1'/>
+ <field name='product_id'/>
+ <field name='note'/>
+ <field name='state'/>
+ <field name='price' sum="Total"/>
+ <button name="order" string="Order" type="object" icon="terp-call-start" attrs="{'invisible': ['|',('state','=','confirmed'),('state','=','ordered')]}"/>
+ <button name="confirm" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': [('state','!=','ordered')]}"/>
+ <button name="cancel" string="Cancel" type="object" icon="gtk-cancel" attrs="{'invisible': [('state','=','cancelled')]}"/>
</tree>
</field>
</record>
-<!-- Lunch Category Action -->
-
- <record model="ir.actions.act_window" id="action_lunch_category_form">
- <field name="name"> Product Categories </field>
- <field name="res_model">lunch.category</field>
+ <!--View for Your orders-->
+ <record model="ir.ui.view" id="orders_tree_view">
+ <field name="name">Orders Tree View</field>
+ <field name="model">lunch.order</field>
+ <field name="arch" type="xml">
+ <tree string="Orders Tree">
+ <field name="date"/>
+ <field name='user_id'/>
+ <field name="order_line_ids"/>
+ <field name="state" />
+ <field name="total" sum="Total"/>
+ </tree>
+ </field>
</record>
-
-<!-- Lunch Product Form view -->
-
- <record model="ir.ui.view" id="view_lunch_product_form">
- <field name="name">Products</field>
- <field name="type">form</field>
- <field name="model">lunch.product</field>
+
+ <record model="ir.ui.view" id="orders_form_view">
+ <field name="name">Lunch Order</field>
+ <field name="model">lunch.order</field>
<field name="arch" type="xml">
- <form string="Products" version="7.0">
- <group>
- <group>
- <field name="name"/>
- <field name="category_id"/>
- <field name="price" />
- </group>
- <group>
- <field name="active"/>
- </group>
- <field name="description" placeholder="Add a description" nolabel="1"/>
- </group>
-
+ <form string='Orders Form' version='7.0' class="oe_lunch">
+ <header>
+ <field name='state' widget='statusbar' statusbar_visible='new,confirmed'/>
+ </header>
+ <sheet>
+ <group>
+ <group>
+ <field name='user_id'
+ context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'lunch.group_lunch_user']}"/>
+ </group>
+ <group>
+ <field name='date'/>
+ </group>
+ </group>
+ <field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=',False)]}" class="oe_inline oe_lunch_alert"/>
+ <div name="preferences">
+ </div>
+ <separator string='Select your order'/>
+ <field name='order_line_ids' nolabel='1' on_change='onchange_price(order_line_ids)'>
+ <tree string='List' editable='bottom'>
+ <field name='product_id' on_change='onchange_price(product_id)'/>
+ <field name='note' />
+ <field name='price' on_change='onchange_price(product_id)'/>
+ <field name='supplier' invisible="1"/>
+ <field name="state" invisible="1"/>
+ </tree>
+ </field>
+ <group class='oe_subtotal_footer oe_right'>
+ <field name='total'/>
+ </group>
+ <br/><br/>
+ </sheet>
</form>
</field>
</record>
-<!-- Lunch Product Tree view -->
-
- <record model="ir.ui.view" id="view_lunch_product_tree">
- <field name="name">Products</field>
+ <!--View for Products-->
+ <record model="ir.ui.view" id="products_tree_view">
+ <field name="name">Products Tree</field>
<field name="model">lunch.product</field>
- <field name="type">tree</field>
<field name="arch" type="xml">
- <tree string="Products">
+ <tree string="Products Tree">
<field name="name"/>
<field name="category_id"/>
- <field name="price"/>
+ <field name="supplier"/>
<field name="description"/>
+ <field name="price"/>
</tree>
</field>
</record>
-<!-- Lunch Product Search view -->
-
- <record model="ir.ui.view" id="view_lunch_product_search">
- <field name="name">Products</field>
+ <record model="ir.ui.view" id="products_form_view">
+ <field name="name">Products Form</field>
<field name="model">lunch.product</field>
- <field name="type">search</field>
<field name="arch" type="xml">
- <search string="Products">
- <field name="name" string="Product"/>
- <field name="category_id"/>
- <field name="price"/>
- </search>
+ <form string="Products Form" version="7.0">
+ <header>
+ </header>
+ <sheet>
+ <group>
+ <field name='name'/>
+ <field name='category_id'/>
+ <field name='supplier'/>
+ <field name='price'/>
+ </group>
+ <label for='description'/>
+ <field name='description'/>
+ </sheet>
+ </form>
</field>
</record>
-<!-- Lunch Product Action -->
-
- <record model="ir.actions.act_window" id="action_lunch_product_form">
- <field name="name">Products</field>
- <field name="res_model">lunch.product</field>
- <field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- <field name="view_id" ref="view_lunch_product_tree"/>
- <field name="search_view_id" ref="view_lunch_product_search"/>
- </record>
-
- <menuitem name="Products"
- parent="menu_lunch_category_root_configuration"
- id="menu_lunch_product_form" action="action_lunch_product_form"
- sequence="2" />
-
- <menuitem name="Product Categories"
- parent="menu_lunch_category_root_configuration"
- id="menu_lunch_category_form"
- action="action_lunch_category_form" sequence="1" />
-
-
-<!-- Lunch Amount Tree view -->
-
- <record model="ir.ui.view" id="view_report_lunch_amount_tree">
- <field name="name">Lunch amount</field>
- <field name="model">report.lunch.amount</field>
- <field name="type">tree</field>
+ <!--view for alerts-->
+ <record model="ir.ui.view" id="alert_tree_view">
+ <field name="name">alert tree</field>
+ <field name="model">lunch.alert</field>
<field name="arch" type="xml">
- <tree string="Box Amount by User">
- <field name="date" invisible="1"/>
- <field name="year" invisible="1"/>
- <field name="day" invisible="1"/>
- <field name="month" invisible="1"/>
- <field name="box"/>
- <field name="user_id"/>
- <field name="amount" sum="Total box" />
+ <tree string="alert tree">
+ <field name="message"/>
+ <field name="alter_type"/>
+ <field name='active_from' widget='float_time'/>
+ <field name='active_to' widget='float_time'/>
</tree>
</field>
</record>
-<!-- Lunch Amount Form view -->
-
- <record model="ir.ui.view" id="view_report_lunch_amount_form">
- <field name="name">Lunch amount</field>
- <field name="model">report.lunch.amount</field>
- <field name="type">form</field>
+ <record model="ir.ui.view" id="alert_form_view">
+ <field name="name">alert form</field>
+ <field name="model">lunch.alert</field>
<field name="arch" type="xml">
- <form string="Box Amount by User" version="7.0">
- <sheet>
- <group col="4">
- <field name="user_id"/>
- <field name="box"/>
- <field name="amount"/>
- </group>
- </sheet>
- </form>
- </field>
- </record>
-
-<!-- Lunch Amount Search view -->
+ <form string="alert tree" version="7.0">
+ <sheet>
+ <group string="Schedule Date">
+ <group>
+ <field name="alter_type"/>
+ <field name="specific_day" attrs="{'invisible': [('alter_type','!=','specific')], 'required':[('alter_type','=','specific')]}"/>
+ </group>
+ </group>
+ <group attrs="{'invisible': [('alter_type','!=','week')]}">
+ <group>
+ <field name="monday"/>
+ <field name="tuesday"/>
+ <field name="wednesday"/>
+ <field name="thursday"/>
+ </group>
+ <group>
+ <field name="friday"/>
+ <field name="saturday"/>
+ <field name="sunday"/>
+ </group>
+ </group>
+ <group string="Schedule Hour">
+ <field name='active_from' widget='float_time'/>
+ <field name='active_to' widget='float_time'/>
+ </group>
+ <group string='Message'>
+ <field name='message' nolabel='1' placeholder="Write the message you want to display during the defined period..."/>
+ </group>
- <record model="ir.ui.view" id="view_report_lunch_amount_search">
- <field name="name">Lunch amount</field>
- <field name="model">report.lunch.amount</field>
- <field name="type">search</field>
- <field name="arch" type="xml">
- <search string="Box Amount by User">
- <group>
- <field name="date"/>
- <separator orientation="vertical"/>
- <field name="user_id"/>
- <field name="box"/>
- <field name="amount"/>
- </group>
- <newline/>
- <group expand="0" string="Group By...">
- <filter string="Box" icon="terp-dolar" context="{'group_by':'box'}"/>
- </group>
- </search>
+ </sheet>
+ </form>
</field>
</record>
-<!-- Lunch Amount Action -->
-
- <record model="ir.actions.act_window" id="action_report_lunch_amount_tree">
- <field name="name">Cash Position by User</field>
- <field name="res_model">report.lunch.amount</field>
- <field name="view_type">form</field>
- <field name="view_mode">tree,form</field>
- <field name="context">{'search_default_year': 1,"search_default_month":1}</field>
- <field name="search_view_id" ref="view_report_lunch_amount_search"/>
- </record>
-
- <menuitem name="Cash Position by User"
- parent="menu_lunch_reporting_order"
- action="action_report_lunch_amount_tree"
- id="menu_lunch_report_amount_tree" />
-
</data>
</openerp>
-
-