[IMP] stock: Add the month,year and month-1 group by in search view
authorsbh (Open ERP) <sbh@tinyerp.com>
Thu, 16 Sep 2010 12:27:09 +0000 (17:57 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Thu, 16 Sep 2010 12:27:09 +0000 (17:57 +0530)
bzr revid: sbh@tinyerp.com-20100916122709-axhvl7w3d8fkj66g

addons/stock/report/report_stock_move_view.xml

index 2c8c1ad..da15e91 100644 (file)
         <field name="arch" type="xml">
             <search string="Moves Analysis">
                 <group>
+                <filter icon="terp-go-year" string="  Year  "
+                domain="[('date_planned','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_planned','&gt;=',time.strftime('%%Y-01-01'))]"
+                help="Current year"/>
+                <filter icon="terp-go-month" string="   Month   "
+                name="month"
+                domain="[('date_planned','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_planned','&gt;=',time.strftime('%%Y-%%m-01'))]"
+                help="Current month"/>
                 <filter icon="terp-go-month"
-                    name="month"
-                    string="This Month"
-                    domain="[('month','=',time.strftime('%%m'))]"
-                    help="Stock Moves of this month"/>
-                <filter icon="terp-go-today"
-                    string="Today"
-                    separator="1"
-                    domain="[('date_planned','=', time.strftime('%%Y-%%m-%%d'))]"
-                    help="Stock Moves of today"/>
+                 string="    Month-1    "
+                 separator="1"
+                 domain="[('date_planned','&lt;=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date_planned','&gt;',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
+                 help="Last month"/>                    
                 <separator orientation="vertical"/>
 
                 <filter string="Done"
                     <filter name="group_product" string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
                     <filter name="group_picking" string="Packing" icon="terp-accessories-archiver" context="{'group_by':'picking_id'}"/>
                     <separator orientation="vertical"/>
-                    <filter string="Type" name="group_type" icon="terp-gtk-jump-to-rtl" context="{'group_by':'type'}"/>
                     <filter string="Source Location" name="src_location" icon="terp-gtk-jump-to-rtl" context="{'group_by':'location_id'}"/>
                     <filter string="Dest. Location" name="dest_location" icon="terp-gtk-jump-to-ltr"  context="{'group_by':'location_dest_id'}"/>
+                    <separator orientation="vertical"/>
+                    <filter string="Type" name="group_type" icon="terp-gtk-jump-to-rtl" context="{'group_by':'type'}" help="Shipping type specify, goods coming in or going out"/>
                     <filter string="State" name="group_state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
                     <separator orientation="vertical"/>
                     <filter string="Company" name="group_state" icon="terp-stock_effects-object-colorize" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>