[FIX] can't handle many2many relation in reports

bzr revid: abo@openerp.com-20120711144304-a6ab47s9nmz6yj2l
This commit is contained in:
Antonin Bourguignon 2012-07-11 16:43:04 +02:00
parent 2770b5a6f0
commit 3a649f7025
2 changed files with 2 additions and 4 deletions

View File

@ -236,7 +236,7 @@ class project_issue(base_stage, osv.osv):
'date_closed': fields.datetime('Closed', readonly=True,select=True),
'date': fields.datetime('Date'),
'channel_id': fields.many2one('crm.case.channel', 'Channel', help="Communication channel."),
'categ_ids': fields.many2many('project.category', 'project_issue_categ_rel', 'project_issue_id', 'project_category_id', 'Categories'),
'categ_ids': fields.many2many('project.category', string='Categories'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True),
'version_id': fields.many2one('project.issue.version', 'Version'),
'stage_id': fields.many2one ('project.task.type', 'Stage',

View File

@ -50,7 +50,6 @@ class project_issue_report(osv.osv):
'opening_date': fields.date('Date of Opening', readonly=True),
'creation_date': fields.date('Creation Date', readonly=True),
'date_closed': fields.date('Date of Closing', readonly=True),
'categ_ids': fields.many2many('project.category', 'project_issue_categ_rel', 'project_issue_id', 'project_category_id', 'Categories'),
'stage_id': fields.many2one('project.task.type', 'Stage'),
'nbr': fields.integer('# of Issues', readonly=True),
'working_hours_open': fields.float('Avg. Working Hours to Open', readonly=True),
@ -86,7 +85,6 @@ class project_issue_report(osv.osv):
c.working_hours_open,
c.working_hours_close,
c.section_id,
c.categ_id,
c.stage_id,
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.company_id as company_id,
@ -104,7 +102,7 @@ class project_issue_report(osv.osv):
FROM
project_issue c
WHERE c.active= 'true' and c.categ_id IN (select id from crm_case_categ where object_id in (select id from ir_model where model = 'project.issue'))
WHERE c.active= 'true'
)""")
project_issue_report()