[IMP] purchase: Improve the Purchase analysis report
bzr revid: sbh@tinyerp.com-20100916121219-4w1ug3idx8r5ss17
This commit is contained in:
parent
b6440e2c2a
commit
0c5efd6ead
|
@ -31,7 +31,7 @@ class purchase_report(osv.osv):
|
|||
_description = "Purchases Orders"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date': fields.date('Order Date', readonly=True),
|
||||
'date': fields.date('Order Date', readonly=True, help="Date on which this document has been created"),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'state': fields.selection([('draft', 'Request for Quotation'),
|
||||
|
@ -52,11 +52,12 @@ class purchase_report(osv.osv):
|
|||
'date_approve':fields.date('Date Approved', readonly=True),
|
||||
'expected_date':fields.date('Expected Date', readonly=True),
|
||||
'validator' : fields.many2one('res.users', 'Validated By', readonly=True),
|
||||
'product_uom' : fields.many2one('product.uom', 'Product UoM', required=True),
|
||||
'company_id':fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'Responsible', readonly=True),
|
||||
'delay':fields.float('Days to Validate', digits=(16,2), readonly=True),
|
||||
'delay_pass':fields.float('Days to Deliver', digits=(16,2), readonly=True),
|
||||
'quantity': fields.float('# of Products', readonly=True),
|
||||
'quantity': fields.float('# of Qty', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True, group_operator="avg"),
|
||||
'negociation': fields.float('Purchase-Standard Price', readonly=True, group_operator="avg"),
|
||||
|
@ -89,6 +90,7 @@ class purchase_report(osv.osv):
|
|||
s.create_uid as user_id,
|
||||
s.company_id as company_id,
|
||||
l.product_id,
|
||||
l.product_uom as product_uom,
|
||||
s.location_id as location_id,
|
||||
sum(l.product_qty*u.factor) as quantity,
|
||||
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
|
||||
|
@ -114,6 +116,7 @@ class purchase_report(osv.osv):
|
|||
l.price_unit,
|
||||
s.date_approve,
|
||||
l.date_planned,
|
||||
l.product_uom,
|
||||
date_trunc('day',s.minimum_planned_date),
|
||||
s.partner_address_id,
|
||||
s.pricelist_id,
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<field name="user_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="product_uom" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
|
@ -34,7 +35,7 @@
|
|||
<field name="state" invisible="1"/>
|
||||
<field name="location_id" invisible="1"/>
|
||||
<field name="nbr" sum="# of Lines"/>
|
||||
<field name="quantity" sum="# of Products"/>
|
||||
<field name="quantity" sum="# of Qty"/>
|
||||
<field name="price_average" sum="Average Price"/>
|
||||
<field name="price_total" sum="Total Price"/>
|
||||
<field name="price_standard" sum="Products Value"/>
|
||||
|
@ -52,18 +53,18 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Purchase Orders">
|
||||
<group colspan="10" col="12">
|
||||
<filter icon="terp-go-year" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this year"/>
|
||||
<filter icon="terp-go-month" string="This Month"
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this month"/>
|
||||
<filter icon="terp-go-week"
|
||||
string="7 Days"
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks during last 7 days"/>
|
||||
<filter icon="terp-go-year" string=" Year "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]"
|
||||
help="Order in current year"/>
|
||||
<filter icon="terp-go-month" string=" Month "
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-%%m-01'))]"
|
||||
help="Order in current month"/>
|
||||
<filter icon="terp-go-month"
|
||||
string=" Month-1 "
|
||||
separator="1"
|
||||
domain="[('date','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','>',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Order in last month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new"
|
||||
string="Quotations"
|
||||
|
@ -80,12 +81,12 @@
|
|||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Supplier" name="group_partner_id" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Product" name="group_product_id" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Responsible" name="Responsible" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Validated by" icon="terp-personal" context="{'group_by':'validator'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'warehouse_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" name="group_product_id" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Product UOM" name="group_product_uom" icon="terp-accessories-archiver" context="{'group_by':'product_uom'}"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'warehouse_id'}" groups="base.group_extended"/>
|
||||
<filter string="Destination" icon="terp-gtk-jump-to-ltr" context="{'group_by':'location_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
|
@ -106,7 +107,7 @@
|
|||
<separator orientation="vertical"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<newline/>
|
||||
<field name="date"/>
|
||||
<field name="date" />
|
||||
<field name="date_approve"/>
|
||||
<field name="expected_date"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue