[MOD] lunch : Usability Improvements
authorVir (Open ERP) <vir@tinyerp.com>
Fri, 3 Sep 2010 12:24:24 +0000 (17:54 +0530)
committerVir (Open ERP) <vir@tinyerp.com>
Fri, 3 Sep 2010 12:24:24 +0000 (17:54 +0530)
bzr revid: vir@tinyerp.com-20100903122424-p7471a7jtnz20kia

addons/base_setup/installer.py
addons/lunch/lunch_view.xml
addons/lunch/wizard/lunch_order_cancel_view.xml
addons/lunch/wizard/lunch_order_confirm_view.xml

index edfbb57..e70e34a 100644 (file)
@@ -107,7 +107,7 @@ class base_setup_installer(osv.osv_memory):
     def _if_misc_tools(self, cr, uid, ids, context=None):
         interface = self.pool.get('res.users').browse(cr, uid, uid, context=context).view
         if interface == 'simple' or interface =='extended' :
-            return ['lunch','idea','survey']
+            return ['profile_tools']
         return None
 
     def _if_account(self, cr, uid, ids, context=None):
index 87ae7a8..3c33dcd 100644 (file)
             <field name="arch" type="xml">
                 <search string="Box Amount by User">
                     <group>
-                        <filter icon="terp-go-year" string="  365 Days  "
-                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
-                        help="Box amount in last 365 days"/>
-                        <filter icon="terp-go-month" string="   30 Days   "
+                        <filter icon="terp-go-year" string="  Year  "
+                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]"
+                        help="Box amount in current year"/>
+                        <filter icon="terp-go-month" string="   Month   "
                         name="month"
-                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
-                        help="Box amount in last 30 days"/>
-                    <filter icon="terp-go-week"
-                         string="    7 Days    "
+                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-%%m-01'))]"
+                        help="Box amount in current month"/>
+                        <filter icon="terp-go-week"
+                         string="    Month-1    "
                          separator="1"
-                         domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
-                         help="Box amount in last 7 days"/>
+                         domain="[('date','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
+                         help="Box amount in last month"/>
                     <separator orientation="vertical"/>
                         <field name="user_id" select="1"/>
                         <field name="box" select="1"/>
index 39fa1f8..d47cc6d 100644 (file)
@@ -34,7 +34,7 @@
         <act_window id="action_lunch_order_cancel_values"
                key2="client_action_multi" name="Cancel Order"
                res_model="lunch.order.cancel" src_model="lunch.order"
-               view_mode="form" target="new" view_type="form" />
+               view_mode="form" target="new" view_type="form" groups="base.group_tool_manager"/>
 
     </data>
 </openerp>
index aa59aca..dabcd7d 100644 (file)
@@ -36,7 +36,7 @@
         <act_window id="action_lunch_order_confirm_values"
                key2="client_action_multi" name="Confirm Order"
                res_model="lunch.order.confirm" src_model="lunch.order"
-               view_mode="form" target="new" view_type="form" />
+               view_mode="form" target="new" view_type="form" groups="base.group_tool_manager"/>
 
     </data>
 </openerp>