[IMP]changed in all hr module for subtype
bzr revid: sgo@tinyerp.com-20120913065854-7y5jkls3q2jebduv
This commit is contained in:
parent
296ae6e24b
commit
66e8595b01
|
@ -364,7 +364,7 @@ class hr_holidays(osv.osv):
|
|||
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 <b>created</b> and is waiting confirmation."),subtype="new", context=context)
|
||||
_("The request has been <b>created</b> and is waiting confirmation."),subtype_xml_id="hr_holidays_subtype_new", context=context)
|
||||
return True
|
||||
|
||||
def holidays_confirm_notificate(self, cr, uid, ids, context=None):
|
||||
|
@ -384,12 +384,12 @@ class hr_holidays(osv.osv):
|
|||
_("The request has been <b>double validated</b>. The validation process is now over."), context=context)
|
||||
else:
|
||||
self.message_post(cr, uid, [obj.id],
|
||||
_("The request has been <b>approved</b>. The validation process is now over."), subtype="approved", context=context)
|
||||
_("The request has been <b>approved</b>. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_approved", 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 <b>refused</b>. The validation process is now over."), subtype="refused", context=context)
|
||||
_("The request has been <b>refused</b>. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_refused", context=context)
|
||||
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
|
|
|
@ -50,28 +50,19 @@ Once validated, they are visible in the employee's calendar. HR officers can def
|
|||
<field name="color_name">brown</field>
|
||||
</record>
|
||||
<!--Sub type data -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_approved" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_approved" model="mail.message.subtype">
|
||||
<field name="name">approved</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.hr_holidays_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -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 <b>%s</b>.") % (stage_name), subtype="stage change", context=context)
|
||||
return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype_xml_id="hr_recruitment_subtype_stage_change", 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 <b>in progress</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="in progress", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_in_progress", 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 <b>hired</b> and created as an employee.")
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype="hired", context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_hired", context=context)
|
||||
else:
|
||||
message = _("Applicant has been <b>hired</b>.")
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype="hired", context=context)
|
||||
self.message_post(cr, uid, [applicant.id], body=message, subtype_xml_id="hr_recruitment_subtype_hired", context=context)
|
||||
return True
|
||||
|
||||
def case_cancel_send_note(self, cr, uid, ids, context=None):
|
||||
msg = 'Applicant <b>refused</b>.'
|
||||
return self.message_post(cr, uid, ids, body=msg, subtype="refused", context=context)
|
||||
return self.message_post(cr, uid, ids, body=msg, subtype_xml_id="hr_recruitment_subtype_refused", context=context)
|
||||
|
||||
def case_reset_send_note(self, cr, uid, ids, context=None):
|
||||
message =_("Applicant has been set as <b>new</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_new", context=context)
|
||||
|
||||
def create_send_note(self, cr, uid, ids, context=None):
|
||||
message = _("Applicant has been <b>created</b>.")
|
||||
return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
|
||||
return self.message_post(cr, uid, ids, body=message, subtype_xml_id="hr_recruitment_subtype_new", context=context)
|
||||
|
||||
|
||||
class hr_job(osv.osv):
|
||||
|
|
|
@ -462,38 +462,29 @@ You can automatically receive job application though an email gateway, see the H
|
|||
</record>
|
||||
|
||||
<!--Data for the sub type -->
|
||||
<record id="mail.mail_subtype_new" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_hired" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_hired" model="mail.message.subtype">
|
||||
<field name="name">hired</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_in_progress" model="mail.message.subtype">
|
||||
<record id="mail.hr_recruitment_subtype_in_progress" model="mail.message.subtype">
|
||||
<field name="name">in progress</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -95,25 +95,25 @@ class account_analytic_account(osv.osv):
|
|||
def set_close(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'close'}, context=context)
|
||||
message = _("Contract has been <b>closed</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="closed", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_closed", context=context)
|
||||
return True
|
||||
|
||||
def set_cancel(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
|
||||
message = _("Contract has been <b>cancelled</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_invoice_subtype_cancelled", context=context)
|
||||
return True
|
||||
|
||||
def set_open(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'open'}, context=context)
|
||||
message = _("Contract has been <b>opened</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="open", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_open", context=context)
|
||||
return True
|
||||
|
||||
def set_pending(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'pending'}, context=context)
|
||||
message = _("Contract has been set as <b>pending</b>.")
|
||||
self.message_post(cr, uid, ids, body=message, subtype="pending", context=context)
|
||||
self.message_post(cr, uid, ids, body=message, subtype_xml_id="analytic_account_subtype_pending", context=context)
|
||||
return True
|
||||
|
||||
account_analytic_account()
|
||||
|
|
|
@ -17,32 +17,23 @@
|
|||
<field name="factor">50.0</field>
|
||||
</record>
|
||||
<!-- Sub Type Data -->
|
||||
<record id="mail.mail_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_pending" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_pending" model="mail.message.subtype">
|
||||
<field name="name">pending</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_open" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
|
||||
<record id="mail.analytic_account_invoice_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
<field name="res_model">account.analytic.account</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_email" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_comment" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
<record id="mail.mail_subtype_other" model="mail.message.subtype">
|
||||
<field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue