[IMP] odex_benefit: IMP benefit

This commit is contained in:
younes 2025-12-14 13:08:19 +01:00
parent 7344973c84
commit 739924c5e0
9 changed files with 48 additions and 12 deletions

View File

@ -4959,10 +4959,14 @@ msgstr "رفض الاستثناء"
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__exception_second_approve #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__exception_second_approve
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__exception_second_approve #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__exception_second_approve
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__exception_second_approve #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__exception_second_approve
#: model:ir.model.fields.selection,name:odex_benefit.selection__payment_orders__state__waiting_gm
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form #: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Waiting for General Manager" msgid "Waiting for General Manager"
msgstr "بانتظار مساعد المدير العام"
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__payment_orders__state__waiting_gm
msgid "Waiting for General Manager"
msgstr "بانتظار المدير العام" msgstr "بانتظار المدير العام"
#. module: odex_benefit #. module: odex_benefit
@ -15157,7 +15161,7 @@ msgstr "هوية المالك"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__marriage_certificate #: model:ir.model.fields,field_description:odex_benefit.field_family_member__marriage_certificate
msgid "Marriage Certificate" msgid "Marriage Certificate"
msgstr "شهادة الزواج" msgstr "عقد الزواج"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__death_certificate #: model:ir.model.fields,field_description:odex_benefit.field_family_member__death_certificate
@ -15195,7 +15199,7 @@ msgstr "شهادة الراتب مطلوبة للفرد '%s' عند العمل
msgid "" msgid ""
"Marriage Certificate is required for member '%s' when marked as married and " "Marriage Certificate is required for member '%s' when marked as married and "
"not a mother." "not a mother."
msgstr "شهادة الزواج مطلوبة للفرد '%s' عند تحديده كمتزوج وليس أماً." msgstr "عقد الزواج مطلوبة للفرد '%s' عند تحديده كمتزوج وليس أماً."
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__family_edit #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__family_edit

View File

@ -2344,7 +2344,7 @@ class GrantBenefitProfile(models.Model):
# raise ValidationError( # raise ValidationError(
# _('Enter a valid Saudi mobile number')) # _('Enter a valid Saudi mobile number'))
@api.onchange('phone', 'phone2','sms_phone') @api.constrains('phone', 'phone2','sms_phone')
def _onchange_phone_numbers(self): def _onchange_phone_numbers(self):
phone_numbers = { phone_numbers = {
'الهاتف': self.phone, 'الهاتف': self.phone,

View File

@ -70,6 +70,7 @@ class FamilyMemberProfile(models.Model):
is_married = fields.Boolean('Is Married?') is_married = fields.Boolean('Is Married?')
marriage_certificate = fields.Many2many('ir.attachment', 'member_marriage_cert_rel', 'member_id', 'attachment_id', marriage_certificate = fields.Many2many('ir.attachment', 'member_marriage_cert_rel', 'member_id', 'attachment_id',
string="Marriage Certificate") string="Marriage Certificate")
marriage_date = fields.Date(string='Marriage Contract Date')
relationn = fields.Many2one('relation.settings', relationn = fields.Many2one('relation.settings',
domain="['|',('relation_type','=','son'),('relation_type','=','daughter')]", domain="['|',('relation_type','=','son'),('relation_type','=','daughter')]",
string="Relation") string="Relation")
@ -1003,7 +1004,7 @@ class FamilyMemberProfile(models.Model):
'state': 'draft' 'state': 'draft'
}) })
@api.onchange('member_phone') @api.constrains('member_phone')
def _onchange_member_phone_validation(self): def _onchange_member_phone_validation(self):
if self.member_phone: if self.member_phone:
if self.member_phone.startswith('+966'): if self.member_phone.startswith('+966'):

View File

@ -9,6 +9,7 @@ class BenefitAttachment(models.Model):
education_status_id = fields.Many2one('education.status') education_status_id = fields.Many2one('education.status')
member_id = fields.Many2one('family.member',string="Member") member_id = fields.Many2one('family.member',string="Member")
expiration_date = fields.Date(string='Expiration date') expiration_date = fields.Date(string='Expiration date')
start_date = fields.Date(string='Start Date')
attach_status = fields.Selection(selection=[ attach_status = fields.Selection(selection=[
('valid', 'Valid'), ('valid', 'Valid'),
('expired', 'Expired'), ('expired', 'Expired'),
@ -25,6 +26,7 @@ class BenefitAttachment(models.Model):
mother_grant_benefit_id = fields.Many2one('grant.benefit', string='Mother Grant Benefit') mother_grant_benefit_id = fields.Many2one('grant.benefit', string='Mother Grant Benefit')
replacement_mother_grant_benefit_id = fields.Many2one('grant.benefit', string='Replacement Mother Grant Benefit') replacement_mother_grant_benefit_id = fields.Many2one('grant.benefit', string='Replacement Mother Grant Benefit')
show_in_portal = fields.Boolean(default=False, string="Show In Portal") show_in_portal = fields.Boolean(default=False, string="Show In Portal")
supporter_id = fields.Many2one(comodel_name='res.partner',string='Supporter',domain=[('is_supporter', '=', True)],)
def action_preview_attachment(self): def action_preview_attachment(self):
# Custom function to open the preview # Custom function to open the preview

View File

@ -13,6 +13,7 @@ class ResPartner(models.Model):
education_level_ids = fields.Many2many( education_level_ids = fields.Many2many(
comodel_name='education.level', relation='res_partner_education_level_rel', comodel_name='education.level', relation='res_partner_education_level_rel',
column1='partner_id', column2='level_id', string='Education Levels', ) column1='partner_id', column2='level_id', string='Education Levels', )
is_supporter = fields.Boolean(string='Supporter', default=False, )
def unlink(self): def unlink(self):
env = self.env env = self.env

View File

@ -753,6 +753,14 @@
<field name="context">{'default_is_company':True,'default_is_education_entity':True}</field> <field name="context">{'default_is_company':True,'default_is_education_entity':True}</field>
</record> </record>
<record model="ir.actions.act_window" id="action_supporter_partners">
<field name="name">Supporter Entities</field>
<field name="res_model">res.partner</field>
<field name="view_mode">kanban,form,tree</field>
<field name="domain">[('is_supporter','=', True)]</field>
<field name="context">{'default_is_company':True,'default_is_supporter':True}</field>
</record>
<!--###########################################################--> <!--###########################################################-->
<!--Benefit Menus--> <!--Benefit Menus-->
<!--###########################################################--> <!--###########################################################-->
@ -1043,6 +1051,8 @@
parent="odex_benefit.benefit_tools" sequence="3"/> parent="odex_benefit.benefit_tools" sequence="3"/>
<menuitem id="education_entities_menu" name="Education Entities" <menuitem id="education_entities_menu" name="Education Entities"
parent="education_main_menu" action="education_entities_action" sequence="0"/> parent="education_main_menu" action="education_entities_action" sequence="0"/>
<menuitem id="supporter_partners_menu" name="Supporter Entities"
parent="menu_benefits_config_others" action="action_supporter_partners" sequence="10"/>
<menuitem id="education_level_menu" name="Education Level" <menuitem id="education_level_menu" name="Education Level"
parent="education_main_menu" action="education_level_action" sequence="1"/> parent="education_main_menu" action="education_level_action" sequence="1"/>
<menuitem id="education_period_menu" <menuitem id="education_period_menu"

View File

@ -609,7 +609,7 @@
<field name="contact_type"/> <field name="contact_type"/>
<field name="request_producer_relation" readonly="1" force_save="1"/> <field name="request_producer_relation" readonly="1" force_save="1"/>
<field name="applicant_name"/> <field name="applicant_name"/>
<field name="partner_id" string="Partner" readonly="1"/> <field name="partner_id" string="Partner" invisible="1" readonly="1"/>
<field name="request_producer" readonly="1" force_save="1" invisible="1"/> <field name="request_producer" readonly="1" force_save="1" invisible="1"/>
</group> </group>
</group> </group>
@ -831,13 +831,13 @@
<tree editable="bottom"> <tree editable="bottom">
<field name="diseases_id" required="1"/> <field name="diseases_id" required="1"/>
<field name="name"/> <field name="name"/>
<field name="diseases_id" required="1"/>
<field name="datas" widget="binary" string="File content" <field name="datas" widget="binary" string="File content"
filename="attachment_file_name"/> filename="attachment_file_name"/>
<button name="action_preview_attachment" type="object" <button name="action_preview_attachment" type="object"
icon="fa-search-plus" icon="fa-search-plus"
attrs="{'invisible': [('file_size', '=', 0)]}"/> attrs="{'invisible': [('file_size', '=', 0)]}"/>
<field name="expiration_date"/> <field name="start_date"/>
<field name="supporter_id"/>
<field name="attach_status"/> <field name="attach_status"/>
<field name="mother_grant_benefit_id" invisible="1"/> <field name="mother_grant_benefit_id" invisible="1"/>
<field name="member_id" invisible="1"/> <field name="member_id" invisible="1"/>
@ -997,13 +997,13 @@
<tree editable="bottom"> <tree editable="bottom">
<field name="diseases_id" required="1"/> <field name="diseases_id" required="1"/>
<field name="name"/> <field name="name"/>
<field name="diseases_id" required="1"/>
<field name="datas" widget="binary" string="File content" <field name="datas" widget="binary" string="File content"
filename="attachment_file_name"/> filename="attachment_file_name"/>
<button name="action_preview_attachment" type="object" <button name="action_preview_attachment" type="object"
icon="fa-search-plus" icon="fa-search-plus"
attrs="{'invisible': [('file_size', '=', 0)]}"/> attrs="{'invisible': [('file_size', '=', 0)]}"/>
<field name="expiration_date"/> <field name="start_date"/>
<field name="supporter_id"/>
<field name="attach_status"/> <field name="attach_status"/>
<field name="replacement_mother_grant_benefit_id" invisible="1"/> <field name="replacement_mother_grant_benefit_id" invisible="1"/>
<field name="member_id" invisible="1"/> <field name="member_id" invisible="1"/>
@ -1118,6 +1118,12 @@
readonly="1" force_save="1"/> readonly="1" force_save="1"/>
<field name="is_married" <field name="is_married"
attrs="{'invisible':[('is_mother','=',True)]}"/> attrs="{'invisible':[('is_mother','=',True)]}"/>
<field name="marriage_date"
attrs="{
'invisible': ['|',('is_mother','=',True),('is_married','=',False)],
'required': [('is_married','=',True)]
}"
/>
<field name="marriage_certificate" <field name="marriage_certificate"
widget="many2many_attachment_preview" widget="many2many_attachment_preview"
attrs="{'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"/> attrs="{'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"/>
@ -1178,7 +1184,8 @@
<button name="action_preview_attachment" <button name="action_preview_attachment"
type="object" icon="fa-search-plus" type="object" icon="fa-search-plus"
attrs="{'invisible': [('file_size', '=', 0)]}"/> attrs="{'invisible': [('file_size', '=', 0)]}"/>
<field name="expiration_date"/> <field name="start_date"/>
<field name="supporter_id"/>
<field name="attach_status"/> <field name="attach_status"/>
<field name="member_id" invisible="1"/> <field name="member_id" invisible="1"/>
<field name="file_size" invisible="1"/> <field name="file_size" invisible="1"/>

View File

@ -138,6 +138,13 @@
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/> attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="is_married" <field name="is_married"
attrs="{'invisible':[('is_mother','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'invisible':[('is_mother','=',True)],'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="marriage_date"
attrs="{
'invisible': ['|', ('is_mother','=',True), ('is_married','=',False)],
'readonly': [('state','not in',['draft','complete_info'])],
'required': [('is_married','=',True)]
}"
/>
<field name="marriage_certificate" widget="many2many_attachment_preview" <field name="marriage_certificate" widget="many2many_attachment_preview"
attrs="{'readonly':[('state','not in',['draft','complete_info'])],'invisible':['|',('is_mother','=',True),('is_married','=',False)]}" attrs="{'readonly':[('state','not in',['draft','complete_info'])],'invisible':['|',('is_mother','=',True),('is_married','=',False)]}"
/> />
@ -193,7 +200,8 @@
<field name="name"/> <field name="name"/>
<field name="diseases_id" required="1"/> <field name="diseases_id" required="1"/>
<field name="datas" string="File content"/> <field name="datas" string="File content"/>
<field name="expiration_date"/> <field name="start_date"/>
<field name="supporter_id"/>
<field name="attach_status"/> <field name="attach_status"/>
<field name="member_id" invisible="1"/> <field name="member_id" invisible="1"/>
</tree> </tree>
@ -289,6 +297,7 @@
<field name="model">family.member</field> <field name="model">family.member</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Family Members" create="false"> <tree string="Family Members" create="false">
<field name="member_id_number"/>
<field name="name" force_save="1"/> <field name="name" force_save="1"/>
<field name="relationn"/> <field name="relationn"/>
<field name="member_location_conf"/> <field name="member_location_conf"/>
@ -640,6 +649,7 @@
<field name="model">family.member</field> <field name="model">family.member</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search> <search>
<field name="member_id_number"/>
<field name="name"/> <field name="name"/>
<field name="member_first_name"/> <field name="member_first_name"/>
<field name="member_second_name"/> <field name="member_second_name"/>

View File

@ -12,6 +12,7 @@
widget="many2many_tags" widget="many2many_tags"
attrs="{'invisible': [('is_education_entity', '=', False)]}" attrs="{'invisible': [('is_education_entity', '=', False)]}"
/> />
<field name="is_supporter" widget="boolean_toggle"/>
</xpath> </xpath>
</field> </field>
</record> </record>