diff --git a/odex25_ensan/odex25_program_activity/i18n/ar_001.po b/odex25_ensan/odex25_program_activity/i18n/ar_001.po index 9f38f1d30..2ea375214 100644 --- a/odex25_ensan/odex25_program_activity/i18n/ar_001.po +++ b/odex25_ensan/odex25_program_activity/i18n/ar_001.po @@ -371,6 +371,11 @@ msgstr "التاريخ الى" msgid "Family" msgstr "الأسرة" +#. module: odex25_program_activity +#: model:ir.model.fields,field_description:odex25_program_activity.field_pa_program_activity_registration__benefit_category_id +msgid "Family Category" +msgstr " فئة الأسرة" + #. module: odex25_program_activity #: model:ir.model.fields,field_description:odex25_program_activity.field_pa_program_activity_registration__sms_phone msgid "Mobile Number" diff --git a/odex25_ensan/odex25_program_activity/models/program.py b/odex25_ensan/odex25_program_activity/models/program.py index 0a18c6242..69cf34967 100644 --- a/odex25_ensan/odex25_program_activity/models/program.py +++ b/odex25_ensan/odex25_program_activity/models/program.py @@ -262,6 +262,14 @@ class PaProgramActivityRegistration(models.Model): date_to = fields.Datetime(string='Date To') familye_id = fields.Many2one('grant.benefit', string='Family') + beneficiary_ids = fields.Many2many( + 'family.member', + string='Beneficiary Name', + domain="[('benefit_id', '=', familye_id)]" + ) + benefit_category_id = fields.Many2one(related='familye_id.benefit_category_id', string='Family Category', readonly=True) + + # beneficiary_ids = fields.Many2many('family.member', string='Beneficiary Name') sms_phone = fields.Char(related='familye_id.sms_phone', string='Mobile Number', readonly=True) member_ids = fields.One2many( @@ -288,7 +296,7 @@ class PaProgramActivityRegistration(models.Model): ('daughter', 'Daughter') ], string='Beneficiary Relation') - beneficiary_ids = fields.Many2many('res.partner', string='Beneficiary Name') + sons = fields.Integer( string="Number of Sons", diff --git a/odex25_ensan/odex25_program_activity/views/program.xml b/odex25_ensan/odex25_program_activity/views/program.xml index 9bb91bbb7..b0c0dec42 100644 --- a/odex25_ensan/odex25_program_activity/views/program.xml +++ b/odex25_ensan/odex25_program_activity/views/program.xml @@ -342,6 +342,7 @@ + @@ -350,7 +351,7 @@ - + diff --git a/odex25_ensan/odex_benefit/models/benefit.py b/odex25_ensan/odex_benefit/models/benefit.py index dc7bcd143..73dc98d53 100644 --- a/odex25_ensan/odex_benefit/models/benefit.py +++ b/odex25_ensan/odex_benefit/models/benefit.py @@ -723,10 +723,11 @@ class GrantBenefitProfile(models.Model): # self.required_attach = 'true' @api.depends('attachment_ids.datas', 'attachment_ids.is_required', 'attachment_ids.is_default') def get_required_attach(self): + bypass_verify_backend_require_attachs = self._context.get('bypass_verify_backend_require_attachs', False) for record in self: required_missing = False for att in record.attachment_ids: - if att.is_required and not att.datas: + if (not bypass_verify_backend_require_attachs or att.show_in_portal) and att.is_required and not att.datas: required_missing = True break if required_missing: @@ -1152,12 +1153,14 @@ class GrantBenefitProfile(models.Model): 'name': attach.name, 'is_required': attach.is_required, 'is_default': attach.is_default, + 'show_in_portal': attach.show_in_portal })) if attach.attach_type == 'income_attach': income_attachments_data.append((0, 0, { 'income_type': attach.id, 'is_required': attach.is_required, 'is_default': attach.is_default, + 'show_in_portal': attach.show_in_portal })) # Add the default attachments to the res dictionary for attachment_ids diff --git a/odex25_ensan/odex_benefit/models/benefit_config.py b/odex25_ensan/odex_benefit/models/benefit_config.py index 8a1d6382f..7558cf7e1 100644 --- a/odex25_ensan/odex_benefit/models/benefit_config.py +++ b/odex25_ensan/odex_benefit/models/benefit_config.py @@ -753,6 +753,7 @@ class AttachmentsSettings(models.Model): ('diseases_attach', _('Diseases Attach')), ('disabilities_attach', _('Disabilities Attach')), ('income_attach', _('Income Attach'))]) is_required = fields.Boolean(string='Is Required?') is_default = fields.Boolean(string='Is Default?') + show_in_portal = fields.Boolean(default=True) family_appearance_seq = fields.Integer(string='Appearance Sequence') member_appearance_seq = fields.Integer(string='Appearance Sequence') income_appearance_seq = fields.Integer(string='Appearance Sequence') diff --git a/odex25_ensan/odex_benefit/models/family_members.py b/odex25_ensan/odex_benefit/models/family_members.py index 62fddcd44..84faed2b1 100644 --- a/odex25_ensan/odex_benefit/models/family_members.py +++ b/odex25_ensan/odex_benefit/models/family_members.py @@ -342,6 +342,7 @@ class FamilyMemberProfile(models.Model): 'attach_id':attach.id, 'is_required': attach.is_required, 'is_default': attach.is_default, + 'show_in_portal': attach.show_in_portal })) # Add the default attachments to the res dictionary for attachment_ids diff --git a/odex25_ensan/odex_benefit/models/ir_attachment_inherit.py b/odex25_ensan/odex_benefit/models/ir_attachment_inherit.py index f3e28052c..3d9cd80cd 100644 --- a/odex25_ensan/odex_benefit/models/ir_attachment_inherit.py +++ b/odex25_ensan/odex_benefit/models/ir_attachment_inherit.py @@ -22,7 +22,11 @@ class BenefitAttachment(models.Model): # fields to management required and delete records in benefit attachment is_required = fields.Boolean(string='Is Required?') is_default = fields.Boolean(string='Is Default?') +<<<<<<< HEAD mother_grant_benefit_id = fields.Many2one('grant.benefit', string='Mother Grant Benefit') +======= + show_in_portal = fields.Boolean(default=True) +>>>>>>> 04481aa674a7a77bd6f957f5c0bd2802a45c2978 def action_preview_attachment(self): # Custom function to open the preview diff --git a/odex25_ensan/odex_benefit/views/benefit_config_view.xml b/odex25_ensan/odex_benefit/views/benefit_config_view.xml index 46a7fdf63..e0dd5e659 100644 --- a/odex25_ensan/odex_benefit/views/benefit_config_view.xml +++ b/odex25_ensan/odex_benefit/views/benefit_config_view.xml @@ -1048,6 +1048,7 @@ + @@ -1063,6 +1064,7 @@ +