[IMP] sale,stock : set the context in group by in search view and add new reporting...
authorsbh (Open ERP) <sbh@tinyerp.com>
Fri, 5 Feb 2010 13:02:17 +0000 (18:32 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Fri, 5 Feb 2010 13:02:17 +0000 (18:32 +0530)
bzr revid: sbh@tinyerp.com-20100205130217-nqg15vhgnwhwakyx

addons/sale/__terp__.py
addons/sale/report_sale_view.xml [new file with mode: 0644]
addons/sale/sale_view.xml
addons/stock/stock_view.xml

index 2abafb3..f685bac 100644 (file)
@@ -55,6 +55,7 @@
         'sale_report.xml',
         'sale_wizard.xml',
         'stock_view.xml',
+        'report_sale_view.xml',
         'process/sale_process.xml',
     ],
     'demo_xml': ['sale_demo.xml'],
diff --git a/addons/sale/report_sale_view.xml b/addons/sale/report_sale_view.xml
new file mode 100644 (file)
index 0000000..6bb33ad
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="view_sale_order_report_tree" model="ir.ui.view">
+            <field name="name">report.sale.order.tree</field>
+            <field name="model">sale.order</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Sale Orders">
+                       <field name="partner_id"/>
+                    <field name="date_order"/>
+                    <field name="invoiced_rate"/>
+                    <field name="picked_rate"/>
+                    <field name="amount_untaxed"/>
+                    <field name="amount_tax"/>
+                    <field name="amount_total"/>
+                    <field name="state"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="action_sale_order_report_all" model="ir.actions.act_window">
+            <field name="name">Sale Orders By Month </field>
+            <field name="res_model">sale.order</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,graph</field>
+            <field name="context">{'report':True}</field>
+            <field name="search_view_id" ref="sale.view_sales_order_filter"/>
+        </record>        
+           <record model="ir.actions.act_window.view" id="action_crm_tag_tree_claim01">
+               <field name="sequence" eval="1"/>
+               <field name="view_mode">tree</field>
+               <field name="view_id" ref="sale.view_sale_order_report_tree"/>
+               <field name="act_window_id" ref="action_sale_order_report_all"/>
+           </record>        
+               <record model="ir.actions.act_window.view" id="action_order_product02">
+               <field name="sequence" eval="1"/>
+               <field name="view_mode">graph</field>
+               <field name="view_id" ref="sale.view_sale_order_graph"/>
+               <field name="act_window_id" ref="action_sale_order_report_all"/>
+           </record>      
+       
+       <!-- Sale Orders by Product-->
+       
+        <record id="view_order_report_tree" model="ir.ui.view">
+                       <field name="name">report.sale.order.line.tree</field>
+            <field name="model">sale.order.line</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Sale Orders by Product">
+                    <field name="name"/>
+                    <field name="order_id" invisible="True"/>
+                    <field name="product_uom_qty" />
+                    <field name="product_uom"/>
+                    <field name="product_id"/>
+                    <field name="price_unit" />
+                    <field name="discount"/>
+                    <field name="price_subtotal" sum="Total"/>
+                    <field name="state"/>
+                </tree>
+            </field>
+        </record>
+        
+        <record id="action_order_report_tree_all" model="ir.actions.act_window">
+            <field name="name">Sale Orders by Product</field>
+            <field name="res_model">sale.order.line</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,graph</field>
+            <field name="context">{'report':True}</field>
+                       <field name="domain">[('product_uom_qty','!=','0')]</field>
+            <field name="search_view_id" ref="sale.view_sales_order_line_filter"/>
+        </record>
+           <record model="ir.actions.act_window.view" id="action_order_product01">
+               <field name="sequence" eval="1"/>
+               <field name="view_mode">tree</field>
+               <field name="view_id" ref="view_order_report_tree"/>
+               <field name="act_window_id" ref="action_order_report_tree_all"/>
+           </record>   
+           <record model="ir.actions.act_window.view" id="action_order_product02">
+               <field name="sequence" eval="1"/>
+               <field name="view_mode">graph</field>
+               <field name="view_id" ref="sale.view_order_line_graph"/>
+               <field name="act_window_id" ref="action_order_report_tree_all"/>
+           </record>      
+
+       <menuitem id="base.next_id_64" name="Reporting" parent="base.menu_base_partner" sequence="8"/>
+    <menuitem action="action_sale_order_report_all" id="menu_report_sale_order_all" parent="base.next_id_64" sequence="3"/>
+    
+    <menuitem action="action_order_report_tree_all" id="menu_report_order_product_all1" parent="base.next_id_64" sequence="3"/>
+     
+      </data>
+    </openerp>    
\ No newline at end of file
index 8902c39..affe9e4 100644 (file)
                             <filter icon="terp-sale" domain="[('user_id','child_of',[uid])]" help="My Departments Sale Orders"/>
                         </field>
                         <field name="date_order" select="1"/>
