Merge pull request #5991 from expsa/uyut

[IMP] odex_benefit: IMP benefit
This commit is contained in:
kchyounes19 2026-01-05 15:18:29 +01:00 committed by GitHub
commit ae951245af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 80 additions and 53 deletions

View File

@ -3041,6 +3041,12 @@ msgstr "قم بتحديد هذا المربع إذا كانت جهة الاتص
msgid "Children" msgid "Children"
msgstr "الفروع" msgstr "الفروع"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_attachments_settings__child_ids
#: model_terms:ir.ui.view,arch_db:odex_benefit.attachments_settings_form
msgid "Children"
msgstr "الأنواع الفرعية"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.ui.menu,name:odex_benefit.res_city_menu #: model:ir.ui.menu,name:odex_benefit.res_city_menu
msgid "Cities" msgid "Cities"
@ -4410,6 +4416,12 @@ msgstr ""
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n" "#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
"اسم الزيارة" "اسم الزيارة"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Description"
msgstr "الوصف"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_attachments_settings__disabilities_id #: model:ir.model.fields,field_description:odex_benefit.field_attachments_settings__disabilities_id
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__disabilities_ids #: model:ir.model.fields,field_description:odex_benefit.field_family_member__disabilities_ids
@ -5093,7 +5105,7 @@ msgstr "تاريخ نهاية الاستثناء"
#: 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 "Exception Final Approve" msgid "Exception Final Approve"
msgstr "اعتماد المدير العام للاستثناء" msgstr "موافقة مساعد المدير العام للاستثناء"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.actions.act_window,name:odex_benefit.exception_reason_action #: model:ir.actions.act_window,name:odex_benefit.exception_reason_action
@ -5616,7 +5628,7 @@ msgstr "اعتماد رئيس العمليات الإيقاف"
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__first_approve #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__first_approve
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__first_approve #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__first_approve
msgid "First Approved" msgid "First Approved"
msgstr "الاعتماد المبدئي" msgstr "بانتظار مدير الفرع"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_benefits_representative__first_name #: model:ir.model.fields,field_description:odex_benefit.field_benefits_representative__first_name
@ -9232,6 +9244,11 @@ msgstr ""
msgid "Parent" msgid "Parent"
msgstr "الأصل" msgstr "الأصل"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_attachments_settings__parent_id
msgid "Parent"
msgstr "النوع الأساسي"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_services_settings__parent_service #: model:ir.model.fields,field_description:odex_benefit.field_services_settings__parent_service
msgid "Parent Service" msgid "Parent Service"
@ -11149,11 +11166,6 @@ msgstr "عملة المورد"
msgid "Supplier Rank" msgid "Supplier Rank"
msgstr "" msgstr ""
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_associations_line__support_amount
msgid "Support Amount"
msgstr ""
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__support_separation #: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__support_separation
msgid "Support Separation" msgid "Support Separation"
@ -14810,7 +14822,6 @@ msgid "Return Reason Wizard"
msgstr "سبب الإرجاع" msgstr "سبب الإرجاع"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_entity_return_reason_wizard__suspend_reason_id
#: model:ir.model.fields,field_description:odex_benefit.field_suspend_reason__is_return_reason #: model:ir.model.fields,field_description:odex_benefit.field_suspend_reason__is_return_reason
#: model:ir.model.fields,field_description:odex_benefit.field_return_reason_wizard__return_reason_id #: model:ir.model.fields,field_description:odex_benefit.field_return_reason_wizard__return_reason_id
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_expense_line__return_reason_id #: model:ir.model.fields,field_description:odex_benefit.field_benefit_expense_line__return_reason_id
@ -14827,6 +14838,11 @@ msgstr ""
"#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n" "#-#-#-#-# catalog.po (Odoo Server 14.0) #-#-#-#-#\n"
"سبب الإعادة" "سبب الإعادة"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_entity_return_reason_wizard__suspend_reason_id
msgid "Return Reason"
msgstr "سبب الإرجاع"
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_entity_return_reason_wizard_form #: model_terms:ir.ui.view,arch_db:odex_benefit.view_entity_return_reason_wizard_form
msgid "Retrun" msgid "Retrun"
@ -15783,7 +15799,7 @@ msgstr "الاسرة مستفيدة؟"
#: 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 "Exception First Approve" msgid "Exception First Approve"
msgstr "" msgstr "موافقة رئيسة العمليات للاستثناء"
#. module: odex_benefit #. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_services_settings__show_in_portal #: model:ir.model.fields,field_description:odex_benefit.field_services_settings__show_in_portal
@ -18391,4 +18407,27 @@ msgstr "رقم هوية صاحب الحساب مطلوب."
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_search #: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_search
msgid "My Branch" msgid "My Branch"
msgstr "فرعي" msgstr "فرعي"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_ir_attachment__disabilities_child_id
msgid "Sub Disability"
msgstr "نوع الإعاقة"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_ir_attachment__diseases_child_id
msgid "Sub Disease"
msgstr "نوع المرض"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_associations_line__support_amount
#: model:ir.model.fields,field_description:odex_benefit.field_ir_attachment__support_amount
msgid "Support Amount"
msgstr "مبلغ الدعم"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Exception Second Approve"
msgstr "موافقة مدير الفرع للاستثناء"

View File

@ -538,6 +538,8 @@ class FamilyMemberProfile(models.Model):
rec.non_benefit_reason = False rec.non_benefit_reason = False
current_education_status_id = rec.member_education_status_ids.filtered( current_education_status_id = rec.member_education_status_ids.filtered(
lambda r: r.education_status_type == 'current') lambda r: r.education_status_type == 'current')
if current_education_status_id:
current_education_status_id = current_education_status_id.sorted('write_date', reverse=True)[:1]
if rec.state == 'second_approve' and rec.is_excluded_suspension: if rec.state == 'second_approve' and rec.is_excluded_suspension:
rec.member_status = 'benefit' rec.member_status = 'benefit'
continue continue

View File

@ -19,11 +19,7 @@ class PaymentOrders(models.Model):
payment_order_date = fields.Datetime(string="Payment Order Date", default=fields.Datetime.now) payment_order_date = fields.Datetime(string="Payment Order Date", default=fields.Datetime.now)
accountant_id = fields.Many2one('res.users', string='Accountant') accountant_id = fields.Many2one('res.users', string='Accountant')
# todo remove _compute_service_type_id and _inverse_service_type_id # todo remove _compute_service_type_id and _inverse_service_type_id
payment_order_description = fields.Many2one('services.settings', payment_order_description = fields.Many2one('services.settings',string='Payment Order Description',)
string='Payment Order Description',
compute='_compute_service_type_id',
inverse='_inverse_service_type_id',
store=True)
service_requests_ids = fields.Many2many(comodel_name='service.request', service_requests_ids = fields.Many2many(comodel_name='service.request',
relation='service_request_payment_order_rel', relation='service_request_payment_order_rel',
column1='payment_order_id', column2='service_request_id', column1='payment_order_id', column2='service_request_id',
@ -144,26 +140,6 @@ class PaymentOrders(models.Model):
for record in self: for record in self:
record.ref_num = record.seasonal_requests_ids[0] if record.seasonal_requests_ids else False record.ref_num = record.seasonal_requests_ids[0] if record.seasonal_requests_ids else False
@api.depends('seasonal_requests_ids.service_type_id')
def _compute_service_type_id(self):
for record in self:
# Take value from first seasonal_requests record (if exists)
record.payment_order_description = record.seasonal_requests_ids[:1].service_type_id
# Inverse method
def _inverse_service_type_id(self):
for record in self:
if record.seasonal_requests_ids:
# Update first related record
record.seasonal_requests_ids[0].service_type_id = record.payment_order_description
else:
# Create new seasonal_requests record if none exists
self.env['seasonal.service'].create({
'payment_order_id': record.id,
'service_type_id': record.payment_order_description.id,
# Add other required fields here if necessary
})
@api.model @api.model
def create(self, vals): def create(self, vals):
res = super(PaymentOrders, self).create(vals) res = super(PaymentOrders, self).create(vals)

View File

@ -206,6 +206,7 @@ class SeasonalService(models.Model):
'service_requests_ids': rec.service_requests_ids.ids, 'service_requests_ids': rec.service_requests_ids.ids,
'is_seasonal': True, 'is_seasonal': True,
'type': 'seasonal_services', 'type': 'seasonal_services',
'payment_order_description': rec.service_type_id.id,
}) })
# rec.payment_order_id = payment_order.id # rec.payment_order_id = payment_order.id
rec.is_payment_order_done = True rec.is_payment_order_done = True
@ -226,6 +227,7 @@ class SeasonalService(models.Model):
'service_requests_ids': rec.service_requests_ids.ids, 'service_requests_ids': rec.service_requests_ids.ids,
'is_seasonal': True, 'is_seasonal': True,
'type': 'seasonal_services', 'type': 'seasonal_services',
'payment_order_description':rec.service_type_id.id,
}) })
rec.payment_order_id = payment_order.id rec.payment_order_id = payment_order.id
elif rec.service_type_id.payment_method == "invoice": elif rec.service_type_id.payment_method == "invoice":

