[IMP]: analysis view of project task,issue, hr applicant and crm opportunity

bzr revid: aja@tinyerp.com-20130620120228-upu5qsnk0j1tali6
This commit is contained in:
ajay javiya (OpenERP) 2013-06-20 17:32:28 +05:30
parent 374ba0e238
commit f55de6c9e2
18 changed files with 135 additions and 75 deletions

View File

@ -199,3 +199,29 @@ class base_stage(object):
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context)
return True
def case_set(self, cr, uid, ids, new_state_name=None, values_to_update=None, new_stage_id=None, context=None):
""" Generic method for setting case. This methods wraps the update
of the record.
:params new_state_name: the new state of the record; this method
will call ``stage_set_with_state_name``
that will find the stage matching the
new state, using the ``stage_find`` method.
:params new_stage_id: alternatively, you may directly give the
new stage of the record
:params state_name: the new value of the state, such as
'draft' or 'close'.
:params update_values: values that will be added with the state
update when writing values to the record.
"""
cases = self.browse(cr, uid, ids, context=context)
# 1. update the stage
if new_state_name:
self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context)
elif not (new_stage_id is None):
self.stage_set(cr, uid, ids, new_stage_id, context=context)
# 2. update values
if values_to_update:
self.write(cr, uid, ids, values_to_update, context=context)
return True

View File

@ -413,10 +413,9 @@ class crm_lead(base_stage, format_address, osv.osv):
if stage_id:
self.case_set(cr, uid, [lead.id], new_stage_id=stage_id, context=context)
else:
raise self.pool.get('res.config.settings').get_config_warning(cr,
_("To relieve your sales pipe and group all Lost opportunities, configure one of your sales stage as follow:\n"
"probability = 0, sequence != 1 and on_change = True.\n"
"You can create a specific column or edit an existing one from the menu %(menu:crm.menu_crm_case_section_act)s"), context=context)
raise osv.except_osv(_('Warning!'), _('To relieve your sales pipe and group all Lost opportunities, configure one of your sales stage as follow:\n'
'probability = 0 %, select "Change Probability Automatically".\n'
'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
return True
def case_mark_won(self, cr, uid, ids, context=None):
@ -426,10 +425,9 @@ class crm_lead(base_stage, format_address, osv.osv):
if stage_id:
self.case_set(cr, uid, [lead.id], new_stage_id=stage_id, context=context)
else:
raise self.pool.get('res.config.settings').get_config_warning(cr,
_("To relieve your sales pipe and group all Won opportunities, configure one of your sales stage as follow:\n"
"probability = 100 and on_change = True.\n"
"You can create a specific column or edit an existing one from the menu %(menu:crm.menu_crm_case_section_act)s"), context=context)
raise osv.except_osv(_('Warning!'), _('To relieve your sales pipe and group all Won opportunities, configure one of your sales stage as follow:\n'
'probability = 100 % and select "Change Probability Automatically".\n'
'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
return True
def set_priority(self, cr, uid, ids, priority):

View File

@ -328,7 +328,7 @@
<separator/>
<filter string="Open" name="open" domain="[('user_id', '!=', 'False'), ('probability', '!=', 100)]" help="Open and Assigned Leads"/>
<filter string="Dead" name="dead" domain="[('probability', '=', '0'), ('stage_id.sequence', '!=', 1)]"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=', False), ('probability', '!=', 100)]" help="No salesperson"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
<filter string="Assigned to Me"
domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
help="Leads that are assigned to me"/>
@ -378,7 +378,7 @@
<button name="case_mark_lost" string="Mark Lost" type="object" class="oe_highlight"
attrs="{'invisible': [('probability', '=', 0)]}"/>
<field name="stage_id" widget="statusbar" clickable="True"
domain="['&amp;', '|', ('case_default', '=', True), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"/>
domain="['&amp;', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"/>
</header>
<sheet>
<div class="oe_right oe_button_box">
@ -524,6 +524,7 @@
<field name="priority" invisible="1"/>
<field name="message_unread" invisible="1"/>
<field name="probability" invisible="1"/>
<field name="write_date" invisible="1"/>
</tree>
</field>
</record>
@ -567,6 +568,8 @@
<filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
<filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Last Update Month" icon="terp-go-month"
domain="[]" context="{'group_by':'write_date'}"/>
</group>
<group string="Display">
<filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team" groups="base.group_multi_salesteams"/>

View File

@ -43,6 +43,7 @@
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="partner_assigned_id"/>
<field name="date_assign" invisible="1"/>
</field>
</field>
</record>
@ -54,6 +55,9 @@
<field name="arch" type="xml">
<filter string="Team" position="after">
<filter string="Assigned Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_assigned_id'}"/>
<filter string="Assigned Month" icon="terp-go-month"
domain="[]" context="{'group_by':'date_assign'}"/>
</filter>
<field name="partner_id" position="after">

View File

@ -407,7 +407,6 @@ class hr_applicant(base_stage, osv.Model):
'department_id': applicant.department_id.id
})
self.write(cr, uid, [applicant.id], {'emp_id': emp_id}, context=context)
self.case_close(cr, uid, [applicant.id], context)
else:
raise osv.except_osv(_('Warning!'), _('You must define an Applied Job and a Contact Name for this applicant.'))
@ -439,6 +438,12 @@ class hr_applicant(base_stage, osv.Model):
context['empty_list_help_document_name'] = _("job applicants")
return super(hr_applicant, self).get_empty_list_help(cr, uid, help, context=context)
def write(self, cr, uid, ids, vals, context=None):
if 'stage_id' in vals:
vals['date_closed'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
result = super(hr_applicant, self).write(cr, uid, ids, vals, context=context)
return result
class hr_job(osv.osv):
_inherit = "hr.job"

View File

@ -467,17 +467,11 @@
<field name="default" eval="False"/>
<field name="description">Stage changed</field>
</record>
<record id="mt_applicant_hired" model="mail.message.subtype">
<field name="name">Applicant Hired</field>
<record id="mt_applicant_assigned" model="mail.message.subtype">
<field name="name">Application Assigned</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Applicant hired</field>
</record>
<record id="mt_applicant_refused" model="mail.message.subtype">
<field name="name">Applicant Refused</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Applicant refused</field>
<field name="description">Application Assigned</field>
</record>
<!-- Applicant Categories(Tag) -->
<record id="tag_applicant_reserve" model="hr.applicant_category">

View File

@ -58,6 +58,7 @@
<field name="availability" invisible="1"/>
<field name="department_id" invisible="context.get('invisible_department', True)"/>
<field name="user_id"/>
<field name="date_closed" invisible="1"/>
</tree>
</field>
</record>
@ -195,6 +196,7 @@
<filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Source" domain="[]" context="{'group_by':'source_id'}"/>
<filter string="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Last Update Month" name="group_close_date" icon="terp-go-month" domain="[]" context="{'group_by':'date_closed'}"/>
</group>
</search>
</field>

View File

@ -83,7 +83,7 @@ class hr_recruitment_report(osv.osv):
(sum(salary_proposed)/count(*)) as salary_prop_avg,
sum(salary_expected) as salary_exp,
(sum(salary_expected)/count(*)) as salary_exp_avg,
extract('epoch' from (s.write_date-s.create_date))/(3600*24) as delay_close,
extract('epoch' from (s.date_closed-s.create_date))/(3600*24) as delay_close,
count(*) as nbr
from hr_applicant s
group by

View File

@ -567,7 +567,8 @@ class task(base_stage, osv.osv):
_track = {
'stage_id': {
'project.mt_task_stage': lambda self, cr, uid, obj, ctx=None: obj
'project.mt_task_new': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence == 1,
'project.mt_task_stage': lambda self, cr, uid, obj, ctx=None: obj.stage_id.sequence != 1,
},
'kanban_state': { # kanban state: tracked, but only block subtype
'project.mt_task_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
@ -678,7 +679,7 @@ class task(base_stage, osv.osv):
return {}
def onchange_user_assigned(self, cr, uid, ids, context=None):
return {'value':{'date_start': fields.datetime.now(),'date_end':False}}
return {'value':{'date_start': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT),'date_end':False}}
def duplicate_task(self, cr, uid, map_ids, context=None):
for new in map_ids.values():
@ -1058,6 +1059,7 @@ class task(base_stage, osv.osv):
action=self.pool.get('project.task.type').read(cr, uid, new_stage, ['action'],context=context)
if action['action']:
self._trigger_stage_action(cr, uid, ids, action, context)
vals['date_end'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
vals_reset_kstate = dict(vals, kanban_state='normal')
for t in self.browse(cr, uid, ids, context=context):
#TO FIX:Kanban view doesn't raise warning

View File

@ -86,11 +86,11 @@
<field name="default" eval="False"/>
<field name="description">Task created</field>
</record>
<record id="mt_task_started" model="mail.message.subtype">
<field name="name">Task Started</field>
<record id="mt_task_assigned" model="mail.message.subtype">
<field name="name">Task Assigned</field>
<field name="res_model">project.task</field>
<field name="default" eval="False"/>
<field name="description">Task started</field>
<field name="description">Task Assigned</field>
</record>
<record id="mt_task_blocked" model="mail.message.subtype">
<field name="name">Task Blocked</field>
@ -98,12 +98,6 @@
<field name="default" eval="False"/>
<field name="description">Task blocked</field>
</record>
<record id="mt_task_closed" model="mail.message.subtype">
<field name="name">Task Done</field>
<field name="res_model">project.task</field>
<field name="default" eval="False"/>
<field name="description">Task closed</field>
</record>
<record id="mt_task_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>
<field name="res_model">project.task</field>
@ -118,11 +112,11 @@
<field name="parent_id" eval="ref('mt_task_new')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_task_started" model="mail.message.subtype">
<field name="name">Task Started</field>
<record id="mt_project_task_assigned" model="mail.message.subtype">
<field name="name">Task Assigned</field>
<field name="res_model">project.project</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_task_started')"/>
<field name="parent_id" eval="ref('mt_task_assigned')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_task_blocked" model="mail.message.subtype">
@ -131,12 +125,6 @@
<field name="parent_id" eval="ref('mt_task_blocked')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_task_closed" model="mail.message.subtype">
<field name="name">Task Done</field>
<field name="res_model">project.project</field>
<field name="parent_id" eval="ref('mt_task_closed')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_task_stage" model="mail.message.subtype">
<field name="name">Task Stage Changed</field>
<field name="res_model">project.project</field>

View File

@ -34,6 +34,7 @@
<field name="stage_id"/>
<group expand="0" string="Group By...">
<filter string="Users" name="group_user_id" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string=" Assigned Month" name="group_start_date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
<filter string="Project" name="group_project_id" icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Deadline" icon="terp-gnome-cpu-frequency-applet+" domain="[]" context="{'group_by':'date_deadline'}"/>

View File

@ -22,6 +22,21 @@
from openerp.osv import fields,osv
from openerp import tools
MONTHS = [
('01', 'January'),
('02', 'February'),
('03', 'March'),
('04', 'April'),
('05', 'May'),
('06', 'June'),
('07', 'July'),
('08', 'August'),
('09', 'September'),
('10', 'October'),
('11', 'November'),
('12', 'December')
]
class report_project_task_user(osv.osv):
_name = "report.project.task.user"
_description = "Tasks by user and project"
@ -44,15 +59,17 @@ class report_project_task_user(osv.osv):
'total_hours': fields.float('Total Hours', readonly=True),
'closing_days': fields.float('Days to Close', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to close the task"),
'opening_days': fields.float('Days to Open', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to Open the task"),
'opening_days': fields.float('Delay to Assign', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Delay to Assign the task"),
'delay_endings_days': fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'nbr': fields.integer('# of tasks', readonly=True),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'),
('0','Very urgent')], 'Priority', 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),
'month':fields.selection(MONTHS, 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'partner_id': fields.many2one('res.partner', 'Contact', readonly=True),
'update_month': fields.selection(MONTHS,'Last Update', readonly=True),
'stage_id': fields.many2one('project.task.type', 'Stage'),
}
_order = 'name desc, project_id'
@ -65,6 +82,7 @@ class report_project_task_user(osv.osv):
t.id as id,
to_char(date_start, 'YYYY') as year,
to_char(date_start, 'MM') as month,
to_char(date_end, 'MM') as update_month,
to_char(date_start, 'YYYY-MM-DD') as day,
date_trunc('day',t.date_start) as date_start,
date_trunc('day',t.date_end) as date_end,

View File

@ -33,6 +33,8 @@
<field name="closing_days" sum='Days to Close'/>
<field name="delay_endings_days" sum='OverPass delay'/>
<field name="progress" sum='Progress' widget='progressbar'/>
<field name="update_month" invisible="1"/>
<field name="stage_id" invisible="1"/>
</tree>
</field>
</record>
@ -72,6 +74,9 @@
<filter string="Task" icon="terp-stock_align_left_24" context="{'group_by':'name'}" />
<filter string="Contact" icon="terp-partner" context="{'group_by':'partner_id'}" />
<filter string="Assigned to" name="User" icon="terp-personal" context="{'group_by':'user_id'}" />
<filter string="Assigned Month" icon="terp-go-month" context="{'group_by':'month'}" help="Assigned Month"/>
<filter string="Last Update" icon="terp-go-month" context="{'group_by':'update_month'}" help="Last Update Month"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Creation Date"/>

View File

@ -50,7 +50,8 @@ class project_issue(base_stage, osv.osv):
_track = {
'stage_id': {
'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None: obj,
'project_issue.mt_issue_new': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence == 1,
'project_issue.mt_issue_stage': lambda self, cr, uid, obj, ctx=None:obj.stage_id.sequence != 1,
},
'kanban_state': {
'project_issue.mt_issue_blocked': lambda self, cr, uid, obj, ctx=None: obj['kanban_state'] == 'blocked',
@ -65,6 +66,8 @@ class project_issue(base_stage, osv.osv):
if vals.get('project_id'):
ctx['default_project_id'] = vals['project_id']
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
if vals.get('user_id'):
vals['date_open'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
# context: no_log, because subtype already handle this
create_context = dict(context, mail_create_nolog=True)
return super(project_issue, self).create(cr, uid, vals, context=create_context)
@ -383,12 +386,10 @@ class project_issue(base_stage, osv.osv):
vals['date_action_last'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
for issue in self.browse(cr, uid, ids, context=context):
# Change from draft to not draft EXCEPT cancelled: The issue has been opened -> set the opening date
vals['date_closed'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
if stage['sequence'] == 1:
vals['date_open'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
# Change from not done to done: The issue has been closed -> set the closing date
sequence = [stage.sequence for stage in issue.project_id.type_ids[-2:]]
if stage['sequence'] in sequence:
vals['date_closed'] = time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)
vals['date_closed'] = False
return super(project_issue, self).write(cr, uid, ids, vals, context)
def onchange_task_id(self, cr, uid, ids, task_id, context=None):
@ -564,6 +565,8 @@ class project_issue(base_stage, osv.osv):
self.write(cr, SUPERUSER_ID, thread_id, {'date_action_last': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT)}, context=context)
return res
def onchange_user_assigned(self, cr, uid, ids, context=None):
return self.write(cr,uid,ids,{'date_open': time.strftime(tools.DEFAULT_SERVER_DATETIME_FORMAT),'date_close':False},context)
class project(osv.Model):
_inherit = "project.project"

View File

@ -35,11 +35,11 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="default" eval="False"/>
<field name="description">Issue created</field>
</record>
<record id="mt_issue_started" model="mail.message.subtype">
<field name="name">Issue Started</field>
<record id="mt_issue_assigned" model="mail.message.subtype">
<field name="name">Issue Assigned</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue started</field>
<field name="description">Issue Assigned</field>
</record>
<record id="mt_issue_blocked" model="mail.message.subtype">
<field name="name">Issue Blocked</field>
@ -47,12 +47,6 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="default" eval="False"/>
<field name="description">Issue blocked</field>
</record>
<record id="mt_issue_closed" model="mail.message.subtype">
<field name="name">Issue Closed</field>
<field name="res_model">project.issue</field>
<field name="default" eval="False"/>
<field name="description">Issue closed</field>
</record>
<record id="mt_issue_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>
<field name="res_model">project.issue</field>
@ -67,11 +61,11 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="parent_id" eval="ref('mt_issue_new')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_started" model="mail.message.subtype">
<field name="name">Issue Started</field>
<record id="mt_project_issue_assigned" model="mail.message.subtype">
<field name="name">Issue Assigned</field>
<field name="res_model">project.project</field>
<field name="default" eval="False"/>
<field name="parent_id" eval="ref('mt_issue_started')"/>
<field name="parent_id" eval="ref('mt_issue_assigned')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_blocked" model="mail.message.subtype">
@ -80,12 +74,6 @@ Access all issues from the top Project menu, and access the issues of a specific
<field name="parent_id" eval="ref('mt_issue_blocked')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_closed" model="mail.message.subtype">
<field name="name">Issue Closed</field>
<field name="res_model">project.project</field>
<field name="parent_id" eval="ref('mt_issue_closed')"/>
<field name="relation_field">project_id</field>
</record>
<record id="mt_project_issue_stage" model="mail.message.subtype">
<field name="name">Issue Stage Changed</field>
<field name="res_model">project.project</field>

View File

@ -64,7 +64,8 @@
<group>
<group>
<field name="user_id"
context="{'default_groups_ref': ['base.group_user', 'project.group_project_user']}"/>
context="{'default_groups_ref': ['base.group_user', 'project.group_project_user']}"
on_change="onchange_user_assigned()"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="email_from"/>
<label for="project_id"/>
@ -130,6 +131,8 @@
<field name="stage_id" widget="selection" readonly="1"/>
<field name="categ_ids" invisible="1"/>
<field name="task_id" invisible="1"/>
<field name="date_open" invisible="1"/>
<field name="date_closed" invisible="1"/>
</tree>
</field>
</record>
@ -152,6 +155,8 @@
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<group expand="0" string="Group By..." >
<filter string="Responsible" name="group_user_id" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string=" Last Update Month" name="group_close_date" icon="terp-go-month" domain="[]" context="{'group_by':'date_closed'}"/>
<filter string=" Assigned Month" name="group_open_date" icon="terp-go-month" domain="[]" context="{'group_by':'date_open'}"/>
<filter string="Contact" name="group_partner_id" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Project" name="group_project_id" icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="Version" name="group_version" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'version_id'}"/>

View File

@ -24,6 +24,20 @@ from openerp.osv import fields,osv
from openerp import tools
from openerp.addons.crm import crm
MONTHS = [
('01', 'January'),
('02', 'February'),
('03', 'March'),
('04', 'April'),
('05', 'May'),
('06', 'June'),
('07', 'July'),
('08', 'August'),
('09', 'September'),
('10', 'October'),
('11', 'November'),
('12', 'December')
]
class project_issue_report(osv.osv):
_name = "project.issue.report"
@ -32,12 +46,7 @@ class project_issue_report(osv.osv):
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'section_id':fields.many2one('crm.case.section', 'Sale Team', 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),
'month':fields.selection(MONTHS, 'Month', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'opening_date': fields.date('Date of Opening', readonly=True),
@ -56,6 +65,8 @@ class project_issue_report(osv.osv):
'project_id':fields.many2one('project.project', 'Project',readonly=True),
'version_id': fields.many2one('project.issue.version', 'Version'),
'user_id' : fields.many2one('res.users', 'Assigned to',readonly=True),
'assign_month':fields.selection(MONTHS, 'Assigned Month', readonly=True),
'update_month': fields.selection(MONTHS,'Last Update', readonly=True),
'partner_id': fields.many2one('res.partner','Contact'),
'channel_id': fields.many2one('crm.case.channel', 'Channel',readonly=True),
'task_id': fields.many2one('project.task', 'Task'),
@ -74,6 +85,8 @@ class project_issue_report(osv.osv):
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
c.user_id,
to_char(c.date_open, 'MM') as assign_month,
to_char(c.date_closed, 'MM') as update_month,
c.working_hours_open,
c.working_hours_close,
c.section_id,
@ -89,7 +102,7 @@ class project_issue_report(osv.osv):
c.task_id,
date_trunc('day',c.create_date) as create_date,
c.day_open as delay_open,
c.write_date as delay_close,
c.day_close as delay_close,
(SELECT count(id) FROM mail_message WHERE model='project.issue' AND res_id=c.id) AS email
FROM

View File

@ -16,6 +16,8 @@
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="section_id" invisible="1" groups="base.group_multi_salesteams"/>
<field name="user_id" invisible="1"/>
<field name="assign_month" invisible="1"/>
<field name="update_month" invisible="1"/>
<field name="channel_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="task_id" invisible="1"/>
@ -51,8 +53,11 @@
<field name="user_id"/>
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<field name="version_id"/>
<field name="stage_id"/>
<group expand="1" string="Group By...">
<filter string="Assigned to" name="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
<filter string="Assigned Month" icon="terp-go-month" domain="[]" context="{'group_by':'assign_month'}" help="Assigned Month"/>
<filter string="Last Update" icon="terp-go-month" domain="[]" context="{'group_by':'update_month'}" help="Update Month"/>
<filter string="Contact" icon="terp-partner" context="{'group_by':'partner_id'}" />
<filter string="Sale Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}" />
<filter string="Project" name="project" icon="terp-folder-violet" context="{'group_by':'project_id'}" />