[ADD,FIX]:Group by customer and shop in sale order and a small bug in stock/product.py

bzr revid: nch@tinyerp.com-20091229130500-b3crhavxmrkmni4q
This commit is contained in:
nch@tinyerp.com
2009-12-29 18:35:00 +05:30
parent 6a3696a3b4
commit 5d9d5562a2
2 changed files with 52 additions and 2 deletions
+50 -2
View File
@@ -131,7 +131,7 @@
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position)"
domain="[('product_id','=',product_id)]"
groups="base.group_extended"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<separator colspan="4" string="Manual Description"/>
<field colspan="4" name="name" select="2"/>
<field name="price_unit" select="2"/>
@@ -264,6 +264,54 @@
</record>
<menuitem action="action_order_tree" id="menu_action_order_tree" parent="sale.menu_sale_order" groups="base.group_extended"/>
<!-- Group by view -->
<record id="view_SO_tree" model="ir.ui.view">
<field name="name">sale.order.gp.tree</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sale Order Group By Customer">
<field name="name"/>
<field name="shop_id"/>
<field name="date_order"/>
<field name="partner_id"/>
<field name="amount_untaxed"/>
<field name="amount_tax"/>
<field name="amount_total"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="action_SO_gp" model="ir.actions.act_window">
<field name="name">Sale Order Group By Customer</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="context">{'group_by':'partner_id'}</field>
<field name="view_type">tree</field>
<field name="view_mode">form,graph</field>
<field name="view_id" ref="view_SO_tree"/>
</record>
<menuitem
action="action_SO_gp"
id="saleOrder_GP"
parent="sale.menu_sale_order"/>
<record id="action_SO_gp1" model="ir.actions.act_window">
<field name="name">Sale Order Group By Shop</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="context">{'group_by':'shop_id'}</field>
<field name="view_type">tree</field>
<field name="view_mode">form,graph</field>
<field name="view_id" ref="view_SO_tree"/>
</record>
<menuitem
action="action_SO_gp1"
id="saleOrder_GP1"
parent="sale.menu_sale_order"/>
<!-- OVER............. -->
<record id="action_order_tree_all" model="ir.actions.act_window">
<field name="name">All Sales Order</field>
<field name="type">ir.actions.act_window</field>
@@ -415,7 +463,7 @@
<field name="product_uom"/>
<field name="product_id" readonly="1" select="1"/>
<field name="invoiced" select="2"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
<separator colspan="4" string="Manual Designation"/>
<field colspan="4" name="name" select="2"/>
<field name="price_unit" select="2"/>
+2
View File
@@ -175,6 +175,8 @@ class product_product(osv.osv):
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if context == None:
context = {}
if ('location' in context) and context['location']:
location_info = self.pool.get('stock.location').browse(cr, uid, context['location'])
fields=res.get('fields',{})