diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 0c9b75b4d41..0435a450f11 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -85,7 +85,6 @@ Creates a dashboard for CRM that includes: 'wizard/crm_opportunity_to_phonecall_view.xml', 'wizard/crm_partner_to_opportunity_view.xml', - 'wizard/crm_add_note_view.xml', 'wizard/crm_merge_opportunities_view.xml', 'crm_view.xml', diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index 2fc39c51505..462c8b91b67 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -20,8 +20,6 @@ ############################################################################## import mail_compose_message -import crm_add_note - import crm_lead_to_partner import crm_lead_to_opportunity import crm_phonecall_to_phonecall diff --git a/addons/crm/wizard/crm_add_note.py b/addons/crm/wizard/crm_add_note.py deleted file mode 100644 index 02f592f0136..00000000000 --- a/addons/crm/wizard/crm_add_note.py +++ /dev/null @@ -1,53 +0,0 @@ -from .. import crm -from osv import fields, osv -from tools.translate import _ -from mail.mail_message import truncate_text - -AVAILABLE_STATES = crm.AVAILABLE_STATES + [('unchanged', 'Unchanged')] - -class crm_add_note(osv.osv_memory): - """Adds a new note to the case.""" - _name = 'crm.add.note' - _description = "Add Internal Note" - - _columns = { - 'body': fields.text('Note Body', required=True), - 'state': fields.selection(AVAILABLE_STATES, string='Set New State To', - required=True), - } - - _defaults = { - 'state': 'unchanged' - } - - def action_add(self, cr, uid, ids, context=None): - if context is None: - context = {} - - if not context.get('active_model'): - raise osv.except_osv(_('Error'), _('Can not add note!')) - - model = context.get('active_model') - case_pool = self.pool.get(model) - - for obj in self.browse(cr, uid, ids, context=context): - case_list = case_pool.browse(cr, uid, context['active_ids'], - context=context) - case = case_list[0] - case_pool.message_append(cr, uid, [case], truncate_text(obj.body), - body_text=obj.body) - if obj.state == 'unchanged': - pass - elif obj.state == 'done': - case_pool.case_close(cr, uid, [case.id]) - elif obj.state == 'draft': - case_pool.case_reset(cr, uid, [case.id]) - elif obj.state in ['cancel', 'open', 'pending']: - act = 'case_' + obj.state - getattr(case_pool, act)(cr, uid, [case.id]) - - return {'type': 'ir.actions.act_window_close'} - -crm_add_note() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/wizard/crm_add_note_view.xml b/addons/crm/wizard/crm_add_note_view.xml deleted file mode 100644 index 93551eaf943..00000000000 --- a/addons/crm/wizard/crm_add_note_view.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - crm.new.add.note.form - crm.add.note - form - -
-
-
- - - - -
-
-
- - - - - Add Note - crm.add.note - form - form - - new - - -
-
-