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..7c054364583 --- 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 + +
+ + + + + + +