commit
3a6a7b17bf
|
|
@ -21,8 +21,8 @@ class ResCompanyExt(models.Model):
|
|||
hr_manager_id = fields.Many2one('hr.employee', string='HR Manager')
|
||||
saudi_percentage = fields.Integer(string='Saudi Percentage %')
|
||||
|
||||
contract_end_reminder = fields.Integer(string='Contract End Reminder')
|
||||
contract_trial_reminder = fields.Integer(string='Contract Trial Reminder')
|
||||
contract_end_reminder = fields.Integer(string='Contract End Reminder',default=60)
|
||||
contract_trial_reminder = fields.Integer(string='Contract Trial Reminder',default=15)
|
||||
|
||||
saudi_gosi = fields.Float(string='Saudi Gosi', default=9.75)
|
||||
company_gosi = fields.Float(string='Company Gosi', default=11.75)
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@
|
|||
<field name="contract_trial_reminder" string="Contract Trial Reminder" readonly='0'/>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Contract And Trial Period Remider</h2>
|
||||
<!--h2>Contract And Trial Period Remider</h2>
|
||||
<div class="row">
|
||||
<div class="text-muted col-md-8">
|
||||
To Send Employee Email Notification For End Contract Date.
|
||||
|
|
@ -202,7 +202,7 @@
|
|||
<div class="mt16">
|
||||
<field name="contract_trial_reminder" string="Contract Trial Reminder" readonly='0'/>
|
||||
</div>
|
||||
</div>
|
||||
</div-->
|
||||
<h2>Gosi Percentage Deduction %</h2>
|
||||
<div class="row">
|
||||
<div class="text-muted col-md-8">
|
||||
|
|
|
|||
|
|
@ -19,5 +19,6 @@
|
|||
"report/employee_dependents_report_template.xml",
|
||||
"report/payroll_template.xml",
|
||||
"report/probationary_evaluation.xml",
|
||||
"data/mail_template.xml",
|
||||
],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="email_template_contract_period_expiration_reminder" model="mail.template">
|
||||
<field name="name">Contract Period Expiration Reminder</field>
|
||||
<field name="subject">Contract- ${object.name} Expired End Period On ${object.date_end}</field>
|
||||
<!--field name="email_to">${user.company_id.email|safe}</field-->
|
||||
<field name="email_to">${user.company_id.hr_email|safe}</field>
|
||||
<field name="email_cc">${object.employee_id.parent_id.user_id.partner_id.email}</field>
|
||||
<field name="model_id" ref="hr_contract_custom.model_hr_contract"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html">
|
||||
<![CDATA[
|
||||
<p>Dear,</p>
|
||||
<br/>
|
||||
<p> The Contract of ${object.employee_id.name} is going to expire on ${object.date_end}.
|
||||
Please renew the contract or end it before expiry date According the notice period.
|
||||
<br/>
|
||||
<br/>
|
||||
<p>Best regards,</p>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_contract_trial_period_expiration_reminder" model="mail.template">
|
||||
<field name="name">Contract Trial Period Expiration Reminder</field>
|
||||
<field name="subject">Contract- ${object.name} Expired Trial Period On ${object.trial_date_end}</field>
|
||||
<!--field name="email_to">${user.company_id.email|safe}</field-->
|
||||
<field name="email_to">${user.company_id.hr_email|safe}</field>
|
||||
<field name="email_cc">${object.employee_id.parent_id.user_id.partner_id.email}</field>
|
||||
<field name="model_id" ref="hr_contract_custom.model_hr_contract"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html">
|
||||
<![CDATA[
|
||||
<p>Dear ,</p>
|
||||
<br/>
|
||||
<p> The Contract trial period of ${object.employee_id.name} is going to expire on${object.trial_date_end}.
|
||||
Please renew the trial contract period or contracting is Done it before expiry date According the notice period..
|
||||
<br/>
|
||||
<br/>
|
||||
<p>Best regards,</p>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -3755,3 +3755,64 @@ msgstr "ترصيد4"
|
|||
#, python-format
|
||||
msgid "Other"
|
||||
msgstr "اخـــرى"
|
||||
|
||||
#. module: hr_contract_custom
|
||||
#: model:mail.template,subject:hr_contract_custom.email_template_contract_period_expiration_reminder
|
||||
msgid "Contract- ${object.name} Expired End Period On ${object.date_end}"
|
||||
msgstr "عقد الموظف رقم- ${object.name} سوف ينتهي بتاريخ ${object.date_end}"
|
||||
|
||||
#. module: hr_contract_custom
|
||||
#: model:mail.template,subject:hr_contract_custom.email_template_contract_trial_period_expiration_reminder
|
||||
msgid "Contract- ${object.name} Expired Trial Period On ${object.trial_date_end}"
|
||||
msgstr "عقد الموظف رقم- ${object.name} سوف تنتهي فترة التجربة بتاريخ ${object.trial_date_end}"
|
||||
|
||||
#. module: hr_contract_custom
|
||||
#: model:mail.template,body_html:hr_contract_custom.email_template_contract_period_expiration_reminder
|
||||
msgid ""
|
||||
"\n"
|
||||
" \n"
|
||||
" <p>Dear,</p>\n"
|
||||
" <br/>\n"
|
||||
" <p> The Contract of ${object.employee_id.name} is going to expire on ${object.date_end}.\n"
|
||||
" Please renew the contract or end it before expiry date According the notice period.\n"
|
||||
" <br/>\n"
|
||||
" <p>Best regards,</p>\n"
|
||||
" \n"
|
||||
" "
|
||||
msgstr ""
|
||||
" \n"
|
||||
" <p>عزيزي,</p>\n"
|
||||
" <br/>\n"
|
||||
" <p> عقد الموظف ${object.employee_id.name} سوف ينتهي بتاريخ ${object.date_end}.\n"
|
||||
" يجب تجديد العقد للموظف او إنهاء العقد قبل تاريخ النهاية حسب فترة الاشعار المتفق عليها.\n"
|
||||
" <br/>\n"
|
||||
" <br/>\n"
|
||||
" <p>تحياتي,</p>\n"
|
||||
" \n"
|
||||
" "
|
||||
|
||||
|
||||
#. module: hr_contract_custom
|
||||
#: model:mail.template,body_html:hr_contract_custom.email_template_contract_trial_period_expiration_reminder
|
||||
msgid ""
|
||||
"\n"
|
||||
" \n"
|
||||
" <p>Dear ,</p>\n"
|
||||
" <br/>\n"
|
||||
" <p> The Contract trial period of ${object.employee_id.name} is going to expire on${object.trial_date_end}.\n"
|
||||
" Please renew the trial contract period or contracting is Done it before expiry date According the notice period.\n"
|
||||
" <br/>\n"
|
||||
" <p>Best regards,</p>\n"
|
||||
" \n"
|
||||
" "
|
||||
msgstr ""
|
||||
" \n"
|
||||
" <p>عزيزي,</p>\n"
|
||||
" <br/>\n"
|
||||
" <p> فترة تجربة عقد الموظف ${object.employee_id.name} سوف تنتهي بتاريخ ${object.trial_date_end}.\n"
|
||||
" يجب تجديد فترة التجربة او إنهاء العقد قبل تاريخ نهاية فترة التجربة حسب فترة الاشعار المتفق عليها.\n"
|
||||
" <br/>\n"
|
||||
" <br/>\n"
|
||||
" <p>تحياتي,</p>\n"
|
||||
" \n"
|
||||
" "
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ class Contract(models.Model):
|
|||
def contract_mail_reminder(self):
|
||||
now = dt.now() + timedelta(days=1)
|
||||
date_now = now.date()
|
||||
match = self.search([('state', '=', 'program_directory')])
|
||||
match = self.search([('state', '!=', 'end_contract')])
|
||||
# trial_days_send_email=5
|
||||
cont_end_reminder = self.env.user.company_id.contract_end_reminder
|
||||
cont_trial_reminder = self.env.user.company_id.contract_trial_reminder
|
||||
|
|
@ -448,34 +448,14 @@ class Contract(models.Model):
|
|||
if i.date_end:
|
||||
exp_date = fields.Date.from_string(i.date_end) - timedelta(days=cont_end_reminder)
|
||||
if date_now >= exp_date:
|
||||
mail_content = "Hello ,<br>The Contract ", i.employee_id.name, "is going to expire on ", \
|
||||
str(i.date_end), ". Please renew the Contract or end it before expiry date"
|
||||
main_content = {
|
||||
'subject': _('Contract -%s Expired End Period On %s') % (i.name, i.date_end),
|
||||
'author_id': self.env.user.company_id.partner_id.id,
|
||||
'body': mail_content,
|
||||
'email_to': self.env.user.company_id.email,
|
||||
'email_cc': self.env.user.company_id.hr_email,
|
||||
'model': self._name,
|
||||
}
|
||||
self.env['mail.mail'].create(main_content).send()
|
||||
self.env.ref('hr_contract_custom.email_template_contract_period_expiration_reminder', False).send_mail(i.id)
|
||||
|
||||
if i.trial_date_end:
|
||||
exp_date = fields.Date.from_string(i.trial_date_end)
|
||||
exp_date1 = fields.Date.from_string(i.trial_date_end) - timedelta(days=cont_trial_reminder)
|
||||
# if date_now >= exp_date :
|
||||
if exp_date >= date_now and date_now >= exp_date1:
|
||||
mail_content = "Hello ,<br>The Contract trial period", i.employee_id.name, "is going to expire on ", \
|
||||
str(i.trial_date_end), ".Please renew the trial Contract period or Contracting is Done it before expiry date"
|
||||
main_content = {
|
||||
'subject': _('Contract-%s Expired Trial Period On %s') % (i.name, i.trial_date_end),
|
||||
'author_id': self.env.user.company_id.partner_id.id,
|
||||
'body': mail_content,
|
||||
'email_to': self.env.user.company_id.email,
|
||||
'email_cc': self.env.user.company_id.hr_email,
|
||||
'model': self._name,
|
||||
}
|
||||
self.env['mail.mail'].create(main_content).send()
|
||||
self.env.ref('hr_contract_custom.email_template_contract_trial_period_expiration_reminder', False).send_mail(i.id)
|
||||
|
||||
##########################################################################
|
||||
@api.onchange('contract_duration', 'date_start')
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<field name="remaining_leaves" string="Remaining Balance" readonly="1"/>
|
||||
<field name="check_allocation_view" string="type" invisible="1"/>
|
||||
|
||||
<field name="holiday_ids" string="Cron Run Times" groups="hr_holidays_community.group_hr_holidays_user" >
|
||||
<field name="holiday_ids" string="Cron Run Times" groups="hr_holidays_community.group_hr_holidays_manager" >
|
||||
<tree editable="bottom">
|
||||
<field name="cron_run_date" force_save="1" string="cron run date" />
|
||||
<field name="balance_leaves" force_save="1" string="Balance" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue