[Add] crm: distinct objects for all different type of casesand create new object for bug

bzr revid: sbh@tinyerp.com-20091230102044-dx1cvixfr48dtc9z
This commit is contained in:
sbh (Open ERP) 2009-12-30 15:50:44 +05:30
parent a5168c571c
commit b7a46bf63d
18 changed files with 710 additions and 48 deletions

View File

@ -23,6 +23,14 @@ import crm
import crm_segmentation
import crm_meeting
import crm_config
import crm_lead
import crm_phonecall
import crm_opportunity
import crm_claim
import crm_fundraising
import crm_job
import crm_helpdesk
import crm_project_bug
import report
import wizard

View File

@ -48,23 +48,37 @@ between mails and Open ERP.""",
'caldav',
'process'
],
'init_xml': ['crm_data.xml', 'crm_meeting_data.xml'
'init_xml': ['crm_data.xml',
'crm_meeting_data.xml',
'crm_claims_data.xml',
'crm_fund_data.xml',
'crm_helpdesk_data.xml',
'crm_jobs_data.xml',
'crm_lead_data.xml',
'crm_meeting_data.xml',
'crm_opportunity_data.xml',
'crm_phonecall_data.xml',
],
'update_xml': [
'crm_wizard.xml',
'crm_configuration_wizard.xml',
'crm_view.xml',
'crm_config_view.xml',
'crm_bugs_view.xml',
'crm_jobs_view.xml',
'crm_lead_view.xml',
'crm_jobs_menu.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'crm_meeting_wizard.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'crm_opportunity_view.xml',
'crm_opportunity_menu.xml',
'crm_fund_view.xml',
'crm_fund_menu.xml',
'crm_claims_view.xml',
'crm_claims_menu.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_report_view.xml',
'crm_helpdesk_view.xml',
'crm_report.xml',
@ -72,7 +86,17 @@ between mails and Open ERP.""",
'security/ir.model.access.csv',
'process/crm_configuration_process.xml'
],
'demo_xml': ['crm_demo.xml', 'crm_meeting_demo.xml'],
'demo_xml': [
'crm_demo.xml',
'crm_meeting_demo.xml',
'crm_claims_demo.xml',
'crm_fund_demo.xml',
'crm_helpdesk_demo.xml',
'crm_jobs_demo.xml',
'crm_lead_demo.xml',
'crm_meeting_demo.xml',
'crm_opportunity_demo.xml',
'crm_phonecall_demo.xml'],
'installable': True,
'active': False,
'certificate': '0079056041421',

66
addons/crm/crm_claim.py Normal file
View File

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import tools
from osv import fields, osv
import os
import pooler
import netsvc
from tools.translate import _
class crm_claim(osv.osv):
_name = "crm.claim"
_description = "Claim Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
def case_escalate(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_escalate',cr,uid,ids,*args,**argv)
def case_pending(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_pending',cr,uid,ids,*args,**argv)
crm_claim()

View File

@ -0,0 +1,73 @@
#-*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_fundraising(osv.osv):
_name = "crm.fundraising"
_description = "Fund Raising Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
def case_escalate(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_escalate',cr,uid,ids,*args,**argv)
def case_pending(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_pending',cr,uid,ids,*args,**argv)
crm_fundraising()

View File

@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_helpdesk(osv.osv):
_name = "crm.helpdesk"
_description = "Helpdesk Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id':fields.many2one('crm.case','Case'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
crm_helpdesk()

67
addons/crm/crm_job.py Normal file
View File

@ -0,0 +1,67 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_job(osv.osv):
_name = "crm.job"
_description = "Job Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
crm_job()

73
addons/crm/crm_lead.py Normal file
View File

@ -0,0 +1,73 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_lead(osv.osv):
_name = "crm.lead"
_description = "Leads Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id':fields.many2one('crm.case','Case'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
crm_lead()

View File

@ -80,11 +80,6 @@ class crm_meeting(osv.osv):
event_obj = self.pool.get('caldav.event')
res[case['id']] = str(event_obj.get_recurrent_dates(str(rule), exdate, case['date']))
return res
def _data_set(self, cr, uid, id, name, value, arg, context):
if not self.browse(cr, uid, id, context).rrule:
cr.execute("UPDATE crm_meeting set rdates='' where id=%s" % id)
return True
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
@ -100,8 +95,8 @@ class crm_meeting(osv.osv):
'exrule' : fields.char('Exception Rule', size=352, help="defines a rule or repeating pattern\
for anexception to a recurrence set"),
'rrule' : fields.char('Recurrent Rule', size=352),
'rdates' : fields.function(_get_rdates, method=True, fnct_inv=_data_set \
, store=True, type='text'),
'rdates' : fields.function(_get_rdates, method=True, string='Recurrent Dates', \
store=True, type='text'),
'attendees': fields.many2many('crm.caldav.attendee', 'crm_attendee_rel', 'case_id', \
'attendee_id', 'Attendees'),
'alarm_id' : fields.many2one('crm.caldav.alarm', 'Alarm'),
@ -189,9 +184,6 @@ class crm_meeting(osv.osv):
alarm_obj.__attribute__.update(crm_alarm.__attribute__)
vals = event_obj.import_ical(cr, uid, file_content)
for val in vals:
section_id = self.pool.get('crm.case.section').search(cr, uid, \
[('name', 'like', 'Meeting%')])[0]
val.update({'section_id' : section_id})
is_exists = common.uid2openobjectid(cr, val['id'], self._name )
val.pop('id')
if val.has_key('create_date'): val.pop('create_date')

View File

@ -0,0 +1,73 @@
#-*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_opportunity(osv.osv):
_name = "crm.opportunity"
_description = "Opportunity Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
def case_escalate(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_escalate',cr,uid,ids,*args,**argv)
def case_pending(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_pending',cr,uid,ids,*args,**argv)
crm_opportunity()

View File

@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from caldav import common
from dateutil.rrule import *
from osv import fields, osv
import datetime
import base64
import re
import time
import tools
class crm_phonecall(osv.osv):
_name = "crm.phonecall"
_description = "Phonecall Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id': fields.many2one('crm.case','Case',ondelete='cascade'),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
def case_escalate(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_escalate',cr,uid,ids,*args,**argv)
def case_pending(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_pending',cr,uid,ids,*args,**argv)
crm_phonecall()

View File

@ -19,7 +19,7 @@
#
##############################################################################
import crm_wizard
#import crm_wizard
import wizard_crm_send_email
import wizard_crm_new_send_email
import wizard_fetch_mail

View File

@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,44 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Customer Relationship Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """
This module provide Store the project bugs with cases
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': [ 'crm','project'],
'init_xml': [ 'crm_bugs_data.xml'
],
'update_xml': [ 'crm_bugs_view.xml',
'crm_bugs_menu.xml',
],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,7 +5,7 @@
((((((((((( Demo Cases )))))))))))
-->
<!--For Bug Tracking-->
<record id="crm_case_buginaccountsmodule0" model="crm.case">
<record id="crm_case_buginaccountsmodule0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_8"/>
<field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -29,7 +29,7 @@
<field model="res.partner.canal" name="canal_id" search="[('name','=','website')]"/>
</record>
<record id="crm_case_programnotgivingproperoutput0" model="crm.case">
<record id="crm_case_programnotgivingproperoutput0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_tang"/>
<field eval="time.strftime('%Y-%m-15 12:50:00')" name="date"/>
<field name="category2_id" ref="crm.category2"/>
@ -45,7 +45,7 @@
<field eval="&quot;Program not giving proper output&quot;" name="name"/>
</record>
<record id="crm_case_outputincorrect0" model="crm.case">
<record id="crm_case_outputincorrect0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_9"/>
<field eval="time.strftime('%Y-%m-18 14:30:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -61,7 +61,7 @@
<field eval="&quot;Output incorrect&quot;" name="name"/>
</record>
<record id="crm_case_problemloadingpage0" model="crm.case">
<record id="crm_case_problemloadingpage0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_13"/>
<field eval="time.strftime('%Y-%m-20 15:25:05')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -77,7 +77,7 @@
<field eval="&quot;Problem loading page&quot;" name="name"/>
</record>
<record id="crm_case_pagenotfound0" model="crm.case">
<record id="crm_case_pagenotfound0" model="crm.project.bug">
<field eval="time.strftime('%Y-%m-22 18:15:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
<field eval="&quot;3&quot;" name="priority"/>
@ -92,7 +92,7 @@
<field eval="&quot;Page not Found&quot;" name="name"/>
</record>
<record id="crm_case_programmingerror0" model="crm.case">
<record id="crm_case_programmingerror0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_10"/>
<field eval="time.strftime('%Y-%m-24 09:45:00')" name="date"/>
<field name="category2_id" ref="crm.category2"/>
@ -108,7 +108,7 @@
<field eval="&quot;Programming Error&quot;" name="name"/>
</record>
<record id="crm_case_logicalerrorinprogram0" model="crm.case">
<record id="crm_case_logicalerrorinprogram0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_6"/>
<field eval="time.strftime('%Y-%m-26 11:10:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -124,7 +124,7 @@
<field eval="&quot;Logical Error in Program&quot;" name="name"/>
</record>
<record id="crm_case_constrainterror0" model="crm.case">
<record id="crm_case_constrainterror0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_6"/>
<field eval="time.strftime('%Y-%m-25 13:35:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -140,7 +140,7 @@
<field eval="&quot;Constraint Error&quot;" name="name"/>
</record>
<record id="crm_case_errorinprogram0" model="crm.case">
<record id="crm_case_errorinprogram0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_10"/>
<field eval="time.strftime('%Y-%m-28 15:40:00')" name="date"/>
<field name="category2_id" ref="crm.category2"/>
@ -156,7 +156,7 @@
<field eval="&quot;Error in Program&quot;" name="name"/>
</record>
<record id="crm_case_patcheserrorinprogram0" model="crm.case">
<record id="crm_case_patcheserrorinprogram0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_9"/>
<field eval="time.strftime('%Y-%m-28 16:30:00')" name="date"/>
<field name="category2_id" ref="crm.category2"/>
@ -172,7 +172,7 @@
<field eval="&quot;Patches Error in Program&quot;" name="name"/>
</record>
<record id="crm_case_newfeaturestobeadded0" model="crm.case">
<record id="crm_case_newfeaturestobeadded0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_wong"/>
<field eval="time.strftime('%Y-%m-01 12:15:10')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -188,7 +188,7 @@
<field eval="&quot;New Features To Be Added&quot;" name="name"/>
</record>
<record id="crm_case_addmenustothemodule0" model="crm.case">
<record id="crm_case_addmenustothemodule0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_1"/>
<field eval="time.strftime('%Y-%m-05 18:00:00')" name="date"/>
<field name="category2_id" ref="crm.category2"/>
@ -205,7 +205,7 @@
<field eval="&quot;info@opensides.be&quot;" name="email_from"/>
</record>
<record id="crm_case_includeattendancesheetinproject0" model="crm.case">
<record id="crm_case_includeattendancesheetinproject0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_2"/>
<field eval="time.strftime('%Y-%m-10 17:05:30')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -222,7 +222,7 @@
<field eval="&quot;contact@tecsas.fr&quot;" name="email_from"/>
</record>
<record id="crm_case_createnewobject0" model="crm.case">
<record id="crm_case_createnewobject0" model="crm.project.bug">
<field model="res.partner.canal" name="canal_id" search="[('name','=','phone')]"/>
<field name="partner_address_id" ref="base.res_partner_address_6"/>
<field name="som" ref="base.som_happy"/>
@ -240,7 +240,7 @@
<field eval="&quot;Create new object&quot;" name="name"/>
</record>
<record id="crm_case_improvereportsinhrms0" model="crm.case">
<record id="crm_case_improvereportsinhrms0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_15"/>
<field eval="time.strftime('%Y-%m-19 12:15:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>
@ -256,7 +256,7 @@
<field eval="&quot;Improve Reports in HRMS&quot;" name="name"/>
</record>
<record id="crm_case_improvereportsinpms0" model="crm.case">
<record id="crm_case_improvereportsinpms0" model="crm.project.bug">
<field name="partner_address_id" ref="base.res_partner_address_15"/>
<field eval="time.strftime('%Y-%m-21 14:30:00')" name="date"/>
<field name="category2_id" ref="crm.category1"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<menuitem id="menu_aftersale" name="After-Sale Services" parent="crm.menu_crm"/>
<record model="crm.case.categ" id="categ1">
<field name="name">Bugs</field>
@ -35,13 +35,12 @@
-->
<record model="ir.actions.act_window" id="crm_case_categ_act0">
<field name="name">Bugs</field>
<field name="res_model">crm.case</field>
<field name="res_model">crm.project.bug</field>
<field name="view_type">form</field>
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="crm_case_tree_view"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support)+')]'"/>
<field name="context" eval="{'default_state':'open'}"/>
<field name="search_view_id" ref="crm.view_crm_case_bugs_filter"/>
<field name="search_view_id" ref="view_crm_case_bugs_filter"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view0">
<field name="sequence" eval="1"/>
@ -61,7 +60,8 @@
<field name="view_id" ref="crm_case_form_view"/>
<field name="act_window_id" ref="crm_case_categ_act0"/>
</record>
<menuitem name="Bug Tracking" id="menu_crm_case_bug_track" parent="menu_aftersale" action="crm_case_categ_act0"/>
<menuitem id="menu_aftertask" name="Bug" parent="project.menu_main"/>
<menuitem name="Bug Tracking" id="menu_crm_case_bug_track" parent="menu_aftertask" action="crm_case_categ_act0"/>
</data>
</openerp>

View File

@ -10,11 +10,12 @@
<record model="ir.ui.view" id="crm_case_form_view">
<field name="name">CRM - Bug Tracker Form</field>
<field name="model">crm.case</field>
<field name="model">crm.project.bug</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Bug Tracker Form">
<group colspan="4" col="6">
<field name="project_id"/>
<field name="name" string="Title" colspan="2"/>
<field name="section_id" colspan="1" widget="selection"/>
<label string="Resolution: " align="1.0"/>
@ -36,7 +37,7 @@
<field name="priority" string="Severity"/>
<group colspan="2">
<field name="case_id" select="1"/>
<button string="Assign" name="%(crm_generic_wizard_act)d" type="action" />
<button string="Assign" name="%(crm.crm_generic_wizard_act)d" type="action" />
</group>
<newline/>
<separator string= "Description" colspan="4"/>
@ -124,7 +125,7 @@
</record>
<record model="ir.ui.view" id="crm_case_tree_view">
<field name="name">CRM - Bug Tracker Tree</field>
<field name="model">crm.case</field>
<field name="model">crm.project.bug</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Bugs Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
@ -149,32 +150,32 @@
<record id="view_crm_case_bugs_filter" model="ir.ui.view">
<field name="name">crm.case.bugs.select</field>
<field name="model">crm.case</field>
<field name="model">crm.project.bug</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Bugs">
<group col="7" colspan="1">
<filter icon="gtk-apply" string="Fixed Bugs"
domain="[('section_id.name','=','Bug Tracking'),('stage_id.name','=','Fixed')]"
domain="[('stage_id.name','=','Fixed')]"
separator="1" help="All Fixed Bugs"
/>
<filter icon="gtk-media-pause" string="Waiting Bugs"
domain="[('section_id.name','=','Bug Tracking'),('stage_id.name','=','Awaiting Response')]"
domain="[('stage_id.name','=','Awaiting Response')]"
separator="1" help="All Waiting Bugs"
/>
<filter icon="gtk-media-forward" string="Future Bugs"
domain="[('section_id.name','=','Bug Tracking'),('stage_id.name','=','Future')]"
domain="[('stage_id.name','=','Future')]"
separator="1" help="All Future Bugs"
/>
<separator orientation="vertical"/>
<filter icon="gtk-home" string=" Today "
separator="1"
domain="[('date::date','=',time.strftime('%%Y-%%m-%%d'))]"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
help="Todays's bugs"
/>
<filter icon="gtk-media-rewind"
string=" 7 Days " separator="1"
domain="[('date::date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date::date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Bugs during last 7 days"
/>
</group>
@ -197,7 +198,7 @@
<record id="view_crm_case_feature_request_filter" model="ir.ui.view">
<field name="name">crm.case.feature.request.select</field>
<field name="model">crm.case</field>
<field name="model">crm.project.bug</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Feature Request">
@ -218,7 +219,7 @@
<record model="ir.ui.view" id="crm_case_calendar_view">
<field name="name">CRM - Bug Tracker Calendar</field>
<field name="model">crm.case</field>
<field name="model">crm.project.bug</field>
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">

View File

@ -0,0 +1,73 @@
#-*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
import re
import os
import mx.DateTime
import base64
from tools.translate import _
import tools
from osv import fields,osv,orm
from osv.orm import except_orm
class crm_project_bug(osv.osv):
_name = "crm.project.bug"
_description = "Project Bug Cases"
_order = "id desc"
_inherits = {'crm.case':"inherit_case_id"}
_columns = {
'inherit_case_id':fields.many2one('crm.case','Case'),
'project_id':fields.many2one('project.project', 'Project '),
}
def _map_ids(self, method, cr, uid, ids, *args, **argv):
case_data = self.browse(cr, uid, ids)
new_ids = []
for case in case_data:
if case.inherit_case_id:
new_ids.append(case.inherit_case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def onchange_case_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_case_id',cr,uid,ids,*args,**argv)
def onchange_partner_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_id',cr,uid,ids,*args,**argv)
def onchange_partner_address_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_partner_address_id',cr,uid,ids,*args,**argv)
def onchange_categ_id(self, cr, uid, ids, *args, **argv):
return self._map_ids('onchange_categ_id',cr,uid,ids,*args,**argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
crm_project_bug()