Merge pull request #5435 from expsa/kch_dev_odex25_ensan
[IMP] odex_benefit: IMP benefit
This commit is contained in:
commit
bab790e059
|
|
@ -1475,7 +1475,7 @@ msgstr "موافقة"
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__approve_date
|
||||
msgid "Approve Date"
|
||||
msgstr "تاريخ الموافقة"
|
||||
msgstr "تاريخ اعتماد الملف"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__approve_family
|
||||
|
|
@ -2685,7 +2685,6 @@ msgstr "المرتد"
|
|||
#: model:ir.model.fields,field_description:odex_benefit.field_changes_requests__researcher_branch_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_committees_line__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_res_districts__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__branch_custom_id
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
|
|
@ -2693,6 +2692,12 @@ msgstr "المرتد"
|
|||
msgid "Branch"
|
||||
msgstr "الفرع"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_family_wizard__branch_custom_id
|
||||
msgid "Branch"
|
||||
msgstr "الفرع التشغيلي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:res.groups,name:odex_benefit.group_benefit_branch_manager
|
||||
msgid "Branch Manager"
|
||||
|
|
@ -4181,7 +4186,6 @@ msgstr "تاريخ التوصيل"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model,name:odex_benefit.model_hr_department
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_family_wizard__branch_custom_id
|
||||
msgid "Department"
|
||||
msgstr "القسم"
|
||||
|
||||
|
|
@ -16730,7 +16734,7 @@ msgstr "رقم الهوية %s موجود بالفعل في أسرة أخرى (
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_family_id
|
||||
msgid "Family Branch"
|
||||
msgstr "فرع الأسرة"
|
||||
msgstr "الفرع الأساسي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_has_employees
|
||||
|
|
|
|||
|
|
@ -1476,7 +1476,8 @@ class GrantBenefitProfile(models.Model):
|
|||
rec.user_id.sudo().write({
|
||||
'groups_id': [(4, self.env.ref('base.group_portal', False).id)],
|
||||
})
|
||||
rec.approve_date = datetime.now()
|
||||
if rec.action_type == 'new':
|
||||
rec.approve_date = datetime.now()
|
||||
self.sudo().send_approval_benefit_email()
|
||||
partner_ids = []
|
||||
for id in self.message_follower_ids.ids:
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ class ConfirmBenefitExpense(models.Model):
|
|||
family_monthly_othaime = fields.Float(string="Total Othaim", compute='_get_family_monthly_values', store=True)
|
||||
family_monthly_total = fields.Float(string="Total", compute='_get_family_monthly_values', store=True)
|
||||
branch_custom_ids = fields.Many2many(comodel_name='branch.settings', relation='confirm_benefit_expense_branch_rel',
|
||||
column1='expense_id', column2='branch_id', string="Branches")
|
||||
column1='expense_id', column2='branch_id', string="Branches",
|
||||
domain="[('has_employees', '=', True)]")
|
||||
family_domain_ids = fields.Many2many(comodel_name='grant.benefit', compute='_compute_domain_ids')
|
||||
company_id = fields.Many2one('res.company', default=lambda self: self.env.company)
|
||||
currency_id = fields.Many2one(comodel_name='res.currency', string="Company Currency",
|
||||
|
|
@ -121,7 +122,7 @@ class ConfirmBenefitExpense(models.Model):
|
|||
self.ensure_one()
|
||||
for line in self.benefit_expense_line_ids:
|
||||
family = line.family_id
|
||||
income, meals, clotting, othaim = 0, 0, 0,0
|
||||
income, meals, clotting, othaim = 0, 0, 0, 0
|
||||
if not family:
|
||||
continue
|
||||
monthly_meals = 0.0 if family.meal_card else family.family_monthly_meals
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class SeasonalService(models.Model):
|
|||
string="Seasonal Service Type", required=True)
|
||||
benefit_type = fields.Selection(string='Benefit Type', related='service_type_id.benefit_type')
|
||||
branch_ids = fields.Many2many('branch.settings', 'service_branch_rel', 'service_id', 'branch_id', string='Branches',
|
||||
required=True)
|
||||
required=True, domain="[('has_employees', '=', True)]")
|
||||
family_category_ids = fields.Many2many(
|
||||
'benefit.category',
|
||||
'service_category_rel',
|
||||
|
|
|
|||
|
|
@ -890,6 +890,7 @@ class ServiceRequest(models.Model):
|
|||
rec.service_max_amount = rec.service_cat.fatherless_member_amount
|
||||
if rec.is_orphan:
|
||||
rec.service_max_amount = rec.service_cat.orphan_member_amount
|
||||
rec.requested_service_amount = rec.service_max_amount
|
||||
if rec.member_age > rec.service_cat.max_age:
|
||||
raise ValidationError(_("Member Age should be less than %s ") % rec.service_cat.max_age)
|
||||
if rec.member_payroll > rec.service_cat.member_max_payroll:
|
||||
|
|
|
|||
|
|
@ -546,6 +546,16 @@
|
|||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="service_request_account_action" model="ir.actions.act_window">
|
||||
<field name="name">Services Requests</field>
|
||||
<field name="res_model">service.request</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('is_seasonal','=',False),('state','=','accounting_approve'),('payment_order_state','=','none')]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">Create the Service Request
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="benefit_need_action">
|
||||
<field name="name">Benefit Need</field>
|
||||
<field name="res_model">benefit.need</field>
|
||||
|
|
@ -993,6 +1003,8 @@
|
|||
parent="odex_benefit.benefit_tools_services_settings_menu" action="services_settings_action" groups="odex_benefit.group_benefit_manager"/>
|
||||
<menuitem id="services_requests_menu" name="Services Requests" sequence="2"
|
||||
parent="odex_benefit.benefit_services" action="service_request_action"/>
|
||||
<menuitem id="services_requests_account_menu" name="Services Requests" sequence="9"
|
||||
parent="account.menu_finance_payables" action="service_request_account_action"/>
|
||||
|
||||
<!-- <menuitem id="family_member_main_menu" name="Family Members"-->
|
||||
<!-- parent="benefits_root_menu" sequence="2"/>-->
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@
|
|||
force_save="1"/>
|
||||
<field name="last_visit_date" readonly="1"/>
|
||||
<field name="city_id"
|
||||
readonly="1"
|
||||
invisible="1"
|
||||
string="City" options="{'no_create': True, 'no_create_edit': True}"
|
||||
groups="!odex_benefit.group_benefit_manager"/>
|
||||
<field name="branch_custom_id"
|
||||
|
|
@ -539,6 +539,7 @@
|
|||
options="{'currency_field': 'currency_id'}" readonly="1" force_save="1"/>
|
||||
<field name="benefit_category_id" readonly="1" force_save="1"/>
|
||||
<field name="benefit_category_old"/>
|
||||
<field name="approve_date" readonly="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="mother_family_member_id" invisible="1" readonly="1"/>
|
||||
|
|
@ -1787,7 +1788,7 @@
|
|||
|
||||
|
||||
<xpath expr="//field[@name='city_id']" position="replace">
|
||||
<field name="city_id" readonly="1"/>
|
||||
<field name="city_id" invisible="1"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='branch_custom_id']" position="replace">
|
||||
|
|
|
|||
|
|
@ -55,8 +55,10 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
researcher_team = fields.Many2one("committees.line", string="Researcher Team",
|
||||
domain="[('branch_custom_id', '=',branch_custom_id)]")
|
||||
benefit_id = fields.Many2one("grant.benefit", string="Benefit", default=_default_benefit)
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Department", default=_default_branch_custom_id)
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch',related="benefit_id.branch_has_employees")
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Branch",
|
||||
domain="[('has_employees', '=', True)]",
|
||||
default=_default_branch_custom_id)
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch', related="benefit_id.branch_has_employees")
|
||||
is_submitted = fields.Boolean(string="Submitted", default=False)
|
||||
|
||||
def submit_family(self):
|
||||
|
|
@ -65,7 +67,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
'state': 'complete_info',
|
||||
'contact_type': 'sms',
|
||||
'researcher_id': rec.researcher_team.id,
|
||||
'branch_custom_id':rec.branch_custom_id.id,
|
||||
'branch_custom_id': rec.branch_custom_id.id,
|
||||
})
|
||||
visit_record = self.env['visit.location'].create({
|
||||
'benefit_id': rec.benefit_id.id,
|
||||
|
|
@ -80,7 +82,8 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
rec._send_assignment_notification(visit_record)
|
||||
specialist_name = rec.researcher_team.name or _('Not Specified')
|
||||
visit_number = visit_record.name or str(visit_record.id)
|
||||
message = _('File has been assigned to specialist "%s" and initial visit created with number "%s"') % (specialist_name, visit_number)
|
||||
message = _('File has been assigned to specialist "%s" and initial visit created with number "%s"') % (
|
||||
specialist_name, visit_number)
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
|
|
@ -135,7 +138,8 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
'email_to': specialist_user.work_email or specialist_user.email,
|
||||
'email_cc': self.env.user.company_id.hr_email or self.env.user.company_id.email,
|
||||
})
|
||||
template.with_context(lang=self.env.user.lang).send_mail(visit_record.id, force_send=True, raise_exception=False)
|
||||
template.with_context(lang=self.env.user.lang).send_mail(visit_record.id, force_send=True,
|
||||
raise_exception=False)
|
||||
|
||||
except Exception as e:
|
||||
self._send_in_system_notification(specialist_user, visit_record)
|
||||
|
|
|
|||
Loading…
Reference in New Issue