diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 4e85313e2e4..731efad4d8d 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -352,44 +352,42 @@ class hr_holidays(osv.osv): def needaction_domain_get(self, cr, uid, ids, context=None): # to be tested, otherwise convert into employee_id in ... emp_obj = self.pool.get('hr.employee') - empids = emp_obj.search(cr, uid, [('parent_id.user_id','=',uid)], context=context) - dom = [ - '&', ('state','=','confirm'),('employee_id', 'in', empids) - ] + empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context) + dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)] # if this user is a hr.manager, he should do second validations if self.pool.get('res.users').has_group(cr, uid, 'base.group_hr_manager'): - dom = ['|'] + dom + [ ('state','=','validate1') ] + dom = ['|'] + dom + [('state', '=', 'validate1')] return dom def create_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): - self.message_post(cr, uid, ids, - _("The request has been created and is waiting confirmation."),subtype_xml_id="hr_holidays_subtype_new", context=context) + self.message_post(cr, uid, ids, + _("The request has been created and is waiting confirmation."), context=context) return True - + def holidays_confirm_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids): self.message_post(cr, uid, [obj.id], - _("The request has been submitted and is waiting for validation by the manager."), context=context) - + _("The request has been submitted and is waiting for validation by the manager."), subtype_xml_id="mt_holidays_confirm", context=context) + def holidays_first_validate_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_post(cr, uid, [obj.id], _("The request has been approved. A second validation is necessary and is now pending."), context=context) - + def holidays_validate_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids): if obj.double_validation: - self.message_post(cr, uid, [obj.id], + self.message_post(cr, uid, [obj.id], _("The request has been double validated. The validation process is now over."), context=context) else: self.message_post(cr, uid, [obj.id], - _("The request has been approved. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_approved", context=context) - + _("The request has been approved. The validation process is now over."), subtype_xml_id="mt_holidays_closed", context=context) + def holidays_refuse_notificate(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids): self.message_post(cr, uid, [obj.id], - _("The request has been refused. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_refused", context=context) + _("The request has been refused. The validation process is now over."), subtype_xml_id="mt_holidays_refused", context=context) class resource_calendar_leaves(osv.osv): diff --git a/addons/hr_holidays/hr_holidays_data.xml b/addons/hr_holidays/hr_holidays_data.xml index 0eb411e90cb..50a3f3fde17 100644 --- a/addons/hr_holidays/hr_holidays_data.xml +++ b/addons/hr_holidays/hr_holidays_data.xml @@ -43,17 +43,17 @@ Once validated, they are visible in the employee's calendar. HR officers can def True brown - - - new + + + + confirmed hr.holidays - - + approved hr.holidays - + refused hr.holidays diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index ec2ea806fec..49a80ef26d6 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -461,14 +461,14 @@ class hr_applicant(base_stage, osv.Model): """ Override of the (void) default notification method. """ if not stage_id: return True stage_name = self.pool.get('hr.recruitment.stage').name_get(cr, uid, [stage_id], context=context)[0][1] - return self.message_post(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), subtype_xml_id="hr_recruitment_subtype_stage_change", context=context) + return self.message_post(cr, uid, ids, body=_("Stage changed to %s.") % (stage_name), context=context) def case_get_note_msg_prefix(self, cr, uid, id, context=None): return 'Applicant' def case_open_send_note(self, cr, uid, ids, context=None): message = _("Applicant has been set in progress.") - return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_in_progress", context=context) + return self.message_post(cr, uid, ids, body=message, context=context) def case_close_send_note(self, cr, uid, ids, context=None): if context is None: @@ -476,23 +476,23 @@ class hr_applicant(base_stage, osv.Model): for applicant in self.browse(cr, uid, ids, context=context): if applicant.emp_id: message = _("Applicant has been hired and created as an employee.") - self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_hired", context=context) + self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="mt_recruitment_hired", context=context) else: message = _("Applicant has been hired.") - self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_hired", context=context) + self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="mt_recruitment_hired", context=context) return True def case_cancel_send_note(self, cr, uid, ids, context=None): msg = 'Applicant refused.' - return self.message_post(cr, uid, ids, body=msg, subtype_xml_id="hr_recruitment_subtype_refused", context=context) + return self.message_post(cr, uid, ids, body=msg, subtype_xml_id="mt_recruitment_refused", context=context) def case_reset_send_note(self, cr, uid, ids, context=None): message =_("Applicant has been set as new.") - return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_new", context=context) + return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_recruitment_new", context=context) def create_send_note(self, cr, uid, ids, context=None): message = _("Applicant has been created.") - return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_new", context=context) + return self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_recruitment_new", context=context) class hr_job(osv.osv): diff --git a/addons/hr_recruitment/hr_recruitment_data.xml b/addons/hr_recruitment/hr_recruitment_data.xml index dedeb20a3dc..1fb79227770 100644 --- a/addons/hr_recruitment/hr_recruitment_data.xml +++ b/addons/hr_recruitment/hr_recruitment_data.xml @@ -461,30 +461,20 @@ You can automatically receive job application though an email gateway, see the H - - + + new hr.applicant - - + hired hr.applicant - + refused hr.applicant - - stage change - hr.applicant - - - - in progress - hr.applicant - diff --git a/addons/idea/idea.py b/addons/idea/idea.py index f8346ec2bba..14fbe5eda17 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -66,23 +66,21 @@ class idea_idea(osv.osv): _order = 'name asc' def idea_cancel(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, { 'state': 'cancel' }) - self.message_post(cr, uid, ids, body=_('Idea cancelled.'), subtype_xml_id="idea_subtype_cancelled", context=context) + self.write(cr, uid, ids, {'state': 'cancel'}, context=context) + self.message_post(cr, uid, ids, body=_('Idea cancelled.'), context=context) return True def idea_open(self, cr, uid, ids, context={}): - self.write(cr, uid, ids, { 'state': 'open'}) - self.message_post(cr, uid, ids, body=_('Idea accepted.'), subtype_xml_id="idea_subtype_open", context=context) + self.write(cr, uid, ids, {'state': 'open'}, context=context) + self.message_post(cr, uid, ids, body=_('Idea accepted.'), context=context) return True def idea_close(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea closed.'), subtype_xml_id="idea_subtype_closed", context=context) - self.write(cr, uid, ids, { 'state': 'close' }) + self.write(cr, uid, ids, {'state': 'close'}, context=context) + self.message_post(cr, uid, ids, body=_('Idea closed.'), context=context) return True def idea_draft(self, cr, uid, ids, context={}): - self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), subtype_xml_id="idea_subtype_new", context=context) - self.write(cr, uid, ids, { 'state': 'draft' }) + self.write(cr, uid, ids, {'state': 'draft'}, context=context) + self.message_post(cr, uid, ids, body=_('Idea reset to draft.'), context=context) return True -idea_idea() - diff --git a/addons/idea/idea_data.xml b/addons/idea/idea_data.xml index b4f3f70d2dd..421cb6a9eef 100644 --- a/addons/idea/idea_data.xml +++ b/addons/idea/idea_data.xml @@ -16,25 +16,6 @@ - - - new - idea.idea - - - - open - idea.idea - - - cancelled - idea.idea - - - - closed - idea.idea - diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index bc0baae71e8..b4dece5dfa4 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1044,27 +1044,27 @@ class mrp_production(osv.osv): # --------------------------------------------------- def create_send_note(self, cr, uid, ids, context=None): - self.message_post(cr, uid, ids, body=_("Manufacturing order has been created."), subtype_xml_id="mrp_subtype_new", context=context) + self.message_post(cr, uid, ids, body=_("Manufacturing order has been created."), subtype_xml_id="mt_mrp_order_new", context=context) return True def action_cancel_send_note(self, cr, uid, ids, context=None): message = _("Manufacturing order has been canceled.") - self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_cancelled", context=context) + self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_mrp_order_canceled", context=context) return True def action_ready_send_note(self, cr, uid, ids, context=None): message = _("Manufacturing order is ready to produce.") - self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_ready", context=context) + self.message_post(cr, uid, ids, body=message, context=context) return True def action_in_production_send_note(self, cr, uid, ids, context=None): message = _("Manufacturing order is in production.") - self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_production", context=context) + self.message_post(cr, uid, ids, body=message, context=context) return True def action_done_send_note(self, cr, uid, ids, context=None): message = _("Manufacturing order has been done.") - self.message_post(cr, uid, ids, body=message, subtype_xml_id="mrp_subtype_closed", context=context) + self.message_post(cr, uid, ids, body=message, subtype_xml_id="mt_mrp_order_closed", context=context) return True def action_confirm_send_note(self, cr, uid, ids, context=None): diff --git a/addons/mrp/mrp_data.xml b/addons/mrp/mrp_data.xml index 3740f03bdc8..79e202cd8e0 100644 --- a/addons/mrp/mrp_data.xml +++ b/addons/mrp/mrp_data.xml @@ -26,27 +26,19 @@ From the Manufacturing Settings, you can choose to compute production schedules 1 1 - - - new + + + + created mrp.production - - ready + + canceled mrp.production - - production - mrp.production - - - cancelled - mrp.production - - - + closed mrp.production