[CLEAN] hr_holidays, hr_recruitment, idea, mrp: cleaned subtypes.
bzr revid: tde@openerp.com-20120919131240-7cc61fqg5eoom9zt
This commit is contained in:
parent
378966f9f1
commit
b9820db8f0
|
@ -352,25 +352,23 @@ 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 <b>created</b> and is waiting confirmation."),subtype_xml_id="hr_holidays_subtype_new", context=context)
|
||||
_("The request has been <b>created</b> 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 <b>submitted</b> and is waiting for validation by the manager."), context=context)
|
||||
_("The request has been <b>submitted</b> 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):
|
||||
|
@ -384,12 +382,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_xml_id="hr_holidays_subtype_approved", context=context)
|
||||
_("The request has been <b>approved</b>. 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 <b>refused</b>. The validation process is now over."), subtype_xml_id="hr_holidays_subtype_refused", context=context)
|
||||
_("The request has been <b>refused</b>. The validation process is now over."), subtype_xml_id="mt_holidays_refused", context=context)
|
||||
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
|
|
|
@ -43,17 +43,17 @@ Once validated, they are visible in the employee's calendar. HR officers can def
|
|||
<field name="limit">True</field>
|
||||
<field name="color_name">brown</field>
|
||||
</record>
|
||||
<!--Sub type data -->
|
||||
<record id="mail.hr_holidays_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
|
||||
<!-- mail: subtypes -->
|
||||
<record id="mail.mt_holidays_confirm" model="mail.message.subtype">
|
||||
<field name="name">confirmed</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.hr_holidays_subtype_approved" model="mail.message.subtype">
|
||||
<record id="mail.mt_holidays_closed" model="mail.message.subtype">
|
||||
<field name="name">approved</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
</record>
|
||||
<record id="mail.hr_holidays_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.mt_holidays_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="default" eval="False"/>
|
||||
|
|
|
@ -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_xml_id="hr_recruitment_subtype_stage_change", context=context)
|
||||
return self.message_post(cr, uid, ids, body=_("Stage changed to <b>%s</b>.") % (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 <b>in progress</b>.")
|
||||
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 <b>hired</b> 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 <b>hired</b>.")
|
||||
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 <b>refused</b>.'
|
||||
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 <b>new</b>.")
|
||||
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 <b>created</b>.")
|
||||
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):
|
||||
|
|
|
@ -461,30 +461,20 @@ You can automatically receive job application though an email gateway, see the H
|
|||
<field name="alias_user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
<!--Data for the sub type -->
|
||||
<record id="mail.hr_recruitment_subtype_new" model="mail.message.subtype">
|
||||
<!-- mail: subtypes -->
|
||||
<record id="mail.mt_recruitment_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.hr_recruitment_subtype_hired" model="mail.message.subtype">
|
||||
<record id="mail.mt_recruitment_hired" model="mail.message.subtype">
|
||||
<field name="name">hired</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
</record>
|
||||
<record id="mail.hr_recruitment_subtype_refused" model="mail.message.subtype">
|
||||
<record id="mail.mt_recruitment_refused" model="mail.message.subtype">
|
||||
<field name="name">refused</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.hr_recruitment_subtype_stage_change" model="mail.message.subtype">
|
||||
<field name="name">stage change</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.hr_recruitment_subtype_in_progress" model="mail.message.subtype">
|
||||
<field name="name">in progress</field>
|
||||
<field name="res_model">hr.applicant</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -16,25 +16,6 @@
|
|||
<field name="groups_id" eval="[(4,ref('base.group_tool_user'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- SUBTYPE -->
|
||||
<record id="mail.idea_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.idea_subtype_open" model="mail.message.subtype">
|
||||
<field name="name">open</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
</record>
|
||||
<record id="mail.idea_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.idea_subtype_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -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 <b>created</b>."), subtype_xml_id="mrp_subtype_new", context=context)
|
||||
self.message_post(cr, uid, ids, body=_("Manufacturing order has been <b>created</b>."), 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 <b>canceled</b>.")
|
||||
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 <b>ready to produce</b>.")
|
||||
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 <b>in production</b>.")
|
||||
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 <b>done</b>.")
|
||||
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):
|
||||
|
|
|
@ -27,26 +27,18 @@ From the Manufacturing Settings, you can choose to compute production schedules
|
|||
<field name="number_increment">1</field>
|
||||
</record>
|
||||
|
||||
<record id="mail.mrp_subtype_new" model="mail.message.subtype">
|
||||
<field name="name">new</field>
|
||||
<!-- mail: subtypes -->
|
||||
<record id="mail.mt_mrp_order_new" model="mail.message.subtype">
|
||||
<field name="name">created</field>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mrp_subtype_ready" model="mail.message.subtype">
|
||||
<field name="name">ready</field>
|
||||
<record id="mail.mt_mrp_order_canceled" model="mail.message.subtype">
|
||||
<field name="name">canceled</field>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mrp_subtype_production" model="mail.message.subtype">
|
||||
<field name="name">production</field>
|
||||
<field name="res_model">mrp.production</field>
|
||||
</record>
|
||||
<record id="mail.mrp_subtype_cancelled" model="mail.message.subtype">
|
||||
<field name="name">cancelled</field>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
</record>
|
||||
<record id="mail.mrp_subtype_closed" model="mail.message.subtype">
|
||||
<record id="mail.mt_mrp_order_closed" model="mail.message.subtype">
|
||||
<field name="name">closed</field>
|
||||
<field name="res_model">mrp.production</field>
|
||||
<field name="default" eval="False"/>
|
||||
|
|
Loading…
Reference in New Issue