diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py
index 0e3fef9603a..ef080317f53 100644
--- a/addons/crm/__terp__.py
+++ b/addons/crm/__terp__.py
@@ -47,9 +47,9 @@ between mails and Open ERP.""",
'depends': ['base'],
'init_xml': ['crm_data.xml'],
'update_xml': [
- 'crm_view.xml',
- 'crm_report.xml',
'crm_wizard.xml',
+ 'crm_view.xml',
+ 'crm_report.xml',
'security/crm_security.xml',
'security/ir.model.access.csv'
],
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
old mode 100644
new mode 100755
index b0f85a9e52a..673b14fe65d
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -42,8 +42,8 @@ MAX_LEVEL = 15
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
- ('cancel', 'Cancel'),
- ('done', 'Close'),
+ ('cancel', 'Cancelled'),
+ ('done', 'Closed'),
('pending','Pending')
]
@@ -74,7 +74,9 @@ class crm_case_section(osv.osv):
'reply_to': fields.char('Reply-To', size=64, help="The email address put in the 'Reply-To' of all emails sent by Open ERP about cases in this section"),
'parent_id': fields.many2one('crm.case.section', 'Parent Section'),
'child_ids': fields.one2many('crm.case.section', 'parent_id', 'Child Sections'),
- "gateway_ids" : fields.one2many("crm.email.gateway",'section_id',"Email Gateway")
+ "gateway_ids" : fields.one2many("crm.email.gateway",'section_id',"Email Gateway"),
+ 'calendar' : fields.boolean('Calendar', help='Allow to show calendar'),
+
}
_defaults = {
'active': lambda *a: 1,
@@ -1037,5 +1039,43 @@ class crm_email_history(osv.osv):
_order = 'id desc'
crm_email_history()
+
+class crm_email_add_cc_wizard(osv.osv_memory):
+ _name = "crm.email.add.cc"
+ _description = "Email Add CC"
+ _columns = {
+ 'name': fields.selection([('user','User'),('partner','Partner'),('email','Email Address')], 'Send to', required=True),
+ 'user_id': fields.many2one('res.users',"User"),
+ 'partner_id': fields.many2one('res.partner',"Partner"),
+ 'email': fields.char('Email', size=32),
+ }
+
+ def change_email(self, cr, uid, ids, user, partner):
+ if (not partner and not user):
+ return {'value':{'email': False}}
+ email = False
+ if partner:
+ addr = self.pool.get('res.partner').address_get(cr, uid, [partner], ['contact'])
+ if addr:
+ email = self.pool.get('res.partner.address').read(cr, uid,addr['contact'] , ['email'])['email']
+ elif user:
+ addr = self.pool.get('res.users').read(cr, uid, user, ['address_id'])['address_id']
+ if addr:
+ email = self.pool.get('res.partner.address').read(cr, uid,addr[0] , ['email'])['email']
+ return {'value':{'email': email}}
+
+
+ def add_cc(self, cr, uid, ids, context={}):
+ email = self.read(cr, uid, ids[0])['email']
+ if not context:
+ return {}
+ history_line = self.pool.get('crm.case.history').browse(cr, uid, context['active_id'])
+ crm_case = self.pool.get('crm.case')
+ case_id = history_line.log_id.case_id.id
+ crm_case.write(cr, uid, case_id, {'email_cc' : email})
+ return {}
+
+crm_email_add_cc_wizard()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml
old mode 100644
new mode 100755
index e9b23b8b50d..156ac40aa3a
--- a/addons/crm/crm_view.xml
+++ b/addons/crm/crm_view.xml
@@ -3,6 +3,7 @@
+
@@ -37,8 +38,11 @@
-
-
+
+
+
+
+
@@ -234,7 +238,39 @@
+
+
+ Add CC
+ crm.email.add.cc
+ form
+
+
+
+
+
+ Add CC
+ ir.actions.act_window
+ crm.email.add.cc
+ form
+ form
+ new
+
+
crm.case.log.tree
@@ -380,10 +416,14 @@
diff --git a/addons/crm/wizard/wizard_crm_new_send_email.py b/addons/crm/wizard/wizard_crm_new_send_email.py
index b905d31aa8e..330096c8373 100644
--- a/addons/crm/wizard/wizard_crm_new_send_email.py
+++ b/addons/crm/wizard/wizard_crm_new_send_email.py
@@ -27,6 +27,7 @@ import netsvc
import ir
import pooler
import tools
+import base64
from tools.translate import _
@@ -39,17 +40,35 @@ email_send_form = '''
+
+
+
+
+
+
+
+
+
'''
email_send_fields = {
'to': {'string':"To", 'type':'char', 'size':64, 'required':True},
'cc': {'string':"CC", 'type':'char', 'size':128,},
'subject': {'string':'Subject', 'type':'char', 'size':128, 'required':True},
- 'text': {'string':'Message', 'type':'text_tag', 'required':True}
+ 'text': {'string':'Message', 'type':'text_tag', 'required':True},
+ 'state':{'string':'State', 'type':'selection', 'selection':[('done','Done'),('pending','Pending'),('unchanged','Unchanged')]},
+ 'doc1' : {'string':"Attachment1", 'type':'binary'},
+ 'doc2' : {'string':"Attachment2", 'type':'binary'},
+ 'doc3' : {'string':"Attachment3", 'type':'binary'},
+ 'state' : {'string':"Set State to", 'type':'selection', 'required' : True, 'default' :'done',\
+ 'selection': [('unchanged','Unchanged'),('done','Done'),('pending','Pending')]},
}
# this sends an email to ALL the addresses of the selected partners.
def _mass_mail_send(self, cr, uid, data, context):
+ attach = filter(lambda x: x, [data['form']['doc1'], data['form']['doc2'], data['form']['doc3']])
+ attach = map(lambda x: x and ('Attachment'+str(attach.index(x)+1), base64.decodestring(x)), attach)
+
pool = pooler.get_pool(cr.dbname)
case_pool=pool.get('crm.case')
@@ -62,16 +81,32 @@ def _mass_mail_send(self, cr, uid, data, context):
emails = [data['form']['to']] + (data['form']['cc'] or '').split(',')
emails = filter(None, emails)
body = data['form']['text']
+ if not case.user_id.address_id.email:
+ raise wizard.except_wizard(_('Warning!'),("Please specify user's email address"))
if case.user_id.signature:
body += '\n\n%s' % (case.user_id.signature)
- tools.email_send(
+ flag = tools.email_send(
case.user_id.address_id.email,
emails,
data['form']['subject'],
+ body,
case_pool.format_body(body),
+ attach=attach,
reply_to=case.section_id.reply_to,
tinycrm=str(case.id)
)
+ if flag:
+ if data['form']['state'] == 'unchanged':
+ pass
+ elif data['form']['state'] == 'done':
+ case_pool.case_close(cr, uid, data['ids'])
+ elif data['form']['state'] == 'pending':
+ case_pool.case_pending(cr, uid, data['ids'])
+ cr.commit()
+ raise wizard.except_wizard(_('Message!'),("Email Successfully Sent..!!"))
+
+ else:
+ raise wizard.except_wizard(_('Warning!'),("Email is not sent Successfully"))
return {}
def _get_info(self, cr, uid, data, context):
diff --git a/addons/crm_configuration/__terp__.py b/addons/crm_configuration/__terp__.py
index dd50d455600..ad223e81625 100644
--- a/addons/crm_configuration/__terp__.py
+++ b/addons/crm_configuration/__terp__.py
@@ -48,7 +48,8 @@ meetings, eso.
'crm_fund_view.xml',
'crm_claims_view.xml',
'crm_phonecall_view.xml',
- 'crm_report_view.xml'
+ 'crm_report_view.xml',
+ 'crm_helpdesk_view.xml'
],
'update_xml': ['security/ir.model.access.csv', 'process/crm_configuration_process.xml'],
'demo_xml': [],
diff --git a/addons/crm_configuration/crm_bugs_menu.xml b/addons/crm_configuration/crm_bugs_menu.xml
index 218acd0e420..ff61776e21d 100644
--- a/addons/crm_configuration/crm_bugs_menu.xml
+++ b/addons/crm_configuration/crm_bugs_menu.xml
@@ -34,7 +34,7 @@
ALL BUGS
-->
- All Bugs
+ Bugs
crm.case
form
tree,calendar
@@ -62,644 +62,6 @@
-
-
- Bugs Waiting Approval
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Open Bugs
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Bugs With Patches Waiting Approval
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Bugs Not Fixed
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Pending Bugs
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Planned For Future Release
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Waiting For Reporter Response
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Old Bugs
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- My Bugs
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- New Bug
- crm.case
- form
- form,tree
-
-
-
-
-
-
- form
-
-
-
-
-
- tree
-
-
-
-
-
-
- My Open Bugs
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- My Bugs With Patches
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- My Bugs Not Fixed
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
-
- All Feature Requests
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- New Feature Request
- crm.case
- form
- form,tree
-
-
-
-
-
-
- form
-
-
-
-
-
- tree
-
-
-
-
-
-
- Feature Requests Waiting Approval
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- Open Feature Requests
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Pending Feature Requests
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Planned For Future Release
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Waiting For Reporter Response
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Old Feature Requests
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
diff --git a/addons/crm_configuration/crm_bugs_view.xml b/addons/crm_configuration/crm_bugs_view.xml
old mode 100644
new mode 100755
index a48c54de94c..612037d1c20
--- a/addons/crm_configuration/crm_bugs_view.xml
+++ b/addons/crm_configuration/crm_bugs_view.xml
@@ -23,19 +23,21 @@
-
-
+
-
+
+
+
+
@@ -76,6 +78,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -134,20 +149,42 @@
search
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/addons/crm_configuration/crm_claims_menu.xml b/addons/crm_configuration/crm_claims_menu.xml
index 9f98aaeffcd..ba825bfef1e 100644
--- a/addons/crm_configuration/crm_claims_menu.xml
+++ b/addons/crm_configuration/crm_claims_menu.xml
@@ -34,143 +34,5 @@
-
-
- My Claims
- crm.case
- tree,form,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Claims
- crm.case
- form
-
-
-
-
-
-
- form
-
-
-
-
-
-
- My Unclosed Claims
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- My Open Claims
- crm.case
- tree,calendar,form
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
-
-
-
- All Unclosed Claims
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
+
diff --git a/addons/crm_configuration/crm_claims_view.xml b/addons/crm_configuration/crm_claims_view.xml
old mode 100644
new mode 100755
index 730072228fa..706e38602de
--- a/addons/crm_configuration/crm_claims_view.xml
+++ b/addons/crm_configuration/crm_claims_view.xml
@@ -12,17 +12,12 @@
+
-
-
-
-
+
+
+
-
-
-
-
-
@@ -41,12 +36,15 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -155,19 +153,26 @@
search
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
+
diff --git a/addons/crm_configuration/crm_config.py b/addons/crm_configuration/crm_config.py
index 10805576844..f4873bb1735 100644
--- a/addons/crm_configuration/crm_config.py
+++ b/addons/crm_configuration/crm_config.py
@@ -23,6 +23,9 @@ import tools
from osv import fields, osv
import os
import pooler
+import netsvc
+from tools.translate import _
+from osv.orm import except_orm
#AVAILABLE_STATES = [
# ('draft','Unreviewed'),
@@ -184,5 +187,45 @@ class crm_menu_config_wizard(osv.osv_memory):
crm_menu_config_wizard()
+
+class crm_generic_wizard(osv.osv_memory):
+ _name = 'crm.generic_wizard'
+
+ _columns = {
+ 'section_id': fields.many2one('crm.case.section', 'Section', required=True),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
+ }
+
+ def _get_default_section(self, cr, uid, context):
+ case_id = context.get('active_id',False)
+ if not case_id:
+ return False
+ case_obj = self.pool.get('crm.case')
+ case = case_obj.read(cr, uid, case_id, ['state','section_id'])
+ if case['state'] in ('done'):
+ raise osv.except_osv(_('Error !'), _('You can not assign Closed Case.'))
+ return case['section_id']
+
+
+ _defaults = {
+ 'section_id': _get_default_section
+ }
+ def action_create(self, cr, uid, ids, context=None):
+ case_obj = self.pool.get('crm.case')
+ case_id = context.get('active_id',[])
+ res = self.read(cr, uid, ids)[0]
+ case = case_obj.read(cr, uid, case_id, ['state'])
+ if case['state'] in ('done'):
+ raise osv.except_osv(_('Error !'), _('You can not assign Closed Case.'))
+ new_case_id = case_obj.copy(cr, uid, case_id, default=
+ {
+ 'section_id':res.get('section_id',False),
+ 'user_id':res.get('user_id',False)
+ }, context=context)
+ case_obj.write(cr, uid, case_id, {'case_id':new_case_id}, context=context)
+ case_obj.case_close(cr, uid, [case_id])
+ return {}
+
+crm_generic_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_configuration/crm_config_view.xml b/addons/crm_configuration/crm_config_view.xml
index 87ee5c2524e..c65344fbcb8 100644
--- a/addons/crm_configuration/crm_config_view.xml
+++ b/addons/crm_configuration/crm_config_view.xml
@@ -111,6 +111,36 @@
+
+
+
+ crm.generic_wizard.form
+ crm.generic_wizard
+ form
+
+
+
+
+
+ Generic Wizard
+ crm.generic_wizard
+ form
+
+ form
+ new
+
+
diff --git a/addons/crm_configuration/crm_configuration_wizard.xml b/addons/crm_configuration/crm_configuration_wizard.xml
index 8bacfa6b68d..dfd1397902e 100644
--- a/addons/crm_configuration/crm_configuration_wizard.xml
+++ b/addons/crm_configuration/crm_configuration_wizard.xml
@@ -3,7 +3,7 @@
@@ -31,6 +31,14 @@
name="crm.case.opportunity_set"
multi="True"
string="Convert To Opportunity"/>
+
+
+
+
+
diff --git a/addons/crm_configuration/crm_fund_menu.xml b/addons/crm_configuration/crm_fund_menu.xml
index 44df34c9f06..652a176091b 100644
--- a/addons/crm_configuration/crm_fund_menu.xml
+++ b/addons/crm_configuration/crm_fund_menu.xml
@@ -31,182 +31,6 @@
-
-
-
- My Funds
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- graph
-
-
-
-
-
- form
-
-
-
-
-
-
- Funds
- crm.case
- form,graph
-
-
-
-
-
-
- graph
-
-
-
-
-
- form
-
-
-
-
-
-
- My Funds Waiting Validation
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- My Funds To Be Processed
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
-
-
-
- All Funds Waiting Validation
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- All Funds To Be Processed
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
diff --git a/addons/crm_configuration/crm_fund_view.xml b/addons/crm_configuration/crm_fund_view.xml
index 9398786ec25..1e96637eee9 100644
--- a/addons/crm_configuration/crm_fund_view.xml
+++ b/addons/crm_configuration/crm_fund_view.xml
@@ -153,11 +153,15 @@
-
+
-
-
-
+
+
+
diff --git a/addons/crm_configuration/crm_helpdesk_menu.xml b/addons/crm_configuration/crm_helpdesk_menu.xml
index 7989897f927..1a0885440c5 100644
--- a/addons/crm_configuration/crm_helpdesk_menu.xml
+++ b/addons/crm_configuration/crm_helpdesk_menu.xml
@@ -8,7 +8,7 @@
All Helpdesk Requests
crm.case
tree,calendar,form
-
+
@@ -16,7 +16,7 @@
tree
-
+
@@ -28,7 +28,7 @@
form
-
+
@@ -37,7 +37,7 @@
My Helpdesk
crm.case
tree,calendar,form
-
+
@@ -46,356 +46,22 @@
tree
-
+
calendar
-
+
form
-
+
-
-
-
- New Helpdesk
- crm.case
- form,tree
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
-
- My Unclosed Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
-
- calendar
-
-
-
-
-
-
- form
-
-
-
-
-
-
-
- My helpdesk Propositions to Review
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- My Pending helpdesk Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- My Open Helpdesk Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
-
- Calendar of Helpdesk
- crm.case
- calendar,tree,form
-
-
-
-
-
-
- calendar
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
-
-
-
-
-
- All Unclosed Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- All Helpdesk Propositions
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- All Pending Helpdesk Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
-
- All Open Helpdesk Requests
- crm.case
- tree,calendar,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Calendar of Helpdesk
- crm.case
- calendar,tree,form
-
-
-
-
-
-
- calendar
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
diff --git a/addons/crm_configuration/crm_helpdesk_view.xml b/addons/crm_configuration/crm_helpdesk_view.xml
new file mode 100644
index 00000000000..63b7141eebe
--- /dev/null
+++ b/addons/crm_configuration/crm_helpdesk_view.xml
@@ -0,0 +1,158 @@
+
+
+
+
+ # ------------------------------------------------------
+ # Helpdisk Support
+ # ------------------------------------------------------
+
+
+ CRM - Helpdisk Support Form
+ crm.case
+ form
+
+
+
+
+
+
+ CRM - Helpdisk Support Calendar
+ crm.case
+ calendar
+
+
+
+
+
+
+
+
+
+
+
+ CRM - Helpdisk Support Tree
+ crm.case
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/crm_configuration/crm_jobs_menu.xml b/addons/crm_configuration/crm_jobs_menu.xml
index 06762cae4a9..507f97ea237 100644
--- a/addons/crm_configuration/crm_jobs_menu.xml
+++ b/addons/crm_configuration/crm_jobs_menu.xml
@@ -4,478 +4,48 @@
######################## JOB OPPORTUNITIES (menu) ###########################
-
+
All Jobs Requests
crm.case
tree,calendar,form,graph
-
+
-
+
tree
-
-
+
+
-
+
calendar
-
-
+
+
-
+
form
-
-
+
+
-
+
graph
-
+
-
-
- My Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- New Job Request
- crm.case
- form,tree
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- My Current Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- My Jobs Propositions to Review
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- My Pending Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- My Open Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- Calendar Of My Interviews
- crm.case
- calendar,tree,form,graph
-
-
-
-
-
-
- calendar
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
-
-
-
-
- Current Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- All Jobs Propositions to Review
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- All Pending Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- All Open Jobs Requests
- crm.case
- tree,calendar,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- Calendar Of Interviews
- crm.case
- calendar,tree,form,graph
-
-
-
-
-
-
- calendar
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
+
diff --git a/addons/crm_configuration/crm_jobs_view.xml b/addons/crm_configuration/crm_jobs_view.xml
old mode 100644
new mode 100755
index bb109a3c488..c7a2f08c72a
--- a/addons/crm_configuration/crm_jobs_view.xml
+++ b/addons/crm_configuration/crm_jobs_view.xml
@@ -5,7 +5,7 @@
# Jobs
# ------------------------------------------------------
-
+
CRM - Jobs Requests Tree
crm.case
tree
@@ -13,10 +13,10 @@
-
-
+
+
+
-
@@ -30,7 +30,7 @@
-
+
CRM - Jobs Requests Form
crm.case
form
@@ -40,7 +40,8 @@
-
+
@@ -60,8 +61,11 @@
-
+
+
+
+
@@ -137,7 +141,7 @@
-
+
CRM - Jobs Requests Calendar
crm.case
calendar
@@ -157,19 +161,34 @@
search
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
diff --git a/addons/crm_configuration/crm_lead_menu.xml b/addons/crm_configuration/crm_lead_menu.xml
index 6127d36b35a..204bd7b9238 100644
--- a/addons/crm_configuration/crm_lead_menu.xml
+++ b/addons/crm_configuration/crm_lead_menu.xml
@@ -27,251 +27,6 @@
-
-
-
- Current Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- Unassigned Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- All Draft Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- All Prospects to Qualify
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- All Pending Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
-
- My Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- New Prospect
- crm.case
- form
- form,tree
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- My Current Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- My Prospects to Qualify
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- My Pending Prospects
- crm.case
- tree,form
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
diff --git a/addons/crm_configuration/crm_lead_view.xml b/addons/crm_configuration/crm_lead_view.xml
index 5a98e4121dd..5efe38fa177 100644
--- a/addons/crm_configuration/crm_lead_view.xml
+++ b/addons/crm_configuration/crm_lead_view.xml
@@ -15,13 +15,13 @@
+
+
-
-
@@ -35,7 +35,14 @@
-
+
+
+
+
+
@@ -85,7 +92,7 @@
-
+
@@ -98,7 +105,7 @@
-
+
@@ -140,12 +147,10 @@
-
-
-
+
-
+
@@ -163,30 +168,61 @@
-
+
+
crm.case.leads.select
crm.case
search
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+ res.partner.crm.form.inherit
+ res.partner
+ form
+
+
+
+
+
+
+
diff --git a/addons/crm_configuration/crm_meeting_data.xml b/addons/crm_configuration/crm_meeting_data.xml
index 441cb45a0fc..086222c9f25 100644
--- a/addons/crm_configuration/crm_meeting_data.xml
+++ b/addons/crm_configuration/crm_meeting_data.xml
@@ -5,6 +5,7 @@
Meetings
Mtngs
+ True
diff --git a/addons/crm_configuration/crm_meeting_menu.xml b/addons/crm_configuration/crm_meeting_menu.xml
old mode 100644
new mode 100755
index 0f519b55a04..c5d8f30a911
--- a/addons/crm_configuration/crm_meeting_menu.xml
+++ b/addons/crm_configuration/crm_meeting_menu.xml
@@ -47,6 +47,7 @@
+
@@ -81,7 +82,7 @@
crm.case
calendar,tree,form,graph,gantt
-
+
@@ -112,33 +113,6 @@
-
- New Meeting
- crm.case
- form
- form,tree
-
-
-
-
-
-
- form
-
-
-
-
-
- tree
-
-
-
-
-
-
diff --git a/addons/crm_configuration/crm_meeting_view.xml b/addons/crm_configuration/crm_meeting_view.xml
old mode 100644
new mode 100755
index 1febc90046a..67ed305e864
--- a/addons/crm_configuration/crm_meeting_view.xml
+++ b/addons/crm_configuration/crm_meeting_view.xml
@@ -18,7 +18,11 @@
-
+
+
+
+
+
@@ -37,66 +41,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/crm_configuration/crm_opportunity_menu.xml b/addons/crm_configuration/crm_opportunity_menu.xml
index 120ed288f92..e14614531c6 100644
--- a/addons/crm_configuration/crm_opportunity_menu.xml
+++ b/addons/crm_configuration/crm_opportunity_menu.xml
@@ -34,186 +34,6 @@
-
-
-
- All Open Opportunities
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
-
- All Unassigned Opportunities
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
-
-
- My Opportunities
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- Opportunity
- crm.case
- form
- form,tree
-
-
-
-
-
-
- form
-
-
-
-
-
- tree
-
-
-
-
-
-
- My Open Opportunities
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
-
-
- My Pending Opportunities
- crm.case
- tree,form,graph
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- graph
-
-
-
-
diff --git a/addons/crm_configuration/crm_opportunity_view.xml b/addons/crm_configuration/crm_opportunity_view.xml
index 0e30b8cd733..22fe5552413 100644
--- a/addons/crm_configuration/crm_opportunity_view.xml
+++ b/addons/crm_configuration/crm_opportunity_view.xml
@@ -6,6 +6,15 @@
# Opportunities
# ------------------------------------------------------
+
+
CRM - Opportunities Form
crm.case
@@ -25,8 +34,11 @@
-
-
+
+
+
+
+
@@ -135,36 +147,49 @@
-
-
-
+
-
+
+
crm.case.opportunities.select
crm.case
search
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
diff --git a/addons/crm_configuration/crm_phonecall_menu.xml b/addons/crm_configuration/crm_phonecall_menu.xml
index 16e9f552e52..1897c3c24ac 100644
--- a/addons/crm_configuration/crm_phonecall_menu.xml
+++ b/addons/crm_configuration/crm_phonecall_menu.xml
@@ -52,7 +52,7 @@
-
+
@@ -72,173 +72,6 @@
-
-
-
- New Incoming Call
- crm.case
- form
- tree
-
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- Planned Calls
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-################################################################
-
- Outbound
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- New Outgoing Call
- crm.case
- form
- tree
-
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- Planned Calls
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
-
-
- Calls Not Held
- crm.case
- form
- tree,calendar
-
-
-
-
-
-
-
- tree
-
-
-
-
-
- calendar
-
-
-
-
-
- form
-
-
-
-
diff --git a/addons/crm_configuration/crm_phonecall_view.xml b/addons/crm_configuration/crm_phonecall_view.xml
index 74b4f91de37..1a70b69ccf7 100644
--- a/addons/crm_configuration/crm_phonecall_view.xml
+++ b/addons/crm_configuration/crm_phonecall_view.xml
@@ -10,20 +10,17 @@
crm.case
tree
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -37,17 +34,18 @@
-
-
+
+
-
-
-
+
+
+
+
@@ -55,11 +53,14 @@
-
-
-
+
+
+
+
+
+
-
+
@@ -74,55 +75,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -148,71 +101,43 @@
search
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- crm.case.inbound.phonecalls.select
- crm.case
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- crm.case.outbound.phonecalls.select
- crm.case
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_configuration/wizard/__init__.py b/addons/crm_configuration/wizard/__init__.py
index 7469c2ac483..d8995686cf8 100644
--- a/addons/crm_configuration/wizard/__init__.py
+++ b/addons/crm_configuration/wizard/__init__.py
@@ -24,4 +24,6 @@ import wizard_partner_create
import wizard_opportunity_set
import schedule_phone_call
import wizard_history_event
+import wizard_partner_opportunity
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/crm_configuration/wizard/schedule_phone_call.py b/addons/crm_configuration/wizard/schedule_phone_call.py
index ca65352efd8..4d17a36455f 100644
--- a/addons/crm_configuration/wizard/schedule_phone_call.py
+++ b/addons/crm_configuration/wizard/schedule_phone_call.py
@@ -32,7 +32,7 @@ from tools.translate import _
case_form = """
-
+
@@ -45,7 +45,7 @@ case_form = """
case_fields = {
'user_id' : {'string' : 'Assign To', 'type' : 'many2one', 'relation' : 'res.users'},
- 'deadline' : {'string' : 'Planned Date', 'type' : 'datetime', 'required' : True},
+ 'deadline' : {'string' : 'Planned Date', 'type' : 'datetime'},
'note' : {'string' : 'Goals', 'type' : 'text'},
'category_id' : {'string' : 'Category', 'type' : 'many2one', 'relation' : 'crm.case.categ', 'required' : True},
'section_id' : {'string' : 'Section', 'type' : 'many2one', 'relation' : 'crm.case.section', 'required' : True},
@@ -68,7 +68,6 @@ class reschedule_phone_call(wizard.interface):
return {
'user_id' : case.user_id and case.user_id.id,
'category_id' : categ_id and categ_id[0] or case.categ_id and case.categ_id.id,
- 'deadline' : time.strftime('%Y-%m-%d %H:%M:%S'),
'section_id' : sec_id and sec_id[0],
'note' : case.description
}
@@ -104,8 +103,8 @@ class reschedule_phone_call(wizard.interface):
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'crm.case',
-# 'view_id': id2,
- 'views': [(id2,'tree'),(id3,'form'),(False,'calendar'),(False,'graph')],
+ 'res_id' : new_case,
+ 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')],
'type': 'ir.actions.act_window',
'search_view_id': res['res_id']
}
diff --git a/addons/crm_configuration/wizard/wizard_opportunity_set.py b/addons/crm_configuration/wizard/wizard_opportunity_set.py
index b4e3ea5dd96..e148f53c1cb 100644
--- a/addons/crm_configuration/wizard/wizard_opportunity_set.py
+++ b/addons/crm_configuration/wizard/wizard_opportunity_set.py
@@ -114,10 +114,15 @@ class make_opportunity(wizard.interface):
'case_id':data['id'],
'state':'open',
})
- case_obj.write(cr, uid, [data['id']], {
+
+ vals = {
'partner_id': data['form']['partner_id'],
'state':'done',
- })
+ }
+ case_id = case_obj.read(cr, uid, data['id'], ['case_id'])['case_id']
+ if not case_id:
+ vals.update({'case_id' : new_pros})
+ case_obj.write(cr, uid, [data['id']], vals)
value = {
'domain': "[('section_id','=',%d)]"%(id),
'name': _('Opportunity'),
diff --git a/addons/crm_configuration/wizard/wizard_partner_opportunity.py b/addons/crm_configuration/wizard/wizard_partner_opportunity.py
new file mode 100644
index 00000000000..487035ea3d2
--- /dev/null
+++ b/addons/crm_configuration/wizard/wizard_partner_opportunity.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# 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 .
+#
+##############################################################################
+
+from mx.DateTime import now
+
+import wizard
+import netsvc
+import ir
+import pooler
+from tools.translate import _
+
+
+case_form = """
+
+
+
+
+
+
+ """
+
+case_fields = {
+ 'name' : {'type' :'char', 'size' :64, 'string' :'Opportunity Name', 'required' :True},
+ 'planned_revenue' : {'type' :'float', 'digits' :(16, 2), 'string' : 'Expected Revenue'},
+ 'probability' : {'type' :'float', 'digits' :(16, 2), 'string' : 'Success Probability'},
+ 'partner_id' : {'type' :'many2one', 'relation' :'res.partner', 'string' :'Partner'},
+}
+
+
+class create_opportunity(wizard.interface):
+
+ def _select_data(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ part_obj = pool.get('res.partner')
+ part = part_obj.read(cr, uid, data['id' ], ['name'])
+ return {'partner_id' : data['id'], 'name' : part['name'] }
+
+ def _make_opportunity(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ data_obj = pool.get('ir.model.data')
+ result = data_obj._get_id(cr, uid, 'crm_configuration', 'view_crm_case_opportunities_filter')
+ res = data_obj.read(cr, uid, result, ['res_id'])
+ section_obj = pool.get('crm.case.section')
+ id = section_obj.search(cr, uid, [('code', '=', 'oppor')], context=context)
+ if not id:
+ raise wizard.except_wizard(_('Error !'),
+ _('You did not installed the opportunities tracking when you configured the crm_configuration module.' \
+ '\nYou can not convert the prospect to an opportunity, you must create a section with the code \'oppor\'.'
+ ))
+ id = id[0]
+
+ id2 = data_obj._get_id(cr, uid, 'crm_configuration', 'crm_case_form_view_oppor')
+ id3 = data_obj._get_id(cr, uid, 'crm_configuration', 'crm_case_tree_view_oppor')
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ part_obj = pool.get('res.partner')
+ address = part_obj.address_get(cr, uid, data['ids' ])
+
+
+ categ_obj = pool.get('crm.case.categ')
+ categ_ids = categ_obj.search(cr, uid, [('section_id','=',id), ('name','ilike','Part%')])
+
+ case_obj = pool.get('crm.case')
+ opp_id = case_obj.create(cr, uid, {
+ 'section_id' : id,
+ 'name' : data['form']['name'],
+ 'planned_revenue' : data['form']['planned_revenue'],
+ 'probability' : data['form']['probability'],
+ 'partner_id' : data['form']['partner_id'],
+ 'partner_address_id' : address['default'],
+ 'categ_id' : categ_ids[0],
+ 'case_id' :data['id'],
+ 'state' :'draft',
+ })
+ value = {
+ 'domain' : "[('section_id','=',%d)]"%(id),
+ 'name' : _('Opportunity'),
+ 'view_type' : 'form',
+ 'view_mode' : 'form,tree',
+ 'res_model' : 'crm.case',
+ 'res_id' : opp_id,
+ 'view_id' : False,
+ 'views' : [(id2, 'form'), (id3, 'tree'), (False, 'calendar'), (False, 'graph')],
+ 'type' : 'ir.actions.act_window',
+ 'search_view_id' : res['res_id']
+ }
+ return value
+
+ states = {
+ 'init' : {
+ 'actions' : [_select_data],
+ 'result' : {'type' : 'form', 'arch' : case_form, 'fields' : case_fields,
+ 'state' : [('end', 'Cancel', 'gtk-cancel'), ('confirm', 'Create Opportunity', 'gtk-go-forward')]}
+ },
+ 'confirm' : {
+ 'actions' : [],
+ 'result' : {'type' : 'action', 'action' : _make_opportunity, 'state' : 'end'}
+ }
+ }
+
+create_opportunity('crm.case.partner.opportunity_create')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/report_analytic_planning/report_analytic_planning_view.xml b/addons/report_analytic_planning/report_analytic_planning_view.xml
index 80f2c8e49c3..b8fd81d2091 100644
--- a/addons/report_analytic_planning/report_analytic_planning_view.xml
+++ b/addons/report_analytic_planning/report_analytic_planning_view.xml
@@ -389,7 +389,7 @@
-
+