[IMP]: report_XXX modules changes.
bzr revid: uco@tinyerp.co.in-20091124135806-880eehkk0bqej1wo
This commit is contained in:
parent
caa1f39746
commit
5062e64483
|
@ -20,13 +20,14 @@
|
|||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
|
||||
class report_project_task_user(osv.osv):
|
||||
_name = "report.project.task.user"
|
||||
_description = "Tasks by user and project"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Month', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'project_id':fields.many2one('project.project', 'Project', readonly=True),
|
||||
'hours_planned': fields.float('Planned Hours', readonly=True),
|
||||
|
@ -34,14 +35,19 @@ class report_project_task_user(osv.osv):
|
|||
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
|
||||
'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
|
||||
'task_closed': fields.integer('Task Closed', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'name desc, project_id'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'report_project_task_user')
|
||||
cr.execute("""
|
||||
create or replace view report_project_task_user as (
|
||||
select
|
||||
min(t.id) as id,
|
||||
to_char(date_close, 'YYYY-MM-01') as name,
|
||||
to_char(date_close, 'YYYY') as name,
|
||||
to_char(date_close, 'MM') as month,
|
||||
count(distinct t.id) as task_closed,
|
||||
t.user_id,
|
||||
t.project_id,
|
||||
|
@ -54,7 +60,7 @@ class report_project_task_user(osv.osv):
|
|||
where
|
||||
t.state='done'
|
||||
group by
|
||||
to_char(date_close, 'YYYY-MM-01'),t.user_id,project_id
|
||||
to_char(date_close, 'YYYY'),to_char(date_close, 'MM'),t.user_id,project_id
|
||||
)
|
||||
""")
|
||||
report_project_task_user()
|
||||
|
@ -65,21 +71,26 @@ class report_project_task(osv.osv):
|
|||
_description = "Tasks by project"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Month', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'project_id':fields.many2one('project.project', 'Project', readonly=True),
|
||||
'hours_planned': fields.float('Planned Hours', readonly=True),
|
||||
'hours_effective': fields.float('Effective Hours', readonly=True),
|
||||
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
|
||||
'closing_days': fields.char('Avg Closing Delay', size=64, readonly=True),
|
||||
'task_closed': fields.integer('Task Closed', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'name desc, project_id'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'report_project_task')
|
||||
cr.execute("""
|
||||
create or replace view report_project_task as (
|
||||
select
|
||||
min(t.id) as id,
|
||||
to_char(date_close, 'YYYY-MM-01') as name,
|
||||
to_char(date_close, 'YYYY') as name,
|
||||
to_char(date_close, 'MM') as month,
|
||||
count(distinct t.id) as task_closed,
|
||||
t.project_id,
|
||||
sum(planned_hours) as hours_planned,
|
||||
|
@ -91,7 +102,7 @@ class report_project_task(osv.osv):
|
|||
where
|
||||
t.state='done'
|
||||
group by
|
||||
to_char(date_close, 'YYYY-MM-01'),project_id
|
||||
to_char(date_close, 'YYYY'),to_char(date_close, 'MM'),project_id
|
||||
)
|
||||
""")
|
||||
report_project_task()
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Tasks by Project and User">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="task_closed" select="1"/>
|
||||
|
@ -29,6 +30,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Tasks by projects and users">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="task_closed" select="1"/>
|
||||
|
@ -65,6 +67,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Tasks by Project">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="task_closed" select="1"/>
|
||||
<field name="hours_planned" select="1"/>
|
||||
|
@ -81,6 +84,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Tasks by project">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="project_id" select="1"/>
|
||||
<field name="task_closed" select="1"/>
|
||||
<field name="hours_planned" select="1"/>
|
||||
|
|
|
@ -24,13 +24,14 @@
|
|||
#
|
||||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
|
||||
class report_purchase_order_product(osv.osv):
|
||||
_name = "report.purchase.order.product"
|
||||
_description = "Purchases Orders by Products"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Month', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Quotation'),
|
||||
('waiting_date','Waiting Schedule'),
|
||||
|
@ -46,14 +47,19 @@ class report_purchase_order_product(osv.osv):
|
|||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'name desc,price_total desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'report_purchase_order_product')
|
||||
cr.execute("""
|
||||
create or replace view report_purchase_order_product as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date_order, 'YYYY-MM-01') as name,
|
||||
to_char(s.date_order, 'YYYY') as name,
|
||||
to_char(s.date_order, 'MM') as month,
|
||||
s.state,
|
||||
l.product_id,
|
||||
sum(l.product_qty*u.factor) as quantity,
|
||||
|
@ -64,7 +70,7 @@ class report_purchase_order_product(osv.osv):
|
|||
left join purchase_order_line l on (s.id=l.order_id)
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
where l.product_id is not null
|
||||
group by l.product_id, to_char(s.date_order, 'YYYY-MM-01'),s.state
|
||||
group by l.product_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
|
||||
)
|
||||
""")
|
||||
report_purchase_order_product()
|
||||
|
@ -74,7 +80,7 @@ class report_purchase_order_category(osv.osv):
|
|||
_description = "Purchases Orders by Categories"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Month', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'state': fields.selection([
|
||||
('draft','Quotation'),
|
||||
('waiting_date','Waiting Schedule'),
|
||||
|
@ -90,14 +96,18 @@ class report_purchase_order_category(osv.osv):
|
|||
'price_total': fields.float('Total Price', readonly=True),
|
||||
'price_average': fields.float('Average Price', readonly=True),
|
||||
'count': fields.integer('# of Lines', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
}
|
||||
_order = 'name desc,price_total desc'
|
||||
def init(self, cr):
|
||||
tools.sql.drop_view_if_exists(cr, 'report_purchase_order_category')
|
||||
cr.execute("""
|
||||
create or replace view report_purchase_order_category as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
to_char(s.date_order, 'YYYY-MM-01') as name,
|
||||
to_char(s.date_order, 'YYYY') as name,
|
||||
to_char(s.date_order, 'MM') as month,
|
||||
s.state,
|
||||
t.categ_id as category_id,
|
||||
sum(l.product_qty*u.factor) as quantity,
|
||||
|
@ -110,7 +120,7 @@ class report_purchase_order_category(osv.osv):
|
|||
left join product_template t on (t.id=p.product_tmpl_id)
|
||||
left join product_uom u on (u.id=l.product_uom)
|
||||
where l.product_id is not null
|
||||
group by t.categ_id, to_char(s.date_order, 'YYYY-MM-01'),s.state
|
||||
group by t.categ_id, to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),s.state
|
||||
)
|
||||
""")
|
||||
report_purchase_order_category()
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Purchases by products">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="count"/>
|
||||
<field name="quantity" select="1"/>
|
||||
|
@ -75,6 +76,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Purchases by Category of Products">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="category_id" select="1"/>
|
||||
<field name="count"/>
|
||||
<field name="quantity" select="1"/>
|
||||
|
|
|
@ -27,10 +27,12 @@ class report_timesheet_user(osv.osv):
|
|||
_description = "Timesheet per day"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Date', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'cost': fields.float('Cost', readonly=True)
|
||||
'cost': fields.float('Cost', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
}
|
||||
_order = 'name desc,user_id desc'
|
||||
def init(self, cr):
|
||||
|
@ -39,7 +41,8 @@ class report_timesheet_user(osv.osv):
|
|||
create or replace view report_timesheet_user as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
l.date as name,
|
||||
to_char(l.date,'YYYY') as name,
|
||||
to_char(l.date,'MM') as month,
|
||||
l.user_id,
|
||||
sum(l.unit_amount) as quantity,
|
||||
sum(l.amount) as cost
|
||||
|
@ -47,7 +50,7 @@ class report_timesheet_user(osv.osv):
|
|||
account_analytic_line l
|
||||
where
|
||||
user_id is not null
|
||||
group by l.date, l.user_id
|
||||
group by l.date, to_char(l.date,'YYYY'),to_char(l.date,'MM'), l.user_id
|
||||
)
|
||||
""")
|
||||
report_timesheet_user()
|
||||
|
@ -57,10 +60,13 @@ class report_timesheet_account(osv.osv):
|
|||
_description = "Timesheet per account"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Month', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'account_id':fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
|
||||
}
|
||||
_order = 'name desc,account_id desc,user_id desc'
|
||||
def init(self, cr):
|
||||
|
@ -69,14 +75,15 @@ class report_timesheet_account(osv.osv):
|
|||
create or replace view report_timesheet_account as (
|
||||
select
|
||||
min(id) as id,
|
||||
to_char(create_date, 'YYYY-MM-01') as name,
|
||||
to_char(create_date, 'YYYY') as name,
|
||||
to_char(create_date,'MM') as month,
|
||||
user_id,
|
||||
account_id,
|
||||
sum(unit_amount) as quantity
|
||||
from
|
||||
account_analytic_line
|
||||
group by
|
||||
to_char(create_date, 'YYYY-MM-01'), user_id, account_id
|
||||
to_char(create_date, 'YYYY'),to_char(create_date, 'MM'), user_id, account_id
|
||||
)
|
||||
""")
|
||||
report_timesheet_account()
|
||||
|
@ -87,10 +94,12 @@ class report_timesheet_account_date(osv.osv):
|
|||
_description = "Daily timesheet per account"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'name': fields.date('Date', readonly=True),
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'account_id':fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
}
|
||||
_order = 'name desc,account_id desc,user_id desc'
|
||||
|
||||
|
@ -100,14 +109,15 @@ class report_timesheet_account_date(osv.osv):
|
|||
create or replace view report_timesheet_account_date as (
|
||||
select
|
||||
min(id) as id,
|
||||
date as name,
|
||||
to_char(date,'YYYY') as name,
|
||||
to_char(date,'MM') as month,
|
||||
user_id,
|
||||
account_id,
|
||||
sum(unit_amount) as quantity
|
||||
from
|
||||
account_analytic_line
|
||||
group by
|
||||
date, user_id, account_id
|
||||
to_char(date,'YYYY'),to_char(date,'MM'), user_id, account_id
|
||||
)
|
||||
""")
|
||||
report_timesheet_account_date()
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Timesheet by user">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
|
@ -185,6 +186,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Daily timesheet by account">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="quantity"/>
|
||||
|
@ -246,6 +248,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Timesheet by account">
|
||||
<field name="name" select="1"/>
|
||||
<field name="month" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="user_id" select="1"/>
|
||||
<field name="quantity"/>
|
||||
|
|
Loading…
Reference in New Issue