[IMP] Benefit

This commit is contained in:
younes 2025-08-21 12:41:38 +01:00
parent 9b00b948ce
commit 79e242533d
5 changed files with 53 additions and 42 deletions

View File

@ -1056,7 +1056,7 @@ msgstr "اعتماد المدير المالي"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__acc_number
msgid "Account Number"
msgstr "رقم الحساب"
msgstr "رقم آيبان"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__account_relation
@ -4010,10 +4010,15 @@ msgstr "مرفق العنوان الوطني"
msgid "Has Othaim family number?"
msgstr "هل يوجد رقم عائلة العثيم؟ "
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__othaim_family_number
msgid "Othaim family number"
msgstr "رقم عائلة العثيم"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__request_producer_relation
msgid "Request Producer Relation"
msgstr "طلب علاقة المنتج "
msgstr "صفة مقدم الطلب"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__age_status

View File

@ -11,6 +11,7 @@ from io import BytesIO
import re
SAUDI_MOBILE_PATTERN = "(^(05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$)"
ALPHABETIC_PATTERN = "^[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FFA-Za-z ]+$"
_logger = logging.getLogger(__name__)
@ -586,6 +587,20 @@ class GrantBenefitProfile(models.Model):
('unique_code', "unique (code) WHERE state NOT IN ('draft', 'new')", 'This code already exists')
]
# @api.constrains('father_name')
# def _check_names_alphabetic(self):
# char_fields = {
# 'father_name': 'father name',
# }
#
# for record in self:
# for field_name, field_label in char_fields.items():
# field_value = getattr(record, field_name)
# if field_value and not re.match(ALPHABETIC_PATTERN, field_value.strip()):
# raise ValidationError(
# f"{field_label} must contain only alphabetic characters and spaces. "
# f"Numbers and special characters are not allowed."
# )
def assign_sequence_to_all(self):
sequence = self.env['ir.sequence'].search([('code', '=', 'benefit.sequence')], limit=1)

View File

@ -9,6 +9,7 @@ import qrcode
import base64
from io import BytesIO
SAUDI_MOBILE_PATTERN = "(^(05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$)"
ALPHABETIC_PATTERN = "^[A-Za-z ]+$"
import re
_logger = logging.getLogger(__name__)

View File

@ -74,7 +74,7 @@ access_benefit_expenses,access_benefit_expenses,model_benefit_expenses,,1,1,1,0
access_benefit_cloth,access_benefit_cloth,model_benefit_cloth,,1,1,1,0
access_cloth_type,access_cloth_type,model_cloth_type,,1,1,1,0
access_cloth_size,access_cloth_size,model_cloth_size,,1,1,1,0
access_expenses_line,access_expenses_line,model_expenses_line,,1,1,1,0
access_expenses_line,access_expenses_line,model_expenses_line,,1,1,1,1
access_associations_line,access_associations_line,model_associations_line,,1,1,1,0
access_hospital_hospital,access_hospital_hospital,model_hospital_hospital,,1,1,1,0
access_insurance_type,access_insurance_type,model_insurance_type,,1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
74 access_benefit_cloth access_benefit_cloth model_benefit_cloth 1 1 1 0
75 access_cloth_type access_cloth_type model_cloth_type 1 1 1 0
76 access_cloth_size access_cloth_size model_cloth_size 1 1 1 0
77 access_expenses_line access_expenses_line model_expenses_line 1 1 1 0 1
78 access_associations_line access_associations_line model_associations_line 1 1 1 0
79 access_hospital_hospital access_hospital_hospital model_hospital_hospital 1 1 1 0
80 access_insurance_type access_insurance_type model_insurance_type 1 1 1 0

View File

@ -316,8 +316,6 @@
<group>
<field name="email"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
</group>
<group>
<field name="phone" string="Phone"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
<field name="phone2"
@ -329,6 +327,12 @@
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"
invisible="1"/>
</group>
<group>
<field name="applicant_name"/>
<field name="request_producer" readonly="1" force_save="1" invisible="1"/>
<field name="request_producer_relation"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
</group>
</group>
<notebook>
<page string="Father Information">
@ -931,7 +935,7 @@
</group>
</page>
<page string="Income and salary">
<field name="salary_ids"
<field name="salary_ids" context="{'default_state': 'accepted'}"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}">
<tree editable="bottom" delete="0">
<field name="benefit_id" invisible="1"/>
@ -940,16 +944,6 @@
<field name="salary_attach" widget="many2many_attachment_preview"/>
<field name="attach_start_date"/>
<field name="attach_end_date"/>
<button name="action_accept" type="object" string="Accept" class="oe_highlight"
attrs="{'invisible':[('state','=','accepted')]}"
groups="odex_benefit.group_accept_income_and_expenses"/>
<button name="action_refuse" type="object" string="Refuse" class="oe_highlight"
attrs="{'invisible':[('state','=','refused')]}"
groups="odex_benefit.group_accept_income_and_expenses"/>
<field name="state" readonly="1" force_save="1" widget="badge"
decoration-warning="state in ['waiting']"
decoration-success="state in ['accepted']"
decoration-danger="state in ['refused']"/>
<field name="is_required" invisible="1"/>
<field name="is_default" invisible="1"/>
</tree>
@ -959,22 +953,6 @@
attrs="{'required':[('state','not in',['draft','new'])]}"/>
</group>
</page>
<page string="Family Cars" attrs="{'invisible':[('has_car','=',False)]}">
<group>
<field name="car_ids"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}">
<tree editable="bottom">
<field name="benefit_id" invisible="1"/>
<field name="name"/>
<field name="car_model"/>
<field name="status"/>
<field name="image_1"/>
<field name="image_2"/>
<field name="image_3"/>
</tree>
</field>
</group>
</page>
<!-- <page string="Craft Skills" attrs="{'invisible': [('is_craft', '=', False)]}">-->
<!-- <group>-->
<!-- <field name="craft_skill_ids">-->
@ -1100,7 +1078,7 @@
attrs="{'readonly': [('state', '=', 'black_list')]}"/>
<field name="black_list_message"/>
</page>
<page string="Bank Account Information" groups="odex_benefit.group_benefit_bank_info">
<page string="Bank Account Information" attrs="{'invisible': [('state', 'not in', ['second_approve','first_approve'])]}" groups="odex_benefit.group_benefit_bank_info">
<form>
<sheet>
<group>
@ -1179,7 +1157,7 @@
</group>
</group>
</page>
<page string="Family Monthly salary">
<page string="Family Monthly salary" attrs="{'invisible': [('state', 'not in', ['second_approve'])]}">
<group>
<field name="family_monthly_income"/>
<field name="family_monthly_meals"/>
@ -1220,25 +1198,37 @@
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
<field name="othaim_family_number"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])] ,'invisible':[('has_othaim_family_number','=',False)]}"/>
<field name="is_excluded_suspension"
<field name="is_excluded_suspension" invisible="1"
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
readonly="1" force_save="1"/>
</group>
<group>
<!-- <field name="request_producer_id"/> -->
<field name="applicant_name"/>
<field name="request_producer" readonly="1" force_save="1" invisible="1"/>
<field name="request_producer_relation"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}"/>
<field name="partner_id" readonly="1" required="0" force_save="1" string="Partner"
invisible="1"/>
<field name="user_id" readonly="1" force_save="1"/>
<field name="is_from_portal"/>
groups="odex_benefit.group_benefit_manager"/>
<field name="user_id" readonly="1" force_save="1" groups="odex_benefit.group_benefit_manager"/>
<field name="is_from_portal" groups="odex_benefit.group_benefit_manager"/>
<field name="password" password="True" invisible="1"/>
<field name="has_needs" invisible="1"/>
<!-- <field name="required_attach" attrs="{'required':[('state','not in',['draft'])]}"/>-->
</group>
</page>
<page string="Family Cars" attrs="{'invisible':[('has_car','=',False)]}">
<group>
<field name="car_ids"
attrs="{'readonly':[('state','not in',['draft','new','complete_info','edit_info'])]}">
<tree editable="bottom">
<field name="benefit_id" invisible="1"/>
<field name="name"/>
<field name="car_model"/>
<field name="status"/>
<field name="image_1"/>
<field name="image_2"/>
<field name="image_3"/>
</tree>
</field>
</group>
</page>
</notebook>
</sheet>