[IMP] odex_benefit: IMP benefit
This commit is contained in:
parent
9159dbd183
commit
2e56e9fb7b
|
|
@ -11469,12 +11469,6 @@ msgstr ""
|
||||||
"رقم التعريف الضريبي. قم بإكماله إذا كانت جهة الاتصال تخضع للضرائب الحكومية. "
|
"رقم التعريف الضريبي. قم بإكماله إذا كانت جهة الاتصال تخضع للضرائب الحكومية. "
|
||||||
"يُستخدم في بعض المستندات القانونية."
|
"يُستخدم في بعض المستندات القانونية."
|
||||||
|
|
||||||
#. module: odex_benefit
|
|
||||||
#: code:addons/odex_benefit/models/benefit.py:0
|
|
||||||
#, python-format
|
|
||||||
msgid "The account number already exists!"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: odex_benefit
|
#. module: odex_benefit
|
||||||
#: code:addons/odex_benefit/models/death_reason_settings.py:0
|
#: code:addons/odex_benefit/models/death_reason_settings.py:0
|
||||||
#: model:ir.model.constraint,message:odex_benefit.constraint_death_reason_settings_uniq_name
|
#: model:ir.model.constraint,message:odex_benefit.constraint_death_reason_settings_uniq_name
|
||||||
|
|
|
||||||
|
|
@ -1664,18 +1664,19 @@ class GrantBenefitProfile(models.Model):
|
||||||
if messages:
|
if messages:
|
||||||
raise UserError("\n".join(messages))
|
raise UserError("\n".join(messages))
|
||||||
|
|
||||||
if not rec.user_id:
|
#if not rec.user_id:
|
||||||
self.sudo().create_user()
|
# self.sudo().create_user()
|
||||||
|
|
||||||
rec.user_id.sudo().write({
|
if rec.user_id:
|
||||||
'groups_id': [(3, self.env.ref('base.group_user', False).id)],
|
rec.user_id.sudo().write({
|
||||||
})
|
'groups_id': [(3, self.env.ref('base.group_user', False).id)],
|
||||||
# rec.user_id.sudo().write({
|
})
|
||||||
# 'groups_id': [(4, self.env.ref('odex_benefit.group_benefit_user', False).id)],
|
# rec.user_id.sudo().write({
|
||||||
# })
|
# 'groups_id': [(4, self.env.ref('odex_benefit.group_benefit_user', False).id)],
|
||||||
rec.user_id.sudo().write({
|
# })
|
||||||
'groups_id': [(4, self.env.ref('base.group_portal', False).id)],
|
rec.user_id.sudo().write({
|
||||||
})
|
'groups_id': [(4, self.env.ref('base.group_portal', False).id)],
|
||||||
|
})
|
||||||
if rec.action_type == 'new':
|
if rec.action_type == 'new':
|
||||||
rec.approve_date = datetime.now()
|
rec.approve_date = datetime.now()
|
||||||
self.sudo().send_approval_benefit_email()
|
self.sudo().send_approval_benefit_email()
|
||||||
|
|
@ -1795,14 +1796,14 @@ class GrantBenefitProfile(models.Model):
|
||||||
|
|
||||||
# @api.multi
|
# @api.multi
|
||||||
def action_edit_info(self):
|
def action_edit_info(self):
|
||||||
user = self.user_id
|
#user = self.user_id
|
||||||
if not user:
|
#if not user:
|
||||||
user = self.env['res.users'].sudo().search(
|
# user = self.env['res.users'].sudo().search(
|
||||||
[('partner_id', '=', self.partner_id.id), ('active', '=', False)])
|
# [('partner_id', '=', self.partner_id.id), ('active', '=', False)])
|
||||||
if user:
|
# if user:
|
||||||
user.write({'active': True})
|
# user.write({'active': True})
|
||||||
else:
|
# else:
|
||||||
user = self.create_user()
|
# user = self.create_user()
|
||||||
#group_e = self.env.ref('odex_benefit.group_benefit_edit', False)
|
#group_e = self.env.ref('odex_benefit.group_benefit_edit', False)
|
||||||
try:
|
try:
|
||||||
#group_e.sudo().write({'users': [(4, user.id)]})
|
#group_e.sudo().write({'users': [(4, user.id)]})
|
||||||
|
|
@ -2640,11 +2641,11 @@ class GrantBenefitProfile(models.Model):
|
||||||
raise ValidationError(_("The IBAN number must contain exactly 22 digits."))
|
raise ValidationError(_("The IBAN number must contain exactly 22 digits."))
|
||||||
|
|
||||||
# Check if the account number already exists in the partner bank or benefit
|
# Check if the account number already exists in the partner bank or benefit
|
||||||
partner_exist = self.env['res.partner.bank'].search([('acc_number', '=', self.acc_number)], limit=1)
|
#partner_exist = self.env['res.partner.bank'].search([('acc_number', '=', self.acc_number)], limit=1)
|
||||||
benefit_exist = self.search([('acc_number', '=', self.acc_number)], limit=1)
|
#benefit_exist = self.search([('acc_number', '=', self.acc_number)], limit=1)
|
||||||
|
|
||||||
if partner_exist or benefit_exist:
|
#if partner_exist or benefit_exist:
|
||||||
raise ValidationError(_("The account number already exists!"))
|
# raise ValidationError(_("The account number already exists!"))
|
||||||
|
|
||||||
@api.onchange('mother_marital_conf', 'mother_location_conf', 'mother_net_income')
|
@api.onchange('mother_marital_conf', 'mother_location_conf', 'mother_net_income')
|
||||||
def _onchange_mother_info(self):
|
def _onchange_mother_info(self):
|
||||||
|
|
|
||||||
|
|
@ -422,18 +422,24 @@ class FamilyMemberProfile(models.Model):
|
||||||
"Numbers and special characters are not allowed.") % field_label
|
"Numbers and special characters are not allowed.") % field_label
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends('age')
|
@api.depends('age', 'relationn')
|
||||||
def _compute_get_age_status(self):
|
def _compute_get_age_status(self):
|
||||||
|
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||||
|
female_benefit_age = validation_setting.female_benefit_age or 26
|
||||||
|
male_benefit_age = validation_setting.male_benefit_age or 18
|
||||||
|
|
||||||
for rec in self:
|
for rec in self:
|
||||||
current_education_status_id = rec.member_education_status_ids.filtered(
|
if not rec.relationn or not rec.relationn.relation_type:
|
||||||
lambda r: r.education_status_type == 'current')
|
rec.age_status = 'non_minor'
|
||||||
if rec.relationn.relation_type == 'son' and rec.age <= 18:
|
continue
|
||||||
rec.age_status = 'minor'
|
|
||||||
elif rec.relationn.relation_type == 'daughter' and rec.age <= 26:
|
age = rec.age or 0
|
||||||
rec.age_status = 'minor'
|
rtype = rec.relationn.relation_type
|
||||||
elif rec.relationn.relation_type == 'son' and rec.age <= 22 and (
|
|
||||||
current_education_status_id.specialization_ids.is_scientific_specialty or current_education_status_id.specialization_ids.is_medical_specialty):
|
if rtype == 'daughter':
|
||||||
rec.age_status = 'minor'
|
rec.age_status = 'minor' if age < female_benefit_age else 'non_minor'
|
||||||
|
elif rtype == 'son':
|
||||||
|
rec.age_status = 'minor' if age < male_benefit_age else 'non_minor'
|
||||||
else:
|
else:
|
||||||
rec.age_status = 'non_minor'
|
rec.age_status = 'non_minor'
|
||||||
|
|
||||||
|
|
@ -910,7 +916,7 @@ class FamilyMemberProfile(models.Model):
|
||||||
|
|
||||||
def action_resume_member(self):
|
def action_resume_member(self):
|
||||||
ctx = dict(self.env.context or {})
|
ctx = dict(self.env.context or {})
|
||||||
#ctx['resume_family'] = True
|
# ctx['resume_family'] = True
|
||||||
ctx.update({
|
ctx.update({
|
||||||
'resume_family': True,
|
'resume_family': True,
|
||||||
'active_model': 'family.member',
|
'active_model': 'family.member',
|
||||||
|
|
|
||||||
|
|
@ -708,7 +708,7 @@
|
||||||
'invisible':[('father_dead_reason_id_not_defined', '=', False)],
|
'invisible':[('father_dead_reason_id_not_defined', '=', False)],
|
||||||
'readonly':[('state','not in',['draft','new','complete_info'])]}
|
'readonly':[('state','not in',['draft','new','complete_info'])]}
|
||||||
"/>
|
"/>
|
||||||
<field name="father_dead_date" required="1"
|
<field name="father_dead_date" required="0"
|
||||||
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||||
<field name="father_dead_country_id" required="1"
|
<field name="father_dead_country_id" required="1"
|
||||||
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"
|
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,13 @@
|
||||||
decoration-danger="state in ['refused','suspended_second_approve']"
|
decoration-danger="state in ['refused','suspended_second_approve']"
|
||||||
decoration-warning="state in ['first_refusal','waiting_approve']"
|
decoration-warning="state in ['first_refusal','waiting_approve']"
|
||||||
decoration-info="state not in ('waiting_approve','draft','new','first_approve', 'second_approve','first_refusal','refused','suspended_second_approve')"/>
|
decoration-info="state not in ('waiting_approve','draft','new','first_approve', 'second_approve','first_refusal','refused','suspended_second_approve')"/>
|
||||||
|
<field name="action_type" widget="badge" optional="show"
|
||||||
|
decoration-muted="action_type == 'new'"
|
||||||
|
decoration-info="action_type == 'edit_info'"
|
||||||
|
decoration-success="action_type == 'approved'"
|
||||||
|
decoration-danger="action_type == 'suspended'"
|
||||||
|
decoration-warning="action_type in ['resume_from_temporary', 'exception']"
|
||||||
|
decoration-primary="action_type == 'resume_from_final'"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue