diff --git a/addons/account/account.py b/addons/account/account.py
index 2f02e54e00b..fa30b20f2ca 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -730,7 +730,7 @@ class account_journal(osv.osv):
'view_id': fields.many2one('account.journal.view', 'Display Mode', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tells OpenERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]", help="It acts as a default account for credit amount"),
'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]", help="It acts as a default account for debit amount"),
- 'centralisation': fields.boolean('Centralised counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
+ 'centralisation': fields.boolean('Centralised Counterpart', help="Check this box to determine that each entry of this journal won't create a new counterpart but will share the same counterpart. This is used in fiscal year closing."),
'update_posted': fields.boolean('Allow Cancelling Entries', help="Check this box if you want to allow the cancellation the entries related to this journal or of the invoice related to this journal"),
'group_invoice_lines': fields.boolean('Group Invoice Lines', help="If this box is checked, the system will try to group the accounting lines when generating them from invoices."),
'sequence_id': fields.many2one('ir.sequence', 'Entry Sequence', help="This field contains the information related to the numbering of the journal entries of this journal.", required=True),
diff --git a/addons/base_status/base_state.py b/addons/base_status/base_state.py
index 35995ac7da3..4247e67f435 100644
--- a/addons/base_status/base_state.py
+++ b/addons/base_status/base_state.py
@@ -19,7 +19,7 @@
#
##############################################################################
-from osv import fields
+from osv import fields, osv
from tools.translate import _
class base_state(object):
@@ -92,6 +92,24 @@ class base_state(object):
data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
return {'value': data}
+ def case_escalate(self, cr, uid, ids, context=None):
+ """ Escalates case to parent level """
+ cases = self.browse(cr, uid, ids, context=context)
+ cases[0].state # fill browse record cache, for _action having old and new values
+ data = {'active': True}
+ for case in cases:
+ parent_id = case.section_id.parent_id
+ if parent_id:
+ data['section_id'] = parent_id.id
+ if parent_id.change_responsible and parent_id.user_id:
+ data['user_id'] = parent_id.user_id.id
+ else:
+ raise osv.except_osv(_('Error !'), _('You can not escalate, you are already at the top level regarding your sales-team category.'))
+ self.write(cr, uid, [case.id], data, context=context)
+ case.case_escalate_send_note(parent_id, context=context)
+ self._action(cr, uid, cases, 'escalate', context=context)
+ return True
+
def case_open(self, cr, uid, ids, context=None):
""" Opens case """
cases = self.browse(cr, uid, ids, context=context)
@@ -170,6 +188,15 @@ class base_state(object):
self.message_append_note(cr, uid, [id], body=msg, context=context)
return True
+ def case_escalate_send_note(self, cr, uid, ids, new_section=None, context=None):
+ for id in ids:
+ if new_section:
+ msg = '%s has been escalated to %s.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context), new_section.name)
+ else:
+ msg = '%s has been escalated.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+ self.message_append_note(cr, uid, [id], 'System Notification', msg, context=context)
+ return True
+
def case_close_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been closed.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 4ed90bb7c79..708e60e818b 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -1025,6 +1025,14 @@