-                        </group>
-                               <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
-                        <filter string="By Parnter" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
+                                       </group>
+                                       <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
+                                               <filter string="By Parnter" icon="terp-sale" domain="[]" context="{'group_by':'partner_id'}"/>
                         <filter string="By State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
                         <filter string="By Order Date" icon="terp-sale" domain="[]" context="{'group_by':'date_order'}"/>
-                        
-                                               </group>                        
+                                       </group>                        
                </search>
             </field>
         </record>
                             <filter icon="terp-sale" domain="[('salesman_id','=',uid)]" help="My Sale Order Lines"/>
                             <filter icon="terp-sale" domain="[('salesman_id','child_of',[uid])]" help="My Departments Sale Order Lines"/>
                         </field>
+                                       <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
+                                               <filter string="By Product" icon="terp-sale" domain="[]" context="{'group_by':'product_id'}"/>
+                        <filter string="By Order" icon="terp-sale" domain="[]" context="{'group_by':'order_id'}"/>
+                        <filter string="By State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>
+                                       </group>                        
+                        
                     </group>
                 </search>
             </field>
index e071ced..2e46815 100644 (file)
                         <field name="name" select="1"/>
                         <field name="address_id" select="1"/>
                    </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                         <filter string="By Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
                         <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Date" icon="terp-stock" domain="[]"  context="{'group_by':'date'}"/>
                         <field name="name" select="1"/>
                         <field name="origin" select="1"/>
                    </group>
-                    <group expand="1" string="Group By..." colspan="4" col="10">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="10">
                         <filter string="By Partner" icon="terp-stock" domain="[]"  context="{'group_by':'address_id'}"/>
                         <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Order Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>                        
                         <field name="address_id" select="1"/>
                         <field name="company_id" select="1" widget="selection"/>
                    </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                         <filter string="By Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
                         <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Date" icon="terp-stock" domain="[]"  context="{'group_by':'date'}"/>
                         <field name="address_id" select="1"/>
                         <field name="company_id" select="1" widget="selection"/>
                    </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                         <filter string="By Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
                         <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Date" icon="terp-stock" domain="[]"  context="{'group_by':'date'}"/>
                         <field name="address_id" select="1"/>
                         <field name="company_id" select="1" widget="selection"/>
                    </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                         <filter string="By Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
                         <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Date" icon="terp-stock" domain="[]"  context="{'group_by':'date'}"/>
                            <field name="location_dest_id" select="1"/>
                            <field name="product_id" select="1"/>
                     </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                         <filter string="By Location" icon="terp-stock" domain="[]" context="{'group_by':'location_id'}"/>
                                                <filter string="By Product" icon="terp-stock" domain="[]"  context="{'group_by':'product_id'}"/>
                                                <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                <field name="partner_id" string="Supplier" select="1"/>
                            <field name="product_id"/>
                     </group>
-                    <group expand="1" string="Group By..." colspan="4" col="8">
+                    <group expand="context.get('report',False)" string="Group By..." colspan="4" col="8">
                                                <filter string="By Product" icon="terp-stock" domain="[]" context="{'group_by':'product_id'}"/>
                                                <filter string="By State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
                                                <filter string="By Date" icon="terp-stock" domain="[]" context="{'group_by':'date'}"/>