diff --git a/odex25_benefit/odex_benefit/i18n/ar_001.po b/odex25_benefit/odex_benefit/i18n/ar_001.po
index 6ff7d2153..bc1863423 100644
--- a/odex25_benefit/odex_benefit/i18n/ar_001.po
+++ b/odex25_benefit/odex_benefit/i18n/ar_001.po
@@ -5050,7 +5050,6 @@ msgstr ""
#: model:ir.actions.act_window,name:odex_benefit.expenses_type_action
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_expenses__expenses_type
#: model:ir.model.fields,field_description:odex_benefit.field_expenses_line__expenses_type
-#: model:ir.ui.menu,name:odex_benefit.expenses_type_menu
msgid "Expenses Type"
msgstr "أنواع الالتزامات"
@@ -6563,7 +6562,6 @@ msgstr "ملفات الدخل المطلوبة"
#: model:ir.actions.act_window,name:odex_benefit.income_type_action
#: model:ir.model,name:odex_benefit.model_income_type
#: model:ir.model.fields,field_description:odex_benefit.field_salary_line__income_type
-#: model:ir.ui.menu,name:odex_benefit.income_type_menu
msgid "Income Type"
msgstr "نوع الدخل"
@@ -7953,7 +7951,6 @@ msgstr "متوسط دخل الفرد"
#: model:ir.actions.act_window,name:odex_benefit.member_location_action
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__member_location
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__member_location_conf
-#: model:ir.ui.menu,name:odex_benefit.menu_member_location
#: model_terms:ir.ui.view,arch_db:odex_benefit.member_location_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.member_location_tree
msgid "Member Location"
@@ -12537,11 +12534,15 @@ msgid "benefit.zkat.line"
msgstr ""
#. module: odex_benefit
-#: model:ir.ui.menu,name:odex_benefit.menu_benefits_config_benefits
#: model_terms:ir.ui.view,arch_db:odex_benefit.benefit_club_form
msgid "benefits"
msgstr "المستفيدين"
+#. module: odex_benefit
+#: model:ir.ui.menu,name:odex_benefit.menu_benefits_config_benefits
+msgid "Contacts"
+msgstr "الجهات"
+
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_benefits_needs_tree
msgid "benefits Needs"
@@ -13355,8 +13356,8 @@ msgstr ""
#. module: odex_benefit
#: model:ir.ui.menu,name:odex_benefit.menu_benefits_config_others
-msgid "others"
-msgstr "اخرى"
+msgid "Reasons Settings"
+msgstr "أسباب"
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_zkat__donation_method__outside
@@ -15179,8 +15180,8 @@ msgstr "إنشاء أول نوع للسيارات"
#. module: odex_benefit
#: model:ir.ui.menu,name:odex_benefit.benefit_vehicle_model_settings_menu
-msgid "Vehicle Settings"
-msgstr "إعدادات المركبات"
+msgid "General Settings"
+msgstr "إعدادات عامة"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_cars_line__application_form
@@ -16222,8 +16223,6 @@ msgstr "لا يمكنك طلب هذه الخدمة أكثر من مرة."
#: code:addons/odex_benefit/models/service_request.py:0
#: code:addons/odex_benefit/models/service_request.py:0
#: code:addons/odex_benefit/models/service_request.py:0
-#: code:addons/odex_benefit/models/service_request.py:0
-#: code:addons/odex_benefit/models/service_request.py:0
#, python-format
msgid "You cannot request more than %s"
msgstr "لا يمكنك طلب أكثر من %s"
diff --git a/odex25_benefit/odex_benefit/models/benefit_config.py b/odex25_benefit/odex_benefit/models/benefit_config.py
index 25b789287..fe1066ffc 100644
--- a/odex25_benefit/odex_benefit/models/benefit_config.py
+++ b/odex25_benefit/odex_benefit/models/benefit_config.py
@@ -476,7 +476,9 @@ class ExpensesLine(models.Model):
benefit_id = fields.Many2one('grant.benefit')
mother_benefit_id = fields.Many2one('grant.benefit',string="Mother Benefit",ondelete='cascade')
currency_id = fields.Many2one('res.currency', related='benefit_id.currency_id')
- expenses_type_custom = fields.Many2one('expenses.type')
+ #expenses_type_custom = fields.Many2one('expenses.type')
+ expenses_type_custom = fields.Many2one('attachments.settings', string='Expenses Type Custom',
+ domain="[('attach_type','=','expenses_attach')]")
expenses_type = fields.Selection(
string='',
selection=[('governmental', 'Governmental Expenses'),
@@ -809,7 +811,7 @@ class AttachmentsSettings(models.Model):
disabilities_id = fields.Many2one('disabilities.settings',string='Disabilities')
attach_type = fields.Selection(
[('family_attach', _('Family Attach')), ('member_attach', _('Member Attach')), ('hobbies_attach', _('Hobbies Attach')),
- ('diseases_attach', _('Diseases Attach')), ('disabilities_attach', _('Disabilities Attach')), ('income_attach', _('Income Attach')), ('exams_attach', _('Exams Attach'))])
+ ('diseases_attach', _('Diseases Attach')), ('disabilities_attach', _('Disabilities Attach')), ('income_attach', _('Income Attach')), ('expense_attach', _('Expense Attach')), ('exams_attach', _('Exams Attach'))])
is_required = fields.Boolean(string='Is Required?')
is_default = fields.Boolean(string='Is Default?')
show_in_portal = fields.Boolean(default=True)
diff --git a/odex25_benefit/odex_benefit/models/service_request.py b/odex25_benefit/odex_benefit/models/service_request.py
index a3f96fce5..ca4397828 100644
--- a/odex25_benefit/odex_benefit/models/service_request.py
+++ b/odex25_benefit/odex_benefit/models/service_request.py
@@ -555,6 +555,31 @@ class ServiceRequest(models.Model):
def action_send_to_researcher(self):
for rec in self:
+ if rec.service_cat and rec.service_cat.service_type == 'home_furnishing':
+ for item in rec.furnishing_items_ids:
+ max_amount = item.home_furnishing_items.max_furnishing_amount or 0.0
+ if 0 < max_amount < item.furnishing_cost:
+ if not item.price_first_attach:
+ raise ValidationError(
+ _("Cannot send to researcher!\n\n"
+ "Item '%(item)s': Cost (%(cost).2f) exceeds max limit (%(max).2f).\n"
+ "→ First price attachment is mandatory.") % {
+ 'item': item.home_furnishing_items.name,
+ 'cost': item.furnishing_cost,
+ 'max': max_amount
+ }
+ )
+
+ if not item.price_second_attach:
+ raise ValidationError(
+ _("Cannot send to researcher!\n\n"
+ "Item '%(item)s': Cost (%(cost).2f) exceeds max limit (%(max).2f).\n"
+ "→ Second price attachment is mandatory.") % {
+ 'item': item.home_furnishing_items.name,
+ 'cost': item.furnishing_cost,
+ 'max': max_amount
+ }
+ )
rec.state = 'researcher'
def action_return_to_family(self):
@@ -911,23 +936,6 @@ class ServiceRequest(models.Model):
raise ValidationError(_("You cannot request this service more than once."))
else:
if service_type in special_services:
- if service_type == 'home_furnishing':
- delta_kwargs = {period: interval}
- date_before = rec.date - relativedelta(**delta_kwargs)
- domain = base_domain + [('date', '>', date_before)]
- existing_requests = Service.search(domain)
- total_amount = sum(existing_requests.mapped('requested_service_amount')) + sum(
- rec.furnishing_items_ids.mapped('furnishing_cost'))
- if not rec.home_furnishing_exception:
- rec.service_max_amount = rec.service_cat.max_amount
- if total_amount > rec.service_cat.max_amount:
- raise ValidationError(
- _("You cannot request more than %s") % rec.service_max_amount)
- if rec.home_furnishing_exception:
- rec.service_max_amount = rec.service_cat.max_furnishing_amount_if_exception
- if total_amount > rec.service_cat.max_furnishing_amount_if_exception:
- raise ValidationError(
- _("You cannot request more than %s") % rec.service_max_amount)
if service_type == 'electrical_devices':
rec.service_max_amount = rec.device_id.price_unit if rec.device_id else 0.0
if rec.device_id:
@@ -948,7 +956,6 @@ class ServiceRequest(models.Model):
raise ValidationError(_(
"You cannot request this device more than %s times within %s %s."
) % (allowed_qty, interval, period))
-
else:
last_request = Service.search(base_domain, order='date desc', limit=1)
if last_request and last_request.date:
@@ -996,6 +1003,9 @@ class ServiceRequest(models.Model):
rec.service_max_amount = rec.estimated_rent_amount_payment
if rec.max_limit_period:
+ period_domain = base_domain.copy()
+ if service_type == 'home_furnishing' and not rec.home_furnishing_exception:
+ period_domain += [('home_furnishing_exception', '=', False)]
if rec.max_limit_period == "month":
if rec.start and rec.end:
start_date = rec.start.date() if isinstance(rec.start, datetime) else rec.start
@@ -1016,12 +1026,12 @@ class ServiceRequest(models.Model):
year_start = date(start_year, 1, 1)
year_end = date(end_year, 12, 31)
- calendar_year_domain = base_domain + [
+ period_domain += [
('date', '>=', datetime.combine(year_start, datetime.min.time())),
('date', '<=', datetime.combine(year_end, datetime.max.time())),
]
- existing_requests = Service.search(calendar_year_domain)
+ existing_requests = Service.search(period_domain)
total_spent = sum(existing_requests.mapped('requested_service_amount'))
rec.service_max_amount = rec.service_cat.max_amount - total_spent
@@ -1031,12 +1041,12 @@ class ServiceRequest(models.Model):
period_start_date = current_date - relativedelta(years=allowed_years)
period_end_date = current_date
- year_from_request_domain = base_domain + [
+ period_domain += [
('date', '>=', datetime.combine(period_start_date, datetime.min.time())),
('date', '<=', datetime.combine(period_end_date, datetime.max.time())),
]
- existing_requests = Service.search(year_from_request_domain)
+ existing_requests = Service.search(period_domain)
total_spent = sum(existing_requests.mapped('requested_service_amount'))
rec.service_max_amount = rec.service_cat.max_amount - total_spent
elif rec.max_limit_period == "individual":
@@ -1065,6 +1075,9 @@ class ServiceRequest(models.Model):
if rec.has_marriage_course == 'no':
raise UserError(_("You Should take a course"))
continue
+ if service_type == 'home_furnishing':
+ if rec.home_furnishing_exception:
+ rec.service_max_amount = rec.service_cat.max_furnishing_amount_if_exception
if rec.requested_service_amount > rec.service_max_amount and service_type not in special_services and not max_limit_type == 'none':
raise ValidationError(
diff --git a/odex25_benefit/odex_benefit/views/actions_and_menus.xml b/odex25_benefit/odex_benefit/views/actions_and_menus.xml
index e4c9d01fd..346ec0b36 100644
--- a/odex25_benefit/odex_benefit/views/actions_and_menus.xml
+++ b/odex25_benefit/odex_benefit/views/actions_and_menus.xml
@@ -849,7 +849,7 @@
sequence="8" groups="odex_benefit.group_benefit_manager"/>
-
+
@@ -871,14 +871,14 @@
@@ -892,35 +892,28 @@
-
@@ -939,7 +932,7 @@
-
@@ -1002,7 +995,7 @@
-->
-
-
@@ -1064,11 +1053,11 @@
+ parent="odex_benefit.benefit_tools" sequence="120"/>
+ parent="menu_benefits_config_benefits" action="action_supporter_partners" sequence="19"/>
-
+