View File

@ -1197,6 +1197,7 @@ class ServiceRequest(models.Model):
'accountant_id': service_cats.accountant_id.id, 'accountant_id': service_cats.accountant_id.id,
'service_requests_ids': [(6, 0, self.ids)], 'service_requests_ids': [(6, 0, self.ids)],
'type': 'services', 'type': 'services',
'payment_order_description': service_cats.id,
}) })
self.write({ self.write({
'payment_order_ids': [(4, payment_order.id)], 'payment_order_ids': [(4, payment_order.id)],

View File

@ -1241,6 +1241,7 @@
<field name="age_status" <field name="age_status"
attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/> attrs="{'invisible':[('relationn_type','not in',('son','daughter'))]}"/>
<field name="member_id_number" required="1"/> <field name="member_id_number" required="1"/>
<field name="is_excluded_suspension" readonly="1" force_save="1"/>
</group> </group>
</group> </group>
<group> <group>
@ -1415,6 +1416,7 @@
<field name="member_status" widget="badge" <field name="member_status" widget="badge"
decoration-success="member_status == 'benefit'" decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'"/> decoration-danger="member_status == 'non_benefit'"/>
<field name="is_excluded_suspension"/>
<field name="benefit_id" invisible="1"/> <field name="benefit_id" invisible="1"/>
<field name="state"/> <field name="state"/>
</tree> </tree>

View File

@ -56,7 +56,7 @@
<button name="action_exception" type="object" <button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight" string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?" confirm="Are you sure you want to move to Temporarily Exception ?"
attrs="{'invisible': [('member_status','=','benefit')]}"/> attrs="{'invisible': ['|',('action_type','=','exception'),('member_status','=','benefit')]}"/>
<button name="action_exception_first_accept" type="object" <button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight" string="Exception First Approve" class="oe_highlight"
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
@ -71,7 +71,7 @@
attrs="{'invisible': [('state','not in',['exception_second_approve'])]}" attrs="{'invisible': [('state','not in',['exception_second_approve'])]}"
groups="odex_benefit.group_benefit_manager"/> groups="odex_benefit.group_benefit_manager"/>
<button name="action_exception_refuse" type="object" <button name="action_exception_refuse" type="object"
string="Exception Refuse" class="oe_highlight" string="Exception Refuse" class="btn btn-danger"
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}" attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}"
/> />
<field name="state" widget="statusbar" <field name="state" widget="statusbar"
@ -151,6 +151,7 @@
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"
required="1"/> required="1"/>
<field name="action_type" readonly="1"/> <field name="action_type" readonly="1"/>
<field name="is_excluded_suspension" readonly="1" force_save="1"/>
</group> </group>
</group> </group>
<group> <group>
@ -167,8 +168,7 @@
<field name="marriage_date" <field name="marriage_date"
attrs="{ attrs="{
'invisible': ['|', ('is_mother','=',True), ('is_married','=',False)], 'invisible': ['|', ('is_mother','=',True), ('is_married','=',False)],
'readonly': [('state','not in',['draft','complete_info'])], '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"
@ -200,7 +200,6 @@
invisible="1"/> invisible="1"/>
<field name="sponsorship_id" invisible="1" <field name="sponsorship_id" invisible="1"
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
<field name="is_excluded_suspension" invisible="1" readonly="1" force_save="1"/>
</group> </group>
<group> <group>
<field name="member_status" invisible="1" readonly="1" widget="badge" <field name="member_status" invisible="1" readonly="1" widget="badge"
@ -349,6 +348,7 @@
<field name="member_status" widget="badge" <field name="member_status" widget="badge"
decoration-success="member_status == 'benefit'" decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'" string="Is Benefit?"/> decoration-danger="member_status == 'non_benefit'" string="Is Benefit?"/>
<field name="is_excluded_suspension"/>
<field name="age"/> <field name="age"/>
<field name="benefit_id"/> <field name="benefit_id"/>
<field name="branch_custom_id"/> <field name="branch_custom_id"/>

View File

@ -106,7 +106,7 @@
<button name="action_first_refuse" type="object" <button name="action_first_refuse" type="object"
string="Return the request to the specialist" class="btn btn-warning" string="Return the request to the specialist" class="btn btn-warning"
states="accounting_approve" states="accounting_approve"
/> />
<button name="action_refuse" type="object" <button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger" string="Refuse" class="btn btn-danger"
states="accounting_approve" states="accounting_approve"
@ -467,6 +467,7 @@
<field name="sub_service_category" invisible="1"/> <field name="sub_service_category" invisible="1"/>
<field name="service_cat"/> <field name="service_cat"/>
<field name="requested_service_amount"/> <field name="requested_service_amount"/>
<field name="accountant_id" optional="hide"/>
<field name="payment_order_id" invisible="1"/> <field name="payment_order_id" invisible="1"/>
<field name="vendor_bill" invisible="1"/> <field name="vendor_bill" invisible="1"/>
<field name="state" widget="badge" decoration-success="state in ['gm_assistant']" <field name="state" widget="badge" decoration-success="state in ['gm_assistant']"

View File

@ -23,7 +23,7 @@ class ExceptionWizard(models.TransientModel):
member_id = fields.Many2one("family.member", string="Member", default=_default_member) member_id = fields.Many2one("family.member", string="Member", default=_default_member)
exception_reason = fields.Many2one('exception.reason',string='Exception Reason') exception_reason = fields.Many2one('exception.reason',string='Exception Reason')
exception_description = fields.Text(string='Exception Description') exception_description = fields.Text(string='Exception Description')
exception_type = fields.Selection(selection=[('temporarily_exception', 'Temporarily Exception'), ('permanent_exception', 'Permanent Exception')], string="Exception Type") exception_type = fields.Selection(selection=[('temporarily_exception', 'Temporarily Exception'), ('permanent_exception', 'Permanent Exception')], string="Exception Type",default='temporarily_exception')
exception_attachment = fields.Binary(string='Exception Attachment',attachment = True) exception_attachment = fields.Binary(string='Exception Attachment',attachment = True)
exception_start_date = fields.Datetime(string='Exception Start Date') exception_start_date = fields.Datetime(string='Exception Start Date')
exception_end_date = fields.Datetime(string='Exception End Date') exception_end_date = fields.Datetime(string='Exception End Date')

View File

@ -13,11 +13,13 @@
</group> </group>
<group> <group>
<group> <group>
<field name="exception_start_date" attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/> <field name="exception_start_date"
attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/>
<field name="exception_description"/> <field name="exception_description"/>
</group> </group>
<group> <group>
<field name="exception_end_date" attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/> <field name="exception_end_date"
attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/>
<field name="exception_attachment"/> <field name="exception_attachment"/>
</group> </group>
</group> </group>
@ -34,19 +36,21 @@
<field name="name">exception.member.wizard.form</field> <field name="name">exception.member.wizard.form</field>
<field name="model">exception.wizard</field> <field name="model">exception.wizard</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<sheet> <sheet>
<group> <group>
<field name="exception_type" required="1"/> <field name="exception_type" invisible="1"/>
<field name="exception_reason"/> <field name="exception_reason" required="1"/>
</group> </group>
<group> <group>
<group> <group>
<field name="exception_start_date" attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/> <field name="exception_start_date"
<field name="exception_description"/> attrs="{'invisible': [('exception_type','=','permanent_exception')],'required':[('exception_type','!=','permanent_exception')]}"/>
</group> <field name="exception_description" required="1"/>
</group>
<group> <group>
<field name="exception_end_date" attrs="{'invisible': [('exception_type','=','permanent_exception')]}"/> <field name="exception_end_date"
attrs="{'invisible': [('exception_type','=','permanent_exception')],'required':[('exception_type','!=','permanent_exception')]}"/>
<field name="exception_attachment"/> <field name="exception_attachment"/>
</group> </group>
</group> </group>
@ -56,7 +60,7 @@
<button special="cancel" string="Cancel"/> <button special="cancel" string="Cancel"/>
</footer> </footer>
</sheet> </sheet>
</form> </form>
</field> </field>
</record> </record>
</data> </data>