diff --git a/odex25_ensan/odex_benefit/i18n/ar_001.po b/odex25_ensan/odex_benefit/i18n/ar_001.po index 3f9758cb4..bb1e60de2 100644 --- a/odex25_ensan/odex_benefit/i18n/ar_001.po +++ b/odex25_ensan/odex_benefit/i18n/ar_001.po @@ -1038,6 +1038,7 @@ msgstr "حساب" #. module: odex_benefit #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__acc_holder_name +#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__family_member_id msgid "Account Holder Name" msgstr "اسم مالك الحساب" @@ -13880,3 +13881,37 @@ msgstr "منشئ الطلب" #: model:ir.model.fields,field_description:odex_benefit.field_service_request__requests_counts msgid "Requests Counts" msgstr "عدد الطلبات" + +#. module: odex_benefit +#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__is_family_member +msgid "Is Family member?" +msgstr "هل صاحب الحساب من أفراد الأسرة؟" + +#. module: odex_benefit +#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__owner_identity_attachment_ids +msgid "Account holder identity" +msgstr "هوية صاحب الحساب" + +#. module: odex_benefit +#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__family_approval_attachment_ids +msgid "Family approval of transfer" +msgstr "إقرار أفراد الأسرة بالتحويل" + +#. module: odex_benefit +#: code:addons/odex_benefit/models/benefit.py:0 +#, python-format +msgid "Account Holder Identity Attachment is required." +msgstr ".مرفق هوية صاحب الحساب مطلوب" + +#. module: odex_benefit +#: code:addons/odex_benefit/models/benefit.py:0 +#, python-format +msgid "Family approval of transfer Attachment is required." +msgstr ".مرفق إقرار أفراد الأسرة بالتحويل مطلوب" + +#. module: odex_benefit +#: code:addons/odex_benefit/models/benefit.py:0 +#, python-format +msgid "Father Dead Certificate is required." +msgstr ".مرفق شهادة وفاة الأب مطلوب" + diff --git a/odex25_ensan/odex_benefit/models/benefit.py b/odex25_ensan/odex_benefit/models/benefit.py index 449b8a10d..c727b45a1 100644 --- a/odex25_ensan/odex_benefit/models/benefit.py +++ b/odex25_ensan/odex_benefit/models/benefit.py @@ -550,13 +550,23 @@ class GrantBenefitProfile(models.Model): replacement_last_educational_certificate = fields.Many2many('ir.attachment','rel_replacement_last_educational__certificate_attachment','benefit_id','attachment_id',string='Last Educational Certificate') replacement_weak_study = fields.Many2many('study.material',relation='grant_benefit_replacement_weak_study_rel',string='Weak Study') sponsorship_id = fields.Many2one('takaful.sponsorship',string='Sponsorship') + #check if Account Holder is Family memeber of not + is_family_member = fields.Boolean(string='Is Family member?' , help="check if Account Holder is Family memeber") + family_member_id = fields.Many2one('family.member', string='Account Holder Name', domain="[('id','in',member_ids)]") + owner_identity_attachment_ids = fields.Many2many('ir.attachment', 'rel_identity_attachment','benefit_id','attachment_id',string='Account holder identity') + family_approval_attachment_ids = fields.Many2many('ir.attachment', 'rel_approval_attachment','benefit_id','attachment_id',string='Family approval of transfer') + def _validate_required_attachments(self): """Validate required Many2many attachments""" for rec in self: if not rec.father_dead_certificate: - raise ValidationError("Father Dead Certificate is required.") + raise ValidationError(_("Father Dead Certificate is required.")) + if not rec.owner_identity_attachment_ids and rec.is_family_member == False: + raise ValidationError(_("Account Holder Identity Attachment is required.")) + if not rec.family_approval_attachment_ids and rec.is_family_member == False: + raise ValidationError(_("Family approval of transfer Attachment is required.")) if rec.state != 'draft' and not rec.national_address_attachment: raise ValidationError("National Address Attachment is required when the state is not Draft.") diff --git a/odex25_ensan/odex_benefit/views/benefit_view.xml b/odex25_ensan/odex_benefit/views/benefit_view.xml index abaeb143e..c567f6adb 100644 --- a/odex25_ensan/odex_benefit/views/benefit_view.xml +++ b/odex25_ensan/odex_benefit/views/benefit_view.xml @@ -559,6 +559,7 @@ +