commit
8ac246cca7
|
|
@ -70,6 +70,16 @@ msgstr "تعميم/ قرار إداري"
|
|||
msgid "Annual"
|
||||
msgstr "سنوي"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields.selection,name:exp_payroll_promotion.selection__hr_payroll_raise__raise_type__discrimination
|
||||
msgid "Discrimination"
|
||||
msgstr "التميز"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model_terms:ir.ui.view,arch_db:exp_payroll_promotion.hr_payroll_raise_form_view
|
||||
msgid "Are you sure to Rest To Draft This Record?"
|
||||
msgstr "هل أنت متأكد من إرجاع السجل لحالة المبدئي؟"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields.selection,name:exp_payroll_promotion.selection__hr_payroll_nomination__process__raise
|
||||
msgid "Annual Raise"
|
||||
|
|
@ -193,12 +203,16 @@ msgid "Current Job"
|
|||
msgstr "الوظيفة الحالية"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_employee_promotions__current_salary
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_hr_payroll_raise__current_salary
|
||||
#: model_terms:ir.ui.view,arch_db:exp_payroll_promotion.employee_promotions_custom_form_view
|
||||
msgid "Current Salary"
|
||||
msgstr "الاساسي الحالي"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_employee_promotions__current_salary
|
||||
#: model_terms:ir.ui.view,arch_db:exp_payroll_promotion.employee_promotions_custom_form_view
|
||||
msgid "Current Salary"
|
||||
msgstr "الراتب الإجمالي الحالي"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_hr_payroll_nomination__date
|
||||
msgid "Date"
|
||||
|
|
@ -998,14 +1012,14 @@ msgstr "عفواً, نسبة زيادة العلاوه يجب ان تكون أك
|
|||
#: code:addons/exp_payroll_promotion/models/hr_payroll_promotion.py:0
|
||||
#, python-format
|
||||
msgid "Sorry promotion settings are missed kindly set them first."
|
||||
msgstr ""
|
||||
msgstr "عفواً لا توجد إعدادات نشطة للترقية فضلاً قم بإضافتها اولاً."
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: code:addons/exp_payroll_promotion/models/hr_payroll_nomination.py:0
|
||||
#: code:addons/exp_payroll_promotion/models/hr_payroll_raise.py:0
|
||||
#, python-format
|
||||
msgid "Sorry you can not delete a record that is not in draft state"
|
||||
msgstr "عفواً لا توجد إعدادات نشطة للترقية فضلاً قم بإضافتها اولاً."
|
||||
msgstr "عفواً لا يمكن حذف هذا السجل وهو في حالة غير مسوده."
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: code:addons/exp_payroll_promotion/models/hr_payroll_promotion.py:0
|
||||
|
|
@ -1224,3 +1238,21 @@ msgstr ""
|
|||
#: model:ir.model,name:exp_payroll_promotion.model_hr_promotion_previous_group
|
||||
msgid "hr.promotion.previous.group"
|
||||
msgstr ""
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_employee_promotions__old_basic_salary
|
||||
#: model_terms:ir.ui.view,arch_db:exp_payroll_promotion.employee_promotions_custom_form_view
|
||||
msgid "Old Basic Salary"
|
||||
msgstr "مبلغ الاساسي الحالي"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: model:ir.model.fields,field_description:exp_payroll_promotion.field_employee_promotions__new_basic_salary
|
||||
#: model_terms:ir.ui.view,arch_db:exp_payroll_promotion.employee_promotions_custom_form_view
|
||||
msgid "New Basic Salary"
|
||||
msgstr "الأساسي الجديد"
|
||||
|
||||
#. module: exp_payroll_promotion
|
||||
#: code:addons/exp_payroll_promotion/models/hr_payroll_nomination.py:0
|
||||
#, python-format
|
||||
msgid "Sorry, The Amount Of Basic Salary It Must be Greater than Zero"
|
||||
msgstr "للأسف, مبلغ الراتب الأساسي يجب ان يكون اكبر من الصفر"
|
||||
|
|
|
|||
|
|
@ -38,8 +38,12 @@ class EmployeePromotions(models.Model):
|
|||
service_month = fields.Integer(compute='_compute_duration')
|
||||
service_day = fields.Integer(compute='_compute_duration')
|
||||
|
||||
current_salary = fields.Float()
|
||||
new_salary = fields.Float()
|
||||
current_salary = fields.Float(store=True, force_save=True)
|
||||
new_salary = fields.Float(store=True, force_save=True)
|
||||
|
||||
old_basic_salary = fields.Float(store=True, force_save=True)
|
||||
|
||||
new_basic_salary = fields.Float()
|
||||
|
||||
@api.onchange('employee_id')
|
||||
def store_level_group_and_degree_values(self):
|
||||
|
|
@ -48,6 +52,12 @@ class EmployeePromotions(models.Model):
|
|||
self.promotion_scale_id = self.old_scale
|
||||
self.old_promotion_date = self.employee_id.group_date
|
||||
self.current_salary = self.employee_id.contract_id.total_allowance
|
||||
self.old_basic_salary = self.employee_id.contract_id.salary
|
||||
|
||||
@api.constrains('new_basic_salary')
|
||||
def check_new_basic_salary(self):
|
||||
if self.new_basic_salary < 0:
|
||||
raise ValidationError(_('Sorry, The Amount Of Basic Salary It Must be Greater than Zero'))
|
||||
|
||||
@api.depends('date', 'old_promotion_date')
|
||||
def _compute_duration(self):
|
||||
|
|
@ -329,13 +339,22 @@ class EmployeePromotions(models.Model):
|
|||
|
||||
def approved(self):
|
||||
for rec in self:
|
||||
basic_salary=0.0
|
||||
if rec.new_basic_salary > 0:
|
||||
basic_salary = rec.new_basic_salary
|
||||
else:
|
||||
basic_salary = rec.new_degree.base_salary
|
||||
|
||||
rec.employee_id.contract_id.write({
|
||||
'salary_scale': rec.promotion_scale_id.id,
|
||||
'salary_level': rec.new_level.id,
|
||||
'salary_group': rec.new_group.id,
|
||||
'salary_degree': rec.new_degree.id,
|
||||
'salary': rec.new_degree.base_salary,
|
||||
'salary_insurnce': rec.new_degree.base_salary,
|
||||
#'salary': rec.new_degree.base_salary,
|
||||
#'salary_insurnce': rec.new_degree.base_salary,
|
||||
'salary': basic_salary,
|
||||
'salary_insurnce': basic_salary,
|
||||
|
||||
})
|
||||
rec.employee_id.write({
|
||||
'group_date': rec.date,
|
||||
|
|
@ -350,7 +369,8 @@ class EmployeePromotions(models.Model):
|
|||
job_arc.onchange_check_eligibility()
|
||||
if not job_arc.eligible:
|
||||
job_arc.permit = True
|
||||
job_arc.confirm()
|
||||
#job_arc.confirm()
|
||||
job_arc.hr_officer()
|
||||
job_arc.approved()
|
||||
rec.changed_job_id = job_arc.id
|
||||
|
||||
|
|
@ -363,6 +383,8 @@ class EmployeePromotions(models.Model):
|
|||
prv_promotion.date_to = fields.Date.to_string(fields.Date.from_string(rec.date) - timedelta(days=1))
|
||||
prv_promotion.last_promotion = False
|
||||
rec.state = 'approved'
|
||||
#TOOODOOO new_salary to be Calculate in function
|
||||
rec.new_salary = self.employee_id.contract_id.total_allowance
|
||||
|
||||
def re_draft(self):
|
||||
for rec in self:
|
||||
|
|
@ -373,8 +395,10 @@ class EmployeePromotions(models.Model):
|
|||
'salary_level': rec.old_level_2.id,
|
||||
'salary_group': rec.old_group_2.id,
|
||||
'salary_degree': rec.old_degree_2.id,
|
||||
'salary': rec.old_degree_2.base_salary,
|
||||
'salary_insurnce': rec.old_degree_2.base_salary,
|
||||
#'salary': rec.old_degree_2.base_salary,
|
||||
#'salary_insurnce': rec.old_degree_2.base_salary,
|
||||
'salary': rec.old_basic_salary,
|
||||
'salary_insurnce': rec.old_basic_salary,
|
||||
})
|
||||
promotion_date = False
|
||||
prv_promotion = self.search([('employee_id', '=', rec.employee_id.id),
|
||||
|
|
|
|||
|
|
@ -46,15 +46,23 @@ class HrPayrollRaise(models.Model):
|
|||
|
||||
new_salary = fields.Float(string='New Basic Salary', store=True)
|
||||
|
||||
re_contract_id = fields.Many2one('hr.re.contract', 'Re-Contract', readonly=True)
|
||||
|
||||
employee_appraisal = fields.Many2one('hr.employee.appraisal', string="Employee Appraisal", readonly=True, store=True)
|
||||
|
||||
is_required = fields.Boolean(string='Is Required', compute='_compute_is_required',)
|
||||
|
||||
'''@api.onchange('re_contract_id')
|
||||
def onchange_re_contract_id(self):
|
||||
for rec in self:
|
||||
rec.employee_id = rec.re_contract_id.employee_id'''
|
||||
|
||||
@api.depends('employee_id', 'employee_id.employee_type_id', 'employee_id.employee_type_id.salary_type')
|
||||
def _compute_is_required(self):
|
||||
for rec in self:
|
||||
rec.is_required = False
|
||||
rec.is_required = True
|
||||
if rec.employee_id and rec.employee_id.employee_type_id and rec.employee_id.employee_type_id.salary_type == 'amount':
|
||||
rec.is_required = True
|
||||
rec.is_required = False
|
||||
|
||||
|
||||
#@api.onchange('employee_id','percentage_raises')
|
||||
|
|
@ -62,6 +70,7 @@ class HrPayrollRaise(models.Model):
|
|||
def onchange_employee(self):
|
||||
self.nominated_degree_id = False
|
||||
if self.employee_id:
|
||||
self.employee_appraisal = self.employee_id.contract_id.appraisal_result.id
|
||||
self.scale_id = self.employee_id.salary_scale.id
|
||||
self.level_id = self.employee_id.salary_level.id
|
||||
self.group_id = self.employee_id.salary_group.id
|
||||
|
|
@ -76,7 +85,12 @@ class HrPayrollRaise(models.Model):
|
|||
self.next_raise_date = ndate
|
||||
|
||||
if self.percentage_bonus==True:
|
||||
self.new_salary= (self.current_salary*self.percentage_raises)/100+self.current_salary
|
||||
self.new_salary= round((self.current_salary*self.percentage_raises)/100+self.current_salary,0)
|
||||
|
||||
if self.employee_appraisal:
|
||||
self.percentage_raises = self.employee_appraisal.level_achieved_percentage*self.scale_id.Percentage_increase
|
||||
#else:
|
||||
#self.percentage_raises = 100*self.scale_id.Percentage_increase
|
||||
|
||||
@api.onchange('nominated_degree_id')
|
||||
def onchange_degree(self):
|
||||
|
|
@ -140,10 +154,12 @@ class HrPayrollRaise(models.Model):
|
|||
if last_raise:
|
||||
last_raise.last_raises = False
|
||||
else:
|
||||
if rec.percentage_raises > 0:
|
||||
if rec.percentage_bonus==True and rec.percentage_raises > 0:
|
||||
# currnt_salary = rec.employee_id.contract_id.salary
|
||||
rec.employee_id.contract_id.salary = rec.current_salary + (
|
||||
rec.current_salary * rec.percentage_raises) / 100
|
||||
#self.new_salary= (self.current_salary*self.percentage_raises)/100+self.current_salary
|
||||
#rec.employee_id.contract_id.salary = rec.current_salary + (
|
||||
# rec.current_salary * rec.percentage_raises) / 100
|
||||
rec.employee_id.contract_id.salary = rec.new_salary
|
||||
rec.employee_id.contract_id.salary_insurnce = rec.employee_id.contract_id.salary
|
||||
rec.state = 'approve'
|
||||
|
||||
|
|
@ -164,6 +180,8 @@ class HrPayrollRaise(models.Model):
|
|||
('state', '=', 'approve')], order='application_date desc', limit=1)
|
||||
rec.employee_id.degree_date = last_raise and last_raise.application_date or \
|
||||
rec.employee_id.first_hiring_date
|
||||
rec.employee_id.contract_id.salary = rec.current_salary
|
||||
rec.employee_id.contract_id.salary_insurnce = rec.current_salary_insurance
|
||||
if last_raise:
|
||||
last_raise.last_raises = True
|
||||
rec.state = 'draft'
|
||||
|
|
@ -174,6 +192,8 @@ class HrPayrollRaise(models.Model):
|
|||
raise ValidationError(_('Sorry you can not delete a record that is not in draft state'))
|
||||
# if rec.state == 'draft' and rec.nomination_id and not self.env.context.get('permit_dlt', False):
|
||||
# raise ValidationError(_('Sorry you can not delete nomination record'))
|
||||
#if rec.re_contract_id:
|
||||
# raise ValidationError(_('Sorry you can not delete a record Employee Has Re-Contract'))
|
||||
return super(HrPayrollRaise, self).unlink()
|
||||
|
||||
def write(self, vals):
|
||||
|
|
@ -182,3 +202,31 @@ class HrPayrollRaise(models.Model):
|
|||
for rec in self:
|
||||
if rec.nomination_id:
|
||||
rec.nomination_id.check_raise_nominee()
|
||||
|
||||
class hr_extend(models.Model):
|
||||
_inherit = 'hr.re.contract'
|
||||
|
||||
raise_ids = fields.One2many('hr.payroll.raise', 're_contract_id', string="Employee Raise")
|
||||
|
||||
@api.onchange('employee_id')
|
||||
def onchange_emp(self):
|
||||
for rec in self:
|
||||
if rec.raise_ids:
|
||||
for line in rec.raise_ids:
|
||||
if line.state != 'draft':
|
||||
raise ValidationError(_('You can not Change Employee Name Has Annual raise in state not in Draft'))
|
||||
else:
|
||||
rec.raise_ids=False
|
||||
|
||||
|
||||
def unlink(self):
|
||||
for i in self:
|
||||
if i.state != 'draft':
|
||||
raise ValidationError(_('You can not delete record in state not in draft'))
|
||||
if i.raise_ids:
|
||||
for rec in i.raise_ids:
|
||||
if rec.state != 'draft':
|
||||
raise ValidationError(_('You can not delete record Has Employee Annual raise in state not in Draft'))
|
||||
rec.unlink()
|
||||
return super(hr_extend, i).unlink()
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<xpath expr="//field[@name='date']" position="replace">
|
||||
</xpath>
|
||||
<xpath expr="//div" position="after">
|
||||
<group col="4">
|
||||
<group col="4" >
|
||||
<group colspan="2">
|
||||
<field name="date_promotion" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="type" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</group>
|
||||
<group colspan="2">
|
||||
<field name="date" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="date_to" readonly="1" force_save="1"
|
||||
<field name="date_to" readonly="1" force_save="1"
|
||||
attrs="{'invisible':[('state','!=','approved')]}"/>
|
||||
<field name="foreign_scale" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
</group>
|
||||
|
|
@ -26,8 +26,9 @@
|
|||
<xpath expr="//field[@name='new_level']" position="before">
|
||||
<field name="promotion_scale_id" attrs="{'readonly':[('state','!=','draft')]}" required="1"
|
||||
widget="selection"/>
|
||||
</xpath>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='new_degree']" position="after">
|
||||
<field name="new_basic_salary" string="New Basic Salary" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="new_salary" string="New Salary" readonly="1" force_save="1"/>
|
||||
<field name="promotion_job_id" force_save="1" attrs="{'readonly':[('state','!=','draft')]}"
|
||||
widget="selection"/>
|
||||
|
|
@ -36,8 +37,9 @@
|
|||
<field name="promotion_seniority" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='old_degree_2']" position="after">
|
||||
<field name="current_job_id" readonly="1" force_save="1"/>
|
||||
<field name="old_basic_salary" string="Old Basic Salary" readonly="1" force_save="1"/>
|
||||
<field name="current_salary" string="Current Salary" readonly="1" force_save="1"/>
|
||||
<field name="current_job_id" readonly="1" force_save="1"/>
|
||||
<field name="old_promotion_date" string="Old Promotion Date" readonly="1" force_save="1"/>
|
||||
<label for="service_year" string="Duration"/>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<button string="Reset To Draft" name="act_reset" states="refuse,approve" type="object"
|
||||
class="oe_highlight"
|
||||
groups="hr.group_hr_manager"/>
|
||||
groups="hr.group_hr_manager" confirm="Are you sure to Rest To Draft This Record?"/>
|
||||
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
|
|
@ -44,21 +44,23 @@
|
|||
domain="[('salary_scale_group_id', '=', group_id), ('id', '!=', degree_id)]"/>
|
||||
<field name="new_salary" readonly="1" force_save="1" />
|
||||
<field name="application_date" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="next_raise_date" readonly="1" force_save="1"/>
|
||||
<field name="next_raise_date" readonly="1" force_save="1" groups="hr.group_hr_user"/>
|
||||
<field name="deviation" readonly="1" force_save="1" groups="hr.group_hr_user"/>
|
||||
<field name="raise_type" readonly="1"/>
|
||||
<field name="raise_type" attrs="{'readonly':[('state','!=','draft')]}"/>
|
||||
<field name="last_raises" readonly="1" string="Last Raise"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="is_required" invisible="1" />
|
||||
<field name="employee_appraisal" string="Employee Appraisal" force_save="1"/>
|
||||
<field name="scale_id" required="1" readonly="1" force_save="1"/>
|
||||
<field name="level_id" attrs="{'required': [('is_required', '!=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="group_id" attrs="{'required': [('is_required', '!=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="degree_id" attrs="{'required': [('is_required', '!=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="level_id" attrs="{'required': [('is_required', '=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="group_id" attrs="{'required': [('is_required', '=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="degree_id" attrs="{'required': [('is_required', '=', True)]}" readonly="1" force_save="1"/>
|
||||
<field name="last_raise_date" readonly="1" force_save="1"/>
|
||||
|
||||
<field name="current_salary" readonly="1" force_save="1" invisible="0"/>
|
||||
<field name="current_salary_insurance" readonly="1" force_save="1" invisible="1"/>
|
||||
<field name="re_contract_id" readonly="1" string="Re-Contract" attrs="{'invisible':[('re_contract_id','=',False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Notes">
|
||||
|
|
@ -107,5 +109,28 @@
|
|||
sequence="1"
|
||||
action="hr_payroll_raise_action"/>
|
||||
|
||||
|
||||
<!-- Inherit Form View to Modify it -->
|
||||
<record id="adding_raise_to_re_contract" model="ir.ui.view">
|
||||
<field name="name">Adding raise to re-contract</field>
|
||||
<field name="model">hr.re.contract</field>
|
||||
<field name="inherit_id" ref="hr_contract_custom.view_re-contracting_form"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<sheet>
|
||||
<separator string="Employee Raise"/>
|
||||
<field name="raise_ids" string="" attrs="{'readonly':[('state','!=','draft')]}">
|
||||
<tree>
|
||||
<field name="employee_id" string="Employee Name"/>
|
||||
<field name="application_date" string="Application Date"/>
|
||||
<field name="percentage_raises" string="Percentage Raises"/>
|
||||
<field name="state" string="State"/>
|
||||
</tree>
|
||||
</field>
|
||||
</sheet>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in New Issue