Merge branch 'dev_odex25_ensan' of https://github.com/expsa/odex25-standard-modules into parial_payment_donation
This commit is contained in:
commit
375fafbf4d
|
|
@ -1475,7 +1475,7 @@ msgstr "موافقة"
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__approve_date
|
||||
msgid "Approve Date"
|
||||
msgstr "تاريخ الموافقة"
|
||||
msgstr "تاريخ اعتماد الملف"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__approve_family
|
||||
|
|
@ -2685,15 +2685,19 @@ msgstr "المرتد"
|
|||
#: model:ir.model.fields,field_description:odex_benefit.field_changes_requests__researcher_branch_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_committees_line__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_res_districts__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__branch_custom_id
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_search
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_search
|
||||
msgid "Branch"
|
||||
msgstr "الفرع"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_custom_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_family_wizard__branch_custom_id
|
||||
msgid "Branch"
|
||||
msgstr "الفرع التشغيلي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:res.groups,name:odex_benefit.group_benefit_branch_manager
|
||||
msgid "Branch Manager"
|
||||
|
|
@ -2716,6 +2720,11 @@ msgstr "نوع الفرع"
|
|||
msgid "Branches"
|
||||
msgstr "فروع الرياض"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__branch_custom_ids
|
||||
msgid "Branches"
|
||||
msgstr "الفروع"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefits_representative__can_publish
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_external_benefits__can_publish
|
||||
|
|
@ -3479,6 +3488,7 @@ msgid "Create the Relation"
|
|||
msgstr "أنشاء ص قرابة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.actions.act_window,help:odex_benefit.service_request_account_action
|
||||
#: model_terms:ir.actions.act_window,help:odex_benefit.service_request_action
|
||||
msgid "Create the Service Request"
|
||||
msgstr ""
|
||||
|
|
@ -4177,7 +4187,6 @@ msgstr "تاريخ التوصيل"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model,name:odex_benefit.model_hr_department
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_family_wizard__branch_custom_id
|
||||
msgid "Department"
|
||||
msgstr "القسم"
|
||||
|
||||
|
|
@ -5017,11 +5026,6 @@ msgstr "خدمات استثنائية"
|
|||
msgid "Excluded from suspension?"
|
||||
msgstr "مستثنى من إيقاف الخدمة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__expense_type
|
||||
msgid "Expense Type"
|
||||
msgstr "نوع الاجراء"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_category__expenses_ids
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_need__expenses_ids
|
||||
|
|
@ -5203,11 +5207,6 @@ msgstr "ديون الأسرة"
|
|||
msgid "Family Domain"
|
||||
msgstr ""
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__expense_type__family_expense
|
||||
msgid "Family Expense"
|
||||
msgstr "مصروف التغذية الشهرية"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_expense.py:0
|
||||
#: code:addons/odex_benefit/wizards/family_expense_move_wiz.py:0
|
||||
|
|
@ -5792,7 +5791,6 @@ msgstr "تاريخ التخرج"
|
|||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_search
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_search
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -7863,11 +7861,6 @@ msgstr ""
|
|||
msgid "Meal Card"
|
||||
msgstr "بطاقة الغذاء"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__expense_type__family_invoice
|
||||
msgid "Meal Card Invoice"
|
||||
msgstr "فاتورة كرت الغذاء"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_family_validation_setting__meal_expense
|
||||
msgid "Meal Expense"
|
||||
|
|
@ -10571,8 +10564,10 @@ msgid "Services Attachments Settings"
|
|||
msgstr "المستندات المطلوبة للخدمة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.actions.act_window,name:odex_benefit.service_request_account_action
|
||||
#: model:ir.actions.act_window,name:odex_benefit.service_request_action
|
||||
#: model:ir.ui.menu,name:odex_benefit.services_requests_menu
|
||||
#: model:ir.ui.menu,name:odex_benefit.services_requests_account_menu
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.seasonal_service_form_view
|
||||
msgid "Services Requests"
|
||||
msgstr "طلبات الخدمات"
|
||||
|
|
@ -11578,13 +11573,11 @@ msgid "Total Monthly Meals"
|
|||
msgstr "إجمالي مصروف الغذاء للأسر"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__total_move_lines
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__total_move_lines
|
||||
msgid "Total Move Lines"
|
||||
msgstr "القيود اليومية"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__total_moves
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__total_moves
|
||||
msgid "Total Move"
|
||||
msgstr "القيود اليومية"
|
||||
|
|
@ -14445,7 +14438,6 @@ msgstr "أمر الصرف تم"
|
|||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.seasonal_service_form_view
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "Payment Done"
|
||||
msgstr "تم الدفع"
|
||||
|
||||
|
|
@ -16745,7 +16737,7 @@ msgstr "رقم الهوية %s موجود بالفعل في أسرة أخرى (
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_family_id
|
||||
msgid "Family Branch"
|
||||
msgstr "فرع الأسرة"
|
||||
msgstr "الفرع الأساسي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__branch_has_employees
|
||||
|
|
@ -16775,7 +16767,6 @@ msgstr "الحصول على دورة تأهيلية"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "Total Moves"
|
||||
msgstr "القيد المحاسبي"
|
||||
|
||||
|
|
@ -16876,6 +16867,7 @@ msgid "Payment Order State"
|
|||
msgstr "حالة أمر الدفع"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__move_state__none
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__payment_state__none
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__seasonal_service__payment_order_state__none
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__service_request__payment_order_state__none
|
||||
|
|
@ -16884,6 +16876,7 @@ msgid "None"
|
|||
msgstr "لا يوجد"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__move_state__waiting
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__payment_state__waiting
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__seasonal_service__payment_order_state__waiting
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__service_request__payment_order_state__waiting
|
||||
|
|
@ -16891,6 +16884,7 @@ msgid "Waiting Payment"
|
|||
msgstr "في انتظار الدفع"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__move_state__done
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__confirm_benefit_expense__payment_state__done
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__seasonal_service__payment_order_state__done
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__service_request__payment_order_state__done
|
||||
|
|
@ -16946,7 +16940,6 @@ msgstr "موافقة المسؤول"
|
|||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.seasonal_service_form_view
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "Payment Waiting"
|
||||
msgstr "في انتظار الدفع"
|
||||
|
||||
|
|
@ -17058,9 +17051,16 @@ msgstr "يرجى اختيار دفتر اليومية قبل إنشاء القي
|
|||
#: model_terms:ir.ui.view,arch_db:odex_benefit.payment_orders_tree
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_family_bank_report_wizard_form
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_family_bank_report_wizard__payment_order_ids
|
||||
#, python-format
|
||||
msgid "Payment Orders"
|
||||
msgstr "أوامر صرف الخدمات"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/family_expense.py:0
|
||||
#, python-format
|
||||
msgid "Payment Orders"
|
||||
msgstr "أوامر الصرف"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/family_bank_report_wizard.py:0
|
||||
#, python-format
|
||||
|
|
@ -17108,4 +17108,150 @@ msgstr "فواتير الموردين"
|
|||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
|
||||
msgid "Return to Family"
|
||||
msgstr "إرجاع للأسرة"
|
||||
msgstr "إرجاع للأسرة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__family_monthly_othaime
|
||||
msgid "Total Othaim"
|
||||
msgstr "إجمالي العثيم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__move_state
|
||||
msgid "Move State"
|
||||
msgstr "حالة الفاتورة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__family_count_expense
|
||||
msgid "Family Count (Monthly Expense)"
|
||||
msgstr "إجمالي عدد الأسر للمصروف الشهري"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__family_count_othaim
|
||||
msgid "Family Count (Othaim)"
|
||||
msgstr "إجمالي عدد الأسر للعثيم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__member_count_expense
|
||||
msgid "Member Count (Monthly Expense)"
|
||||
msgstr "إجمالي عدد الأفراد للمصروف الشهري"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__member_count_othaim
|
||||
msgid "Member Count (Othaim)"
|
||||
msgstr "إجمالي عدد الأفراد للعثيم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_expense_line__family_monthly_othaime
|
||||
msgid "Othaim Total Monthly"
|
||||
msgstr "إجمالي العثيم الشهري"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "<span class=\"o_stat_text\">Othaime Invoice</span>"
|
||||
msgstr "<span class=\"o_stat_text\">فاتورة العثيم</span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "<span class=\"o_stat_text\">Payment Orders</span>"
|
||||
msgstr "<span class=\"o_stat_text\">أوامر الصرف</span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid "Othaim Line"
|
||||
msgstr "مصروف العثيم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_confirm_benefit_expense__othaim_line_ids
|
||||
msgid "Othaim Lines"
|
||||
msgstr "مصروف العثيم"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Total Othaim</span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي العثيم</span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-users text-info\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Member Count (Othaim)</span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-users text-info\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي عدد الأفراد للعثيم</span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-home text-primary\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Family Count (Othaim)</span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-home text-primary\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي عدد الأسر للعثيم</span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-home text-primary\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Family Count (Monthly Expense)\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-home text-primary\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي عدد الأسر للمصروف الشهري\n"
|
||||
" </span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-users text-info\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Member Count (Monthly Expense)\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-users text-info\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي عدد الأفراد للمصروف الشهري\n"
|
||||
" </span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Total Monthly Income\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي المصروف النقدي للأسر\n"
|
||||
" </span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Total Monthly Meals\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي مصروف الغذاء للأسر\n"
|
||||
" </span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Total Monthly Clothing\n"
|
||||
" </span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-money text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">إجمالي مصروف الكساء للأسر\n"
|
||||
" </span>"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_confirm_benefit_expense_form
|
||||
msgid ""
|
||||
"<i class=\"fa fa-calculator text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">Total</span>"
|
||||
msgstr ""
|
||||
"<i class=\"fa fa-calculator text-success\" style=\"font-size: 20px; margin-bottom: 4px;\"/>\n"
|
||||
" <span style=\"font-size: 12px; color: #555;\">الإجمالي</span>"
|
||||
|
|
|
|||
|
|
@ -1476,7 +1476,8 @@ class GrantBenefitProfile(models.Model):
|
|||
rec.user_id.sudo().write({
|
||||
'groups_id': [(4, self.env.ref('base.group_portal', False).id)],
|
||||
})
|
||||
rec.approve_date = datetime.now()
|
||||
if rec.action_type == 'new':
|
||||
rec.approve_date = datetime.now()
|
||||
self.sudo().send_approval_benefit_email()
|
||||
partner_ids = []
|
||||
for id in self.message_follower_ids.ids:
|
||||
|
|
|
|||
|
|
@ -35,10 +35,6 @@ class ConfirmBenefitExpense(models.Model):
|
|||
('cancel', 'Cancelled'),
|
||||
('confirm', 'Confirmed'),
|
||||
], string='Status', default='draft', required=True, copy=False, tracking=True)
|
||||
expense_type = fields.Selection(selection=[
|
||||
('family_expense', 'Family Expense'),
|
||||
('family_invoice', 'Meal Card Invoice'),
|
||||
], string='Expense Type', default='family_expense', required=True)
|
||||
name = fields.Char(string="Name", states={'confirm': [('readonly', True)]}, copy=False)
|
||||
date = fields.Date(string="Date", default=fields.Date.context_today, required=False,
|
||||
states={'confirm': [('readonly', True)]})
|
||||
|
|
@ -51,19 +47,25 @@ class ConfirmBenefitExpense(models.Model):
|
|||
copy=False)
|
||||
benefit_expense_line_ids = fields.One2many(comodel_name='benefit.expense.line', inverse_name='confirm_expense_id',
|
||||
string='Benefit Expense Lines')
|
||||
cash_expense = fields.Boolean(string='Include Cash Expense', states={'confirm': [('readonly', True)]})
|
||||
meal_expense = fields.Boolean(string='Include Meal Expense', states={'confirm': [('readonly', True)]})
|
||||
cloth_expense = fields.Boolean(string='Include Clothing Expense', states={'confirm': [('readonly', True)]})
|
||||
othaim_line_ids = fields.One2many(comodel_name='benefit.expense.line', inverse_name='confirm_expense_id',
|
||||
string='Othaim Lines', domain=[('meal_card', '=', True)])
|
||||
cash_expense = fields.Boolean(string='Include Cash Expense', default=True, states={'confirm': [('readonly', True)]})
|
||||
meal_expense = fields.Boolean(string='Include Meal Expense', default=True, states={'confirm': [('readonly', True)]})
|
||||
cloth_expense = fields.Boolean(string='Include Clothing Expense', default=True,
|
||||
states={'confirm': [('readonly', True)]})
|
||||
payment_order_id = fields.Many2one('payment.orders', string='Payment Order', ondelete="set null", copy=False)
|
||||
move_id = fields.Many2one('account.move', ondelete='cascade')
|
||||
available_payment_method_line_ids = fields.Many2many(comodel_name='account.payment.method.line')
|
||||
total_moves = fields.Integer(string="Total Move", compute='_get_total_move_lines')
|
||||
total_move_lines = fields.Integer(string="Total Move Lines", compute='_get_total_move_lines')
|
||||
family_monthly_income = fields.Float(string="Total Monthly Income", compute='_get_family_monthly_values')
|
||||
family_monthly_meals = fields.Float(string="Total Monthly Meals", compute='_get_family_monthly_values')
|
||||
family_monthly_clotting = fields.Float(string="Total Monthly Clotting", compute='_get_family_monthly_values')
|
||||
family_monthly_total = fields.Float(string="Total", compute='_get_family_monthly_values')
|
||||
branch_custom_id = fields.Many2one(comodel_name='branch.settings', string="Branch")
|
||||
family_monthly_income = fields.Float(string="Total Monthly Income", compute='_get_family_monthly_values',
|
||||
store=True)
|
||||
family_monthly_meals = fields.Float(string="Total Monthly Meals", compute='_get_family_monthly_values', store=True)
|
||||
family_monthly_clotting = fields.Float(string="Total Monthly Clotting", compute='_get_family_monthly_values',
|
||||
store=True)
|
||||
family_monthly_othaime = fields.Float(string="Total Othaim", compute='_get_family_monthly_values', store=True)
|
||||
family_monthly_total = fields.Float(string="Total", compute='_get_family_monthly_values', store=True)
|
||||
branch_custom_ids = fields.Many2many(comodel_name='branch.settings', relation='confirm_benefit_expense_branch_rel',
|
||||
column1='expense_id', column2='branch_id', string="Branches",
|
||||
domain="[('has_employees', '=', True)]")
|
||||
family_domain_ids = fields.Many2many(comodel_name='grant.benefit', compute='_compute_domain_ids')
|
||||
company_id = fields.Many2one('res.company', default=lambda self: self.env.company)
|
||||
currency_id = fields.Many2one(comodel_name='res.currency', string="Company Currency",
|
||||
|
|
@ -71,25 +73,41 @@ class ConfirmBenefitExpense(models.Model):
|
|||
payment_state = fields.Selection(string='Payment State', selection=[
|
||||
('none', 'None'),
|
||||
('waiting', 'Waiting Payment'),
|
||||
('done', 'Done Payment'), ], copy=False, compute="_compute_payment_state", store=True)
|
||||
('done', 'Done Payment'), ], copy=False, compute="_compute_payment_move_state", store=True)
|
||||
move_state = fields.Selection(string='Move State', selection=[
|
||||
('none', 'None'),
|
||||
('waiting', 'Waiting Payment'),
|
||||
('done', 'Done Payment'), ], copy=False, compute="_compute_payment_move_state", store=True)
|
||||
family_count_expense = fields.Integer(string="Family Count (Monthly Expense)",
|
||||
compute='_get_family_monthly_values', store=True)
|
||||
|
||||
family_count_othaim = fields.Integer(string="Family Count (Othaim)", compute='_get_family_monthly_values',
|
||||
store=True)
|
||||
member_count_expense = fields.Integer(string="Member Count (Monthly Expense)", compute='_get_family_monthly_values',
|
||||
store=True, )
|
||||
|
||||
member_count_othaim = fields.Integer(string="Member Count (Othaim)", compute='_get_family_monthly_values',
|
||||
store=True, )
|
||||
|
||||
@api.depends('payment_order_id', 'payment_order_id.state', 'move_id', 'move_id.state')
|
||||
def _compute_payment_state(self):
|
||||
def _compute_payment_move_state(self):
|
||||
for rec in self:
|
||||
payment_state = 'none'
|
||||
move_state = 'none'
|
||||
if rec.payment_order_id:
|
||||
if rec.payment_order_id.state == "done":
|
||||
payment_state = "done"
|
||||
rec.state = "confirm"
|
||||
else:
|
||||
payment_state = "waiting"
|
||||
elif rec.move_id:
|
||||
if rec.move_id:
|
||||
if rec.move_id.state == "posted":
|
||||
payment_state = "done"
|
||||
rec.state = "confirm"
|
||||
move_state = "done"
|
||||
else:
|
||||
payment_state = "waiting"
|
||||
move_state = "waiting"
|
||||
rec.move_state = move_state
|
||||
rec.payment_state = payment_state
|
||||
if rec.move_state == 'done' and rec.payment_state == 'done':
|
||||
rec.state = 'confirm'
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
|
|
@ -104,12 +122,18 @@ class ConfirmBenefitExpense(models.Model):
|
|||
self.ensure_one()
|
||||
for line in self.benefit_expense_line_ids:
|
||||
family = line.family_id
|
||||
income, meals, clotting = 0, 0, 0
|
||||
income, meals, clotting, othaim = 0, 0, 0, 0
|
||||
if not family:
|
||||
continue
|
||||
monthly_meals = family.family_monthly_meals
|
||||
if self.expense_type == 'family_expense' and family.meal_card:
|
||||
monthly_meals = 0.0
|
||||
monthly_meals = 0.0 if family.meal_card else family.family_monthly_meals
|
||||
othaime = family.family_monthly_meals if family.meal_card else 0.0
|
||||
if self.cash_expense:
|
||||
income = family.family_monthly_income
|
||||
if self.meal_expense:
|
||||
meals = monthly_meals
|
||||
othaim = othaime
|
||||
if self.cloth_expense:
|
||||
clotting = family.family_monthly_clotting
|
||||
vals = {
|
||||
'branch_id': family.branch_custom_id.id,
|
||||
'family_category_id': family.benefit_category_id.id,
|
||||
|
|
@ -117,25 +141,11 @@ class ConfirmBenefitExpense(models.Model):
|
|||
'benefit_member_count': family.benefit_member_count,
|
||||
'start_date': self.start_date,
|
||||
'end_date': self.end_date,
|
||||
'family_monthly_income': income,
|
||||
'family_monthly_meals': meals,
|
||||
'family_monthly_clotting': clotting,
|
||||
'family_monthly_othaime': othaim,
|
||||
}
|
||||
if self.expense_type == 'family_expense':
|
||||
if self.cash_expense:
|
||||
income = family.family_monthly_income
|
||||
if self.meal_expense:
|
||||
meals = monthly_meals
|
||||
if self.cloth_expense:
|
||||
clotting = family.family_monthly_clotting
|
||||
vals.update({
|
||||
'family_monthly_income': income,
|
||||
'family_monthly_meals': meals,
|
||||
'family_monthly_clotting': clotting,
|
||||
})
|
||||
else:
|
||||
vals.update({
|
||||
'family_monthly_income': 0.0,
|
||||
'family_monthly_meals': monthly_meals,
|
||||
'family_monthly_clotting': 0.0,
|
||||
})
|
||||
line.write(vals)
|
||||
|
||||
def action_calculate(self):
|
||||
|
|
@ -147,9 +157,8 @@ class ConfirmBenefitExpense(models.Model):
|
|||
if not families:
|
||||
raise UserError(_("Please select at least one family to calculate."))
|
||||
|
||||
if rec.expense_type == 'family_expense':
|
||||
if not rec.cash_expense and not rec.meal_expense and not rec.cloth_expense:
|
||||
raise UserError(_("At least one expense type should be selected."))
|
||||
if not rec.cash_expense and not rec.meal_expense and not rec.cloth_expense:
|
||||
raise UserError(_("At least one expense type should be selected."))
|
||||
|
||||
rec.benefit_expense_line_ids.unlink()
|
||||
lines = []
|
||||
|
|
@ -172,45 +181,41 @@ class ConfirmBenefitExpense(models.Model):
|
|||
raise UserError(_("You can only recalculate when status is 'Calculated'."))
|
||||
rec._update_benefit_expense_lines()
|
||||
|
||||
@api.depends('expense_type', 'date', 'branch_custom_id', 'start_date', 'end_date')
|
||||
@api.depends('branch_custom_ids', 'start_date', 'end_date')
|
||||
def _compute_domain_ids(self):
|
||||
for rec in self:
|
||||
# Define base domain for family selection
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
base_domain = ['|', ('state', '=', 'second_approve'), '&',
|
||||
('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended')]
|
||||
if rec.branch_custom_id:
|
||||
base_domain.append(('branch_custom_id', '=', rec.branch_custom_id.id))
|
||||
if rec.branch_custom_ids:
|
||||
base_domain.append(('branch_custom_id', 'in', rec.branch_custom_ids.ids))
|
||||
min_income = validation_setting.benefit_category_ids.mapped('mini_income_amount')
|
||||
max_income = validation_setting.benefit_category_ids.mapped('max_income_amount')
|
||||
base_domain.extend([('member_income', '>=', min(min_income)), ('member_income', '<=', max(max_income))])
|
||||
base_domain.extend([('benefit_category_id', '!=', False)])
|
||||
if rec.expense_type == 'family_invoice':
|
||||
base_domain.append(('meal_card', '=', True))
|
||||
|
||||
# if rec.date:
|
||||
if rec.start_date and rec.end_date:
|
||||
# Calculate the start date for the past month range
|
||||
# month_ago = rec.date - relativedelta(months=1)
|
||||
|
||||
# Search for conflicting records of the same expense type within the past month
|
||||
conflicting_records = self.search([
|
||||
('id', '!=', rec._origin.id),
|
||||
('start_date', '<=', rec.end_date),
|
||||
('end_date', '>=', rec.start_date),
|
||||
('expense_type', '=', rec.expense_type),
|
||||
])
|
||||
|
||||
if conflicting_records:
|
||||
# Gather the family IDs that are already associated with the same expense type
|
||||
conflicting_family_ids = conflicting_records.mapped('family_ids').ids
|
||||
base_domain.append(('id', 'not in', conflicting_family_ids))
|
||||
|
||||
rec.family_domain_ids = self.env['grant.benefit'].search(base_domain)
|
||||
|
||||
@api.onchange('branch_custom_id')
|
||||
def _onchange_branch_custom_id(self):
|
||||
if self.branch_custom_id:
|
||||
@api.onchange('branch_custom_ids')
|
||||
def _onchange_branch_custom_ids(self):
|
||||
if self.branch_custom_ids:
|
||||
allowed_families = self.env['grant.benefit'].search([
|
||||
('id', 'in', self.family_ids.ids),
|
||||
('branch_custom_id', 'in', self.branch_custom_ids.ids),
|
||||
])
|
||||
self.family_ids = [(6, 0, allowed_families.ids)]
|
||||
else:
|
||||
self.family_ids = [(5, 0, 0)]
|
||||
|
||||
def unlink(self):
|
||||
|
|
@ -222,30 +227,28 @@ class ConfirmBenefitExpense(models.Model):
|
|||
@api.depends('benefit_expense_line_ids')
|
||||
def _get_family_monthly_values(self):
|
||||
for rec in self:
|
||||
rec.family_monthly_income = sum(rec.benefit_expense_line_ids.mapped('family_monthly_income'))
|
||||
rec.family_monthly_meals = sum(rec.benefit_expense_line_ids.mapped('family_monthly_meals'))
|
||||
rec.family_monthly_clotting = sum(rec.benefit_expense_line_ids.mapped('family_monthly_clotting'))
|
||||
lines = rec.benefit_expense_line_ids
|
||||
rec.family_monthly_income = sum(lines.mapped('family_monthly_income'))
|
||||
rec.family_monthly_meals = sum(lines.mapped('family_monthly_meals'))
|
||||
rec.family_monthly_clotting = sum(lines.mapped('family_monthly_clotting'))
|
||||
rec.family_monthly_othaime = sum(lines.mapped('family_monthly_othaime'))
|
||||
rec.family_monthly_total = rec.family_monthly_income + rec.family_monthly_meals + rec.family_monthly_clotting
|
||||
|
||||
expense_lines = lines.filtered(lambda l: not l.meal_card)
|
||||
othaim_lines = lines.filtered('meal_card')
|
||||
rec.family_count_expense = len(expense_lines.mapped('family_id'))
|
||||
rec.member_count_expense = sum(expense_lines.mapped('benefit_member_count'))
|
||||
|
||||
rec.family_count_othaim = len(othaim_lines.mapped('family_id'))
|
||||
rec.member_count_othaim = sum(othaim_lines.mapped('benefit_member_count'))
|
||||
|
||||
def action_assistant_manager(self):
|
||||
if self.expense_type != 'family_expense':
|
||||
self.state = 'assistant_general_manager'
|
||||
return
|
||||
|
||||
disbursement_date = False
|
||||
# if not disbursement_date:
|
||||
last_expense = self.search(
|
||||
[("state", "=", "confirm"), ("end_date", "!=", False)],
|
||||
order="id desc",
|
||||
limit=1
|
||||
)
|
||||
if last_expense:
|
||||
disbursement_date = last_expense.end_date
|
||||
|
||||
# Apply the disbursement date to all families
|
||||
if disbursement_date:
|
||||
for family in self.family_ids:
|
||||
family.last_disbursement_date = disbursement_date
|
||||
for family in self.family_ids:
|
||||
if self.end_date and family.last_disbursement_date:
|
||||
if self.end_date > family.last_disbursement_date:
|
||||
family.last_disbursement_date = self.end_date
|
||||
else:
|
||||
family.last_disbursement_date = self.end_date
|
||||
|
||||
self.state = 'assistant_general_manager'
|
||||
|
||||
|
|
@ -256,28 +259,13 @@ class ConfirmBenefitExpense(models.Model):
|
|||
self.state = 'cancel'
|
||||
|
||||
def action_reset_to_draft(self):
|
||||
self.benefit_expense_line_ids.unlink()
|
||||
self.payment_order_id.unlink()
|
||||
self.move_id.unlink()
|
||||
self.benefit_expense_line_ids.unlink()
|
||||
self.state = 'draft'
|
||||
|
||||
def _get_total_move_lines(self):
|
||||
for rec in self:
|
||||
if self.expense_type == 'family_expense':
|
||||
moves = self.payment_order_id.move_id
|
||||
else:
|
||||
moves = self.move_id
|
||||
|
||||
rec.total_moves = len(moves)
|
||||
rec.total_move_lines = len(moves.mapped('line_ids'))
|
||||
|
||||
def action_open_related_move_records(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
if self.expense_type == 'family_expense':
|
||||
moves = self.payment_order_id.move_id.ids
|
||||
else:
|
||||
moves = self.move_id.ids
|
||||
|
||||
moves = self.move_id.ids
|
||||
return {
|
||||
'name': _('Vendor Bills'),
|
||||
'type': 'ir.actions.act_window',
|
||||
|
|
@ -286,63 +274,77 @@ class ConfirmBenefitExpense(models.Model):
|
|||
'domain': [('id', 'in', moves)],
|
||||
}
|
||||
|
||||
def action_open_related_payment_orders(self):
|
||||
payment_orders = self.payment_order_id.ids
|
||||
return {
|
||||
'name': _('Payment Orders'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'payment.orders',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': [('id', 'in', payment_orders)],
|
||||
}
|
||||
|
||||
def action_accounting_transfer(self):
|
||||
for rec in self:
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
lines = rec.benefit_expense_line_ids
|
||||
if not lines:
|
||||
raise UserError(_("Please make sure you have benefit expense lines."))
|
||||
if rec.expense_type == 'family_expense':
|
||||
families = lines.mapped('family_id')
|
||||
invalid_families = families.filtered(
|
||||
lambda f: f.state != 'second_approve'
|
||||
or (f.state in ('waiting_approve', 'first_approve') and f.action_type == 'suspended')
|
||||
)
|
||||
if invalid_families:
|
||||
raise UserError(_(
|
||||
"Some selected benefits are not in valid state or are suspended:\n%s"
|
||||
) % ", ".join(invalid_families.mapped('name')))
|
||||
|
||||
if not validation_setting.cash_expense_account_id or not validation_setting.meal_expense_account_id or not validation_setting.clothing_expense_account_id:
|
||||
raise UserError(_("Please configure the expense accounts in the validation settings."))
|
||||
families = lines.mapped('family_id')
|
||||
invalid_families = families.filtered(
|
||||
lambda f: f.state != 'second_approve'
|
||||
or (f.state in ('waiting_approve', 'first_approve') and f.action_type == 'suspended')
|
||||
)
|
||||
if invalid_families:
|
||||
raise UserError(_(
|
||||
"Some selected benefits are not in valid state or are suspended:\n%s"
|
||||
) % ", ".join(invalid_families.mapped('name')))
|
||||
|
||||
credit_account_id = validation_setting.account_id.id
|
||||
if not validation_setting.cash_expense_account_id or not validation_setting.meal_expense_account_id or not validation_setting.clothing_expense_account_id:
|
||||
raise UserError(_("Please configure the expense accounts in the validation settings."))
|
||||
|
||||
if not credit_account_id:
|
||||
raise UserError(_("Please select credit account."))
|
||||
credit_account_id = validation_setting.account_id.id
|
||||
|
||||
payment_order = self.env['payment.orders'].create({
|
||||
'state': 'draft',
|
||||
'accountant_id': validation_setting.accountant_id.id,
|
||||
'benefit_expense_line_ids': [(6, 0, rec.benefit_expense_line_ids.ids)],
|
||||
'type': 'benefit_expense',
|
||||
})
|
||||
rec.payment_order_id = payment_order
|
||||
else:
|
||||
account_id = validation_setting.meal_expense_account_id
|
||||
invoice_lines = []
|
||||
for line in lines:
|
||||
family = line.family_id
|
||||
invoice_lines.append((0, 0, {
|
||||
'name': f'{family.name}/{family.code}',
|
||||
'account_id': account_id.id,
|
||||
'quantity': 1,
|
||||
'benefit_family_id': family.id,
|
||||
'price_unit': line.family_monthly_meals,
|
||||
'analytic_account_id': family.branch_family_id.branch.analytic_account_id.id
|
||||
}))
|
||||
invoice_vals = {
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': validation_setting.meal_partner_id.id,
|
||||
'invoice_date': rec.date,
|
||||
'family_confirm_id': rec.id,
|
||||
'benefit_family_ids': [(6, 0, rec.benefit_expense_line_ids.mapped('family_id').ids)],
|
||||
'journal_id': validation_setting.journal_id.id,
|
||||
'invoice_line_ids': invoice_lines,
|
||||
'ref': rec.name,
|
||||
}
|
||||
if not credit_account_id:
|
||||
raise UserError(_("Please select credit account."))
|
||||
|
||||
invoice = self.env['account.move'].create(invoice_vals)
|
||||
rec.move_id = invoice
|
||||
# todo if have paymnet or move dont create again
|
||||
|
||||
# Create Payment Order for Benefit Expense
|
||||
payment_order = self.env['payment.orders'].create({
|
||||
'state': 'draft',
|
||||
'accountant_id': validation_setting.accountant_id.id,
|
||||
'benefit_expense_line_ids': [(6, 0, rec.benefit_expense_line_ids.ids)],
|
||||
'type': 'benefit_expense',
|
||||
})
|
||||
rec.payment_order_id = payment_order
|
||||
|
||||
# Create Vendor Bill for Meal Card Invoice(othaime)
|
||||
account_id = validation_setting.meal_expense_account_id
|
||||
invoice_lines = []
|
||||
for line in lines.filtered(lambda l: l.meal_card):
|
||||
family = line.family_id
|
||||
invoice_lines.append((0, 0, {
|
||||
'name': f'{family.name}/{family.code}',
|
||||
'account_id': account_id.id,
|
||||
'quantity': 1,
|
||||
'benefit_family_id': family.id,
|
||||
'price_unit': line.family_monthly_othaime,
|
||||
'analytic_account_id': family.branch_family_id.branch.analytic_account_id.id
|
||||
}))
|
||||
invoice_vals = {
|
||||
'move_type': 'in_invoice',
|
||||
'partner_id': validation_setting.meal_partner_id.id,
|
||||
'invoice_date': rec.date,
|
||||
'family_confirm_id': rec.id,
|
||||
'benefit_family_ids': [(6, 0, rec.benefit_expense_line_ids.mapped('family_id').ids)],
|
||||
'journal_id': validation_setting.journal_id.id,
|
||||
'invoice_line_ids': invoice_lines,
|
||||
'ref': rec.name,
|
||||
}
|
||||
|
||||
invoice = self.env['account.move'].create(invoice_vals)
|
||||
rec.move_id = invoice
|
||||
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class BenefitExpenseLine(models.Model):
|
|||
family_monthly_income = fields.Float(string="Family Monthly Income")
|
||||
family_monthly_meals = fields.Float(string="Family Monthly Meals")
|
||||
family_monthly_clotting = fields.Float(string="Family Monthly Clotting")
|
||||
family_monthly_othaime = fields.Float(string="Othaim Total Monthly")
|
||||
total_family_expenses = fields.Float(string="Total Family Expenses", compute='_compute_total_family_expenses')
|
||||
start_date = fields.Date(string='Start Date', )
|
||||
end_date = fields.Date(string='End Date', )
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class SeasonalService(models.Model):
|
|||
string="Seasonal Service Type", required=True)
|
||||
benefit_type = fields.Selection(string='Benefit Type', related='service_type_id.benefit_type')
|
||||
branch_ids = fields.Many2many('branch.settings', 'service_branch_rel', 'service_id', 'branch_id', string='Branches',
|
||||
required=True)
|
||||
required=True, domain="[('has_employees', '=', True)]")
|
||||
family_category_ids = fields.Many2many(
|
||||
'benefit.category',
|
||||
'service_category_rel',
|
||||
|
|
|
|||
|
|
@ -890,6 +890,7 @@ class ServiceRequest(models.Model):
|
|||
rec.service_max_amount = rec.service_cat.fatherless_member_amount
|
||||
if rec.is_orphan:
|
||||
rec.service_max_amount = rec.service_cat.orphan_member_amount
|
||||
rec.requested_service_amount = rec.service_max_amount
|
||||
if rec.member_age > rec.service_cat.max_age:
|
||||
raise ValidationError(_("Member Age should be less than %s ") % rec.service_cat.max_age)
|
||||
if rec.member_payroll > rec.service_cat.member_max_payroll:
|
||||
|
|
|
|||
|
|
@ -546,6 +546,16 @@
|
|||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record id="service_request_account_action" model="ir.actions.act_window">
|
||||
<field name="name">Services Requests</field>
|
||||
<field name="res_model">service.request</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('is_seasonal','=',False),('state','=','accounting_approve'),('payment_order_state','=','none')]</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">Create the Service Request
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="benefit_need_action">
|
||||
<field name="name">Benefit Need</field>
|
||||
<field name="res_model">benefit.need</field>
|
||||
|
|
@ -993,6 +1003,8 @@
|
|||
parent="odex_benefit.benefit_tools_services_settings_menu" action="services_settings_action" groups="odex_benefit.group_benefit_manager"/>
|
||||
<menuitem id="services_requests_menu" name="Services Requests" sequence="2"
|
||||
parent="odex_benefit.benefit_services" action="service_request_action"/>
|
||||
<menuitem id="services_requests_account_menu" name="Services Requests" sequence="9"
|
||||
parent="account.menu_finance_payables" action="service_request_account_action"/>
|
||||
|
||||
<!-- <menuitem id="family_member_main_menu" name="Family Members"-->
|
||||
<!-- parent="benefits_root_menu" sequence="2"/>-->
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@
|
|||
force_save="1"/>
|
||||
<field name="last_visit_date" readonly="1"/>
|
||||
<field name="city_id"
|
||||
readonly="1"
|
||||
invisible="1"
|
||||
string="City" options="{'no_create': True, 'no_create_edit': True}"
|
||||
groups="!odex_benefit.group_benefit_manager"/>
|
||||
<field name="branch_custom_id"
|
||||
|
|
@ -539,6 +539,7 @@
|
|||
options="{'currency_field': 'currency_id'}" readonly="1" force_save="1"/>
|
||||
<field name="benefit_category_id" readonly="1" force_save="1"/>
|
||||
<field name="benefit_category_old"/>
|
||||
<field name="approve_date" readonly="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="mother_family_member_id" invisible="1" readonly="1"/>
|
||||
|
|
@ -1787,7 +1788,7 @@
|
|||
|
||||
|
||||
<xpath expr="//field[@name='city_id']" position="replace">
|
||||
<field name="city_id" readonly="1"/>
|
||||
<field name="city_id" invisible="1"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='branch_custom_id']" position="replace">
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
<field name="family_monthly_income"/>
|
||||
<field name="family_monthly_meals"/>
|
||||
<field name="family_monthly_clotting"/>
|
||||
<field name="family_monthly_othaime"/>
|
||||
<field name="total_family_expenses"/>
|
||||
<field name="payment_order_id" invisible="1"/>
|
||||
</tree>
|
||||
|
|
@ -43,6 +44,7 @@
|
|||
<field name="family_monthly_meals"/>
|
||||
<field name="family_monthly_clotting"/>
|
||||
<field name="total_family_expenses" readonly="1"/>
|
||||
<field name="family_monthly_othaime"/>
|
||||
</group>
|
||||
</group>
|
||||
<group invisible="1">
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
<field name="family_expense_seq"/>
|
||||
<field name="date"/>
|
||||
<field name="name" string="Description"/>
|
||||
<field name="expense_type"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="currency_id" invisible="1" groups="base.group_multi_currency"/>
|
||||
<field name="family_monthly_total" decoration-bf="1" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="family_monthly_othaime" decoration-bf="1" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-info="state in ['draft','calculated']"
|
||||
decoration-warning="state in ['assistant_general_manager']"
|
||||
|
|
@ -26,6 +26,11 @@
|
|||
decoration-warning="payment_state == 'waiting'"
|
||||
decoration-success="payment_state == 'done'"
|
||||
/>
|
||||
<field name="move_state"
|
||||
widget="badge"
|
||||
decoration-success="move_state == 'done'"
|
||||
decoration-warning="move_state == 'waiting'"
|
||||
decoration-muted="move_state == 'none'"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -59,25 +64,44 @@
|
|||
|
||||
<button string="Accounting Transfer" type="object" name="action_accounting_transfer"
|
||||
class="oe_highlight"
|
||||
attrs="{'invisible': ['|','|',('state', '!=', 'accounting_approve'),'&',('payment_order_id','!=',False),('expense_type','=','family_expense'),'&',('move_id','!=',False),('expense_type','=','family_invoice')]}"
|
||||
attrs="{'invisible': ['|','|',('state', '!=', 'accounting_approve'),('payment_order_id','!=',False),('move_id','!=',False)]}"
|
||||
/>
|
||||
<button string="Reset" type="object" name="action_reset_to_draft" class="btn btn-danger"
|
||||
states="accounting_approve"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_open_related_payment_orders"
|
||||
class="oe_stat_button"
|
||||
icon="fa-file-text-o"
|
||||
type="object" attrs="{'invisible': [('payment_order_id', '=', False)]}">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Payment Orders</span>
|
||||
<span class="o_stat_value">
|
||||
<field name="payment_state"
|
||||
widget="badge"
|
||||
decoration-success="payment_state == 'done'"
|
||||
decoration-warning="payment_state == 'waiting'"
|
||||
decoration-muted="payment_state == 'none'"/>
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
<button name="action_open_related_move_records"
|
||||
class="oe_stat_button"
|
||||
icon="fa-file-text-o"
|
||||
type="object" attrs="{'invisible': [('total_moves', '=', 0)]}">
|
||||
<field name="total_moves" widget="statinfo" string="Total Moves"/>
|
||||
type="object" attrs="{'invisible': [('move_id', '=', False)]}">
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Othaime Invoice</span>
|
||||
<span class="o_stat_value">
|
||||
<field name="move_state"
|
||||
widget="badge"
|
||||
decoration-success="move_state == 'done'"
|
||||
decoration-warning="move_state == 'waiting'"
|
||||
decoration-muted="move_state == 'none'"/>
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<field name="payment_state" invisible="1"/>
|
||||
<widget name="web_ribbon" title="Payment Done" bg_color="bg-success"
|
||||
attrs="{'invisible': [('payment_state', '!=', 'done')]}"/>
|
||||
<widget name="web_ribbon" title="Payment Waiting" bg_color="bg-warning"
|
||||
attrs="{'invisible': [('payment_state', '!=', 'waiting')]}"/>
|
||||
<field name="family_domain_ids" widget="many2many_tags" invisible="1"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
|
|
@ -97,52 +121,127 @@
|
|||
<field name="end_date"
|
||||
attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
</div>
|
||||
<field name="branch_custom_id" required="1"
|
||||
attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<!-- <field name="payment_method_id" attrs="{'invisible': [('expense_type', '=', 'family_invoice')],'required': [('expense_type', '=', 'family_expense')]}"/>-->
|
||||
<field name="branch_custom_ids" required="1"
|
||||
widget="many2many_tags" attrs="{'readonly':[('state', '!=', 'draft')]}"
|
||||
/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="expense_type" required="1" attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="date" required="1" attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="payment_order_id" readonly="1"
|
||||
attrs="{'invisible': [('payment_order_id', '=', False)]}"/>
|
||||
<field name="payment_order_id" invisible="1"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- Conditional fields based on expense_type -->
|
||||
<group>
|
||||
<group>
|
||||
<field name="available_payment_method_line_ids" invisible="1"/>
|
||||
<field name="cash_expense"
|
||||
attrs="{'invisible': [('expense_type', '=', 'family_invoice')], 'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="meal_expense"
|
||||
attrs="{'invisible': [('expense_type', '=', 'family_invoice')], 'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="cloth_expense"
|
||||
attrs="{'invisible': [('expense_type', '=', 'family_invoice')], 'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="cash_expense" widget="boolean_toggle"
|
||||
attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="meal_expense" widget="boolean_toggle"
|
||||
attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="cloth_expense" widget="boolean_toggle"
|
||||
attrs="{'readonly':[('state', '!=', 'draft')]}"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="currency_id" invisible="1" groups="base.group_multi_currency"/>
|
||||
<field name="family_monthly_income" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
attrs="{'invisible': ['|',('expense_type', '=', 'family_invoice'),('cash_expense', '=', False)]}"/>
|
||||
<field name="family_monthly_meals" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
attrs="{'invisible': [('expense_type', '=', 'family_expense'),('meal_expense', '=', False)]}"/>
|
||||
<field name="family_monthly_clotting" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
attrs="{'invisible': ['|',('expense_type', '=', 'family_invoice'),('cloth_expense', '=', False)]}"/>
|
||||
<field name="family_monthly_total" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
|
||||
<field name="available_payment_method_line_ids" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<!-- Notebook with Families page -->
|
||||
<notebook>
|
||||
<page string="Family Monthly Expense" attrs="{'invisible': [('state', '=', 'draft')]}">
|
||||
<div class="row mb-2">
|
||||
<!-- Family Count (Monthly Expense) -->
|
||||
<div class="col-6">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e3f2fd; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-home text-primary"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Family Count (Monthly Expense)
|
||||
</span>
|
||||
<span class="badge badge-primary"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_count_expense"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Member Count (Monthly Expense) -->
|
||||
<div class="col-6">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e0f7fa; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-users text-info" style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Member Count (Monthly Expense)
|
||||
</span>
|
||||
<span class="badge badge-info"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="member_count_expense"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-12">
|
||||
<div class="row text-center">
|
||||
<div class="col-3">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e3f2fd; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-money text-success"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Total Monthly Income
|
||||
</span>
|
||||
<span class="badge badge-primary"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_monthly_income" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Monthly Meals -->
|
||||
<div class="col-3">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #fff3e0; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-money text-success"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Total Monthly Meals
|
||||
</span>
|
||||
<span class="badge badge-warning"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_monthly_meals" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Monthly Clothing -->
|
||||
<div class="col-3">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e0f7fa; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-money text-success"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Total Monthly Clothing
|
||||
</span>
|
||||
<span class="badge badge-info"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_monthly_clotting" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Monthly Total -->
|
||||
<div class="col-3">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e8f7ef;padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-calculator text-success"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Total</span>
|
||||
<span class="badge badge-success"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_monthly_total" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<field name="benefit_expense_line_ids" readonly="1">
|
||||
<tree editable="bottom">
|
||||
<tree>
|
||||
<field name="family_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="family_category_id"/>
|
||||
|
|
@ -161,9 +260,93 @@
|
|||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Othaim Line"
|
||||
attrs="{'invisible': ['|',('state', '=', 'draft'),('meal_expense', '=', False)]}">
|
||||
<div class="row mb-2">
|
||||
<!-- Family Count -->
|
||||
<div class="col-4">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e3f2fd; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-home text-primary"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Family Count (Othaim)</span>
|
||||
<span class="badge badge-primary"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_count_othaim"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Member Count -->
|
||||
<div class="col-4">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e0f7fa; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-users text-info" style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Member Count (Othaim)</span>
|
||||
<span class="badge badge-info"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="member_count_othaim"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Total Othaim -->
|
||||
<div class="col-4">
|
||||
<div class="d-flex flex-column align-items-center"
|
||||
style="background-color: #e8f5e9; padding: 8px; border-radius: 8px;">
|
||||
<i class="fa fa-money text-success"
|
||||
style="font-size: 20px; margin-bottom: 4px;"/>
|
||||
<span style="font-size: 12px; color: #555;">Total Othaim</span>
|
||||
<span class="badge badge-success"
|
||||
style="font-size: 14px; padding: 4px 8px; margin-top: 3px; border-radius: 8px;">
|
||||
<field name="family_monthly_othaime" widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<field name="othaim_line_ids" readonly="1">
|
||||
<tree>
|
||||
<field name="family_id"/>
|
||||
<field name="branch_id"/>
|
||||
<field name="family_category_id"/>
|
||||
<field name="start_date" invisible="1"/>
|
||||
<field name="end_date" invisible="1"/>
|
||||
<field name="meal_card"/>
|
||||
<field name="benefit_member_count"/>
|
||||
<field name="family_monthly_othaime"/>
|
||||
<field name="payment_order_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Families">
|
||||
<field name="family_ids" attrs="{'readonly':[('state', '!=', 'draft')]}"
|
||||
domain="[('id', 'in', family_domain_ids)]"/>
|
||||
domain="[('id', 'in', family_domain_ids)]">
|
||||
<tree>
|
||||
<field name="code" decoration-bf="1"/>
|
||||
<field name="benefit_partner_name"/>
|
||||
<field name="benefit_category_id"/>
|
||||
<field name="create_date" optional="hide"/>
|
||||
<field name="meal_card"/>
|
||||
<field name="father_id_number" optional="hide"/>
|
||||
<field name="sms_phone"/>
|
||||
<field name="benefit_member_count"/>
|
||||
<field name="non_member_count" optional="hide"/>
|
||||
<field name="researcher_id"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="district_id"/>
|
||||
<field name="last_visit_date" optional="hide"/>
|
||||
<field name="acc_number" optional="hide"/>
|
||||
<field name="family_member_id" optional="hide"/>
|
||||
<field name="acc_holder_name" optional="hide"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state in ['first_approve', 'second_approve']"
|
||||
decoration-muted="state in ['draft','new']"
|
||||
decoration-danger="state in ['refused','suspended_second_approve']"
|
||||
decoration-warning="state in ['first_refusal','waiting_approve']"
|
||||
decoration-info="state not in ('waiting_approve','draft','new','first_approve', 'second_approve','first_refusal','refused','suspended_second_approve')"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
|
@ -182,9 +365,6 @@
|
|||
<field name="model">confirm.benefit.expense</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<group string="Group By">
|
||||
<filter string="Branch" name="branch_custom_id" context="{'group_by': 'branch_custom_id'}"/>
|
||||
</group>
|
||||
<separator/>
|
||||
<filter string="Draft" name="draft" domain="[('state','=','draft')]"/>
|
||||
<separator/>
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@
|
|||
font-size:14px;
|
||||
">
|
||||
<i class="fa fa-file-text-o"
|
||||
style="color:#198754; font-size:14px;"></i>
|
||||
style="color:#198754; font-size:14px;"/>
|
||||
</div>
|
||||
|
||||
<div style="display:flex; flex-direction:column; line-height:1;">
|
||||
|
|
@ -618,7 +618,7 @@
|
|||
</span>
|
||||
</t>
|
||||
<i class="fa fa-chevron-left"
|
||||
style="color:#9aa5a0; font-size:12px;"></i>
|
||||
style="color:#9aa5a0; font-size:12px;"/>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -55,8 +55,10 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
researcher_team = fields.Many2one("committees.line", string="Researcher Team",
|
||||
domain="[('branch_custom_id', '=',branch_custom_id)]")
|
||||
benefit_id = fields.Many2one("grant.benefit", string="Benefit", default=_default_benefit)
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Department", default=_default_branch_custom_id)
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch',related="benefit_id.branch_has_employees")
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Branch",
|
||||
domain="[('has_employees', '=', True)]",
|
||||
default=_default_branch_custom_id)
|
||||
branch_has_employees = fields.Boolean('Has Employees In branch', related="benefit_id.branch_has_employees")
|
||||
is_submitted = fields.Boolean(string="Submitted", default=False)
|
||||
|
||||
def submit_family(self):
|
||||
|
|
@ -65,7 +67,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
'state': 'complete_info',
|
||||
'contact_type': 'sms',
|
||||
'researcher_id': rec.researcher_team.id,
|
||||
'branch_custom_id':rec.branch_custom_id.id,
|
||||
'branch_custom_id': rec.branch_custom_id.id,
|
||||
})
|
||||
visit_record = self.env['visit.location'].create({
|
||||
'benefit_id': rec.benefit_id.id,
|
||||
|
|
@ -80,7 +82,8 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
rec._send_assignment_notification(visit_record)
|
||||
specialist_name = rec.researcher_team.name or _('Not Specified')
|
||||
visit_number = visit_record.name or str(visit_record.id)
|
||||
message = _('File has been assigned to specialist "%s" and initial visit created with number "%s"') % (specialist_name, visit_number)
|
||||
message = _('File has been assigned to specialist "%s" and initial visit created with number "%s"') % (
|
||||
specialist_name, visit_number)
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
|
|
@ -135,7 +138,8 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
'email_to': specialist_user.work_email or specialist_user.email,
|
||||
'email_cc': self.env.user.company_id.hr_email or self.env.user.company_id.email,
|
||||
})
|
||||
template.with_context(lang=self.env.user.lang).send_mail(visit_record.id, force_send=True, raise_exception=False)
|
||||
template.with_context(lang=self.env.user.lang).send_mail(visit_record.id, force_send=True,
|
||||
raise_exception=False)
|
||||
|
||||
except Exception as e:
|
||||
self._send_in_system_notification(specialist_user, visit_record)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class DonationsDetailsLines(models.Model):
|
|||
family_domain_ids = fields.Many2many('grant.benefit', compute='_compute_family_domain_ids')
|
||||
benefit_id = fields.Many2one('family.member', string='Beneficiary Name', ondelete='restrict', domain="[('id', 'in', members_domain_ids)]", tracking=True)
|
||||
family_id = fields.Many2one('grant.benefit', string='Family', ondelete='restrict', domain="[('id', 'in', family_domain_ids)]", tracking=True)
|
||||
benefit_ids = fields.Many2many('family.member', string='Beneficiaries Names', tracking=True, domain="[('id', 'in', members_domain_ids)]")
|
||||
benefit_ids = fields.Many2many('family.member', string='Beneficiaries Names', tracking=True, domain="[('id', 'in', members_domain_ids) , ('age' , '<' , ages)]")
|
||||
sponsorship_duration = fields.Selection([('temporary', 'Temporary'), ('permanent', 'Permanent')],
|
||||
string='Sponsorship Type', default="temporary")
|
||||
start_date = fields.Date(string="Sponsorship Start Date", copy=False, default=fields.Date.today())
|
||||
|
|
@ -98,6 +98,7 @@ class DonationsDetailsLines(models.Model):
|
|||
debit_payment_attachment_file_name = fields.Char('Debit Payment File Name', required=False)
|
||||
journal_id = fields.Many2one('account.journal', string="Journal",domain="[('type','=','bank')]",default=_default_journal_id)
|
||||
benefit_status = fields.Selection(related='benefit_id.member_status')
|
||||
ages = fields.Integer(compute='_compute_get_age_range' , store=True)
|
||||
# cheque_number = fields.Integer(string="Cheque Number")
|
||||
# cheque_due_date = fields.Date(string="Cheque Due Date")
|
||||
# cheque_file_attachment = fields.Binary(string='Cheque Attachment', attachment=True)
|
||||
|
|
@ -106,6 +107,32 @@ class DonationsDetailsLines(models.Model):
|
|||
# bank_transfer_attachment_file_name = fields.Char('Bank Transfer File Name', required=False)
|
||||
|
||||
|
||||
@api.depends('sponsorship_duration' , 'product_template_id' , 'payment_month_count' , 'direct_debit')
|
||||
def _compute_get_age_range(self):
|
||||
for rec in self:
|
||||
x = []
|
||||
branch_id = rec.branch_custom_id.id
|
||||
records = self.env['donations.details.lines'].search(['|' , ('state', '=', 'replace') , ('state', '=', 'waiting') ])
|
||||
filtered_records = records.filtered(lambda r: r.sponsorship_mechanism_id.branch_custom_id.id == branch_id)
|
||||
|
||||
for record in filtered_records:
|
||||
if record.sponsorship_duration == 'permanent' :
|
||||
x.append(1)
|
||||
elif record.sponsorship_duration != 'permanent' and record.payment_month_count < 6 and record.direct_debit :
|
||||
x.append(16)
|
||||
elif record.sponsorship_duration != 'permanent' and record.payment_month_count >= 6 :
|
||||
x.append(1)
|
||||
elif record.sponsorship_duration != 'permanent' and record.payment_month_count < 6 :
|
||||
x.append(18)
|
||||
|
||||
|
||||
if len(x) > 0 :
|
||||
lowest_value = min(x) if x else None
|
||||
else:
|
||||
lowest_value = 100
|
||||
|
||||
rec.ages = lowest_value
|
||||
|
||||
@api.depends('extension_history_ids')
|
||||
def _compute_extension_count(self):
|
||||
for rec in self:
|
||||
|
|
@ -480,6 +507,7 @@ class DonationsDetailsLines(models.Model):
|
|||
parent_record = self.env['takaful.sponsorship'].browse(parent_id)
|
||||
|
||||
res['sponsorship_creation_date'] = parent_record.sponsorship_creation_date
|
||||
res['branch_custom_id'] = parent_record.branch_custom_id
|
||||
# res['donation_mechanism'] = parent_record.donation_mechanism
|
||||
|
||||
self._onchange_sponsorship_type()
|
||||
|
|
@ -1081,4 +1109,4 @@ class DonationsDetailsLines(models.Model):
|
|||
'context': {
|
||||
'default_donation_detail_id': self.id,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1351,7 +1351,7 @@ class TakafulSponsorship(models.Model):
|
|||
current_invoice = self.journal_entry_ids.filtered(lambda r: r.move_type == 'out_invoice' and r.state == 'draft')
|
||||
if current_invoice:
|
||||
invoice_values['invoice_line_ids'] = [(5, 0, 0)] + invoice_line_vals
|
||||
current_invoice.write(invoice_values)
|
||||
current_invoice.sudo().write(invoice_values)
|
||||
invoice_id = current_invoice
|
||||
else:
|
||||
invoice_values.update({'invoice_line_ids': invoice_line_vals, 'name': self.env['ir.sequence'].next_by_code('account.move.accrsp')})
|
||||
|
|
@ -1365,7 +1365,7 @@ class TakafulSponsorship(models.Model):
|
|||
line.tax_ids = taxes
|
||||
line.product_uom_id = line._get_computed_uom()
|
||||
|
||||
invoice_id.action_post()
|
||||
invoice_id.sudo().action_post()
|
||||
|
||||
# Search for the notification message for 'create_kafala'
|
||||
notification = self.env['takaful.notification'].sudo().search(
|
||||
|
|
@ -1776,7 +1776,7 @@ class TakafulSponsorship(models.Model):
|
|||
if rec.state != 'confirmed':
|
||||
raise ValidationError(_("You can only reset to draft a confirmed sponsorship."))
|
||||
move_ids = rec.journal_entry_ids.filtered(lambda l: l.move_type == 'out_invoice')
|
||||
move_ids.button_draft()
|
||||
move_ids.sudo().button_draft()
|
||||
self.write({'state': 'draft'})
|
||||
all_donation_lines = (self.donations_details_lines + self.donations_details_lines_mechanism_ids).filtered(
|
||||
lambda r: r.display_type == False)
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@
|
|||
|
||||
<group>
|
||||
<group string="Donation Information">
|
||||
<field name="ages" invisible="1" />
|
||||
<field name="donation_type" invisible="1"/>
|
||||
<field name="donation_types"
|
||||
attrs="{'invisible': [('donation_type', '!=', 'donation')], 'readonly': [('parent_state', '!=', 'draft')]}" />
|
||||
|
|
@ -373,4 +374,4 @@
|
|||
<field name="context">{'create': False, 'delete': False, 'search_default_filter_replace': 1}</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -79,18 +79,18 @@
|
|||
<field name="refund_move_count" string="Refund Invoices"
|
||||
widget="statinfo"/>
|
||||
</button>
|
||||
<!-- <button name="action_replacement_processes" type="object"-->
|
||||
<!-- string="Replacement Processes" class="oe_stat_button" icon="fa-users">-->
|
||||
<!-- </button>-->
|
||||
<!-- <button name="action_replacement_processes" type="object"-->
|
||||
<!-- string="Replacement Processes" class="oe_stat_button" icon="fa-users">-->
|
||||
<!-- </button>-->
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Code badge hidden for now -->
|
||||
<!-- <div style="position: absolute; top: 70px; right: 15px; z-index: 100;" attrs="{'invisible': [('code', '=', False)]}">
|
||||
<span class="badge badge-info" style="font-size: 14px; padding: 6px 12px;">
|
||||
<i class="fa fa-barcode"/> <field name="code" nolabel="1" readonly="1"/>
|
||||
</span>
|
||||
</div> -->
|
||||
|
||||
|
||||
<!-- Record Type Selection - Simple & Clean Design -->
|
||||
<div class="o_record_type_simple">
|
||||
<div class="record_type_options">
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
<span>كفالة</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Hidden field for actual value -->
|
||||
<field name="record_type" readonly="0" nolabel="1" invisible="1"
|
||||
groups="!odex_takaful.branch_manager_group,!odex_takaful.sponsorship_system_manager_group,odex_takaful.donation_officer_group,odex_takaful.sponsorship_officer_group"/>
|
||||
|
|
@ -111,9 +111,9 @@
|
|||
groups="odex_takaful.branch_manager_group,odex_takaful.sponsorship_system_manager_group"
|
||||
attrs="{'readonly': [('state','!=','draft')]}"/>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Donation Type Selection - Only for Donations -->
|
||||
<div class="o_donation_mechanism_simple"
|
||||
<div class="o_donation_mechanism_simple"
|
||||
attrs="{'invisible': [('record_type','!=','donation')]}">
|
||||
<div class="mechanism_options">
|
||||
<div class="mechanism_option without_conditions" data-value="without_conditions">
|
||||
|
|
@ -125,30 +125,32 @@
|
|||
<span>مشروط</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Hidden field for actual value -->
|
||||
<field name="donation_mechanism" invisible="1" nolabel="1"
|
||||
attrs="{'required': [('record_type','=','donation')], 'readonly': [('state','!=','draft')]}"/>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Help Messages Section -->
|
||||
<div class="alert alert-info text-center"
|
||||
<div class="alert alert-info text-center"
|
||||
attrs="{'invisible': [('record_type','!=','donation')]}">
|
||||
<i class="fa fa-heart text-success"/> أدخل بيانات المتبرع ثم حدد تفاصيل التبرع
|
||||
<i class="fa fa-heart text-success"/>
|
||||
أدخل بيانات المتبرع ثم حدد تفاصيل التبرع
|
||||
</div>
|
||||
|
||||
<div class="alert alert-primary text-center"
|
||||
|
||||
<div class="alert alert-primary text-center"
|
||||
attrs="{'invisible': [('record_type','!=','sponsorship')]}">
|
||||
<i class="fa fa-users text-primary"/> أدخل بيانات الكافل ثم انتقل لإضافة تفاصيل الكفالة
|
||||
<i class="fa fa-users text-primary"/>
|
||||
أدخل بيانات الكافل ثم انتقل لإضافة تفاصيل الكفالة
|
||||
</div>
|
||||
|
||||
|
||||
<group name="group_top">
|
||||
<group name="group_left" string="Donor Information">
|
||||
<field name="manager_id" invisible="1"/>
|
||||
<field name="is_donations_coordinator" invisible="1"/>
|
||||
<field name="is_sponsorship_coordinator" invisible="1"/>
|
||||
<field name="registered_type" invisible="1" attrs="{'readonly': [('state','!=','draft')]}"/>
|
||||
|
||||
|
||||
<label string="Sponsor / Donor Type" for="sponsor_or_donor_type"/>
|
||||
<div class="o_row">
|
||||
<field name="sponsor_or_donor_type"
|
||||
|
|
@ -156,7 +158,7 @@
|
|||
<field name="sponsor_donor_type"
|
||||
attrs="{'invisible': [('record_type','!=','sponsorship')], 'required': [('record_type','=','sponsorship')], 'readonly': [('state','!=','draft')]}"/>
|
||||
</div>
|
||||
|
||||
|
||||
<label string="اسم الكافل/المتبرع" for="sponsor_id"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
|
|
@ -178,11 +180,11 @@
|
|||
],
|
||||
'readonly': [('state','!=','draft')]
|
||||
}"
|
||||
force_save="1"
|
||||
force_save="1"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
|
||||
|
||||
<button name="create_new_sponsor" type="object"
|
||||
string="إنشاء مشترك"
|
||||
string="إنشاء مشترك"
|
||||
class="btn-primary oe_highlight"
|
||||
icon="fa-plus"
|
||||
attrs="{
|
||||
|
|
@ -193,7 +195,7 @@
|
|||
]
|
||||
}"/>
|
||||
</div>
|
||||
|
||||
|
||||
<field name="sponsor_phone" string="رقم الجوال" widget="phone"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
|
|
@ -203,7 +205,7 @@
|
|||
'readonly': [('state','!=','draft')]
|
||||
}"
|
||||
placeholder="05xxxxxxxx"/>
|
||||
|
||||
|
||||
<field name="preferred_communication" string="طريقة التواصل المفضلة"
|
||||
attrs="{
|
||||
'invisible': ['|',
|
||||
|
|
@ -212,27 +214,27 @@
|
|||
],
|
||||
'readonly': [True]
|
||||
}"
|
||||
force_save="1"
|
||||
force_save="1"
|
||||
options="{'no_create': True, 'no_create_edit': True}"/>
|
||||
</group>
|
||||
|
||||
|
||||
<group name="group_right" string="Basic Information">
|
||||
<field name="is_widow_orphan" invisible="1"/>
|
||||
<field name="cancel_refund" invisible="1"/>
|
||||
<field name="has_delay" invisible="1"/>
|
||||
<field name="members_domain_ids" invisible="1"/>
|
||||
|
||||
|
||||
<field name="donate_for_another_person" widget="boolean_toggle"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<field name="sponsorship_creation_date" readonly="1"/>
|
||||
<field name="create_uid" string="Sponsorship Creator" readonly="1"/>
|
||||
|
||||
|
||||
<field name="branch_custom_id" groups="!odex_takaful.sponsorship_system_manager_group"
|
||||
readonly="0"/>
|
||||
<field name="branch_custom_id"
|
||||
groups="odex_takaful.sponsorship_system_manager_group"
|
||||
attrs="{'readonly': [('state','!=','draft')]}"/>
|
||||
|
||||
|
||||
<field name="marketer_id" attrs="{'readonly': [('state','!=','draft')]}"
|
||||
context="{'default_domain_force_all': True}"/>
|
||||
</group>
|
||||
|
|
@ -278,8 +280,8 @@
|
|||
<tree editable="bottom">
|
||||
<control>
|
||||
<create name="add_line_control" string="Add a line"/>
|
||||
<!-- <create name="add_section_control" string="Add a section"-->
|
||||
<!-- context="{'default_display_type': 'line_section'}"/>-->
|
||||
<!-- <create name="add_section_control" string="Add a section"-->
|
||||
<!-- context="{'default_display_type': 'line_section'}"/>-->
|
||||
<!-- <button name="action_delegate_to_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'sponsorship_id': parent.id}"/>-->
|
||||
</control>
|
||||
<field name="sponsorship_duration" invisible="1"/>
|
||||
|
|
@ -304,11 +306,12 @@
|
|||
invisible="1" force_save="1"/>
|
||||
<!-- attrs="{'column_invisible': [('parent.record_type', '!=', 'donation')], 'required': [('parent.record_type', '=', 'donation'), ('display_type', '=', False)]}"-->
|
||||
<field name="product_template_id"
|
||||
attrs="{'required': [('display_type', '=', False)]}" options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
attrs="{'required': [('display_type', '=', False)]}"
|
||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
<field name="name" widget="section_and_note_text" optional="show"/>
|
||||
<field name="direct_debit"/>
|
||||
<field name="journal_id"
|
||||
attrs="{'invisible': [('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
attrs="{'invisible': [('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
|
||||
<!-- <field name="cheque_number"
|
||||
attrs="{'required': [('payment_method', '=', 'check')], 'invisible': [('payment_method', '!=', 'check')]}"/>
|
||||
|
|
@ -394,7 +397,8 @@
|
|||
<!-- 'column_invisible': [('parent.record_type', '!=', 'donation')],-->
|
||||
<!-- 'required': [('parent.record_type', '=', 'donation'), ('display_type', '=', False)]}"/>-->
|
||||
<field name="product_template_id"
|
||||
attrs="{'required': [('display_type', '=', False)]}" options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
attrs="{'required': [('display_type', '=', False)]}"
|
||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
<field name="name"
|
||||
widget="section_and_note_text" optional="show"/>
|
||||
<field name="direct_debit"/>
|
||||
|
|
@ -462,13 +466,13 @@
|
|||
icon="fa-plus-circle"
|
||||
attrs="{'invisible': [('show_extend_button', '=', False)]}"/>
|
||||
|
||||
<button string="Add Benefit"
|
||||
<button string="Add Benefit"
|
||||
name="add_benefit_wizard"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
icon="fa-plus-circle"
|
||||
attrs="{'invisible': [('show_add_benefit_button', '=', False)]}"
|
||||
groups="odex_takaful.group_kufula_user" />
|
||||
groups="odex_takaful.group_kufula_user"/>
|
||||
<button name="action_view_replacement_wizard"
|
||||
string="Orphan Replacement"
|
||||
type="object"
|
||||
|
|
@ -487,12 +491,12 @@
|
|||
<form string="Donation Details">
|
||||
<header>
|
||||
<button string="Add Benefit"
|
||||
name="add_benefit_wizard"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
icon="fa-plus-circle"
|
||||
attrs="{'invisible': [('show_add_benefit_button', '=', False)]}"
|
||||
groups="odex_takaful.group_kufula_user" />
|
||||
name="add_benefit_wizard"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
icon="fa-plus-circle"
|
||||
attrs="{'invisible': [('show_add_benefit_button', '=', False)]}"
|
||||
groups="odex_takaful.group_kufula_user"/>
|
||||
<button name="action_view_replacement_wizard"
|
||||
string="Orphan Replacement"
|
||||
type="object"
|
||||
|
|
@ -509,6 +513,7 @@
|
|||
</header>
|
||||
<group>
|
||||
<group>
|
||||
<field name="ages" invisible="1"/>
|
||||
<field name="family_id"
|
||||
attrs="{'invisible': [('sponsorship_type','=','group'), ('parent.record_type','=','sponsorship')],
|
||||
'readonly': ['|', ('sponsorship_type', '!=', 'group'), ('parent.record_type','!=','donation')],
|
||||
|
|
@ -528,7 +533,8 @@
|
|||
<field name="record_type" invisible="1"/>
|
||||
<field name="sponsorship_duration"
|
||||
attrs="{'invisible': [('record_type','!=','sponsorship')], 'required': [('record_type','=','sponsorship')]}"/>
|
||||
<field name="product_template_id" options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
<field name="product_template_id"
|
||||
options="{'no_create': True, 'no_create_edit':True, 'no_open': True}"/>
|
||||
<field name="payment_month_count_visibility" invisible="1"/>
|
||||
<field name="direct_debit"
|
||||
attrs="{'invisible': [('sponsorship_duration','=','permanent')]}"/>
|
||||
|
|
@ -537,7 +543,8 @@
|
|||
<field name="donation_types"
|
||||
invisible="1"/>
|
||||
<field name="sponsor_id" invisible="1"/>
|
||||
<field name="direct_debit_partner_bank_id" context="{'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create', 'default_partner_id': sponsor_id}"
|
||||
<field name="direct_debit_partner_bank_id"
|
||||
context="{'form_view_ref': 'odex_takaful.res_partner_bank_view_form_quick_create', 'default_partner_id': sponsor_id}"
|
||||
attrs="{'invisible': ['|', ('payment_month_count_visibility','!=', True),('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
<field name="journal_id"
|
||||
attrs="{'invisible': ['|', ('payment_month_count_visibility','!=', True),('direct_debit', '=', False)], 'required': [('direct_debit', '=', True)]}"/>
|
||||
|
|
@ -818,4 +825,4 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in New Issue