[IMP] odex_benefit: IMP benefit
This commit is contained in:
parent
b5a39ad1b0
commit
79458cea48
|
|
@ -463,7 +463,7 @@ class GrantBenefitProfile(models.Model):
|
||||||
('1', 'Yearly'),
|
('1', 'Yearly'),
|
||||||
('2', 'Half-yearly'),
|
('2', 'Half-yearly'),
|
||||||
('4', 'Quarterly'),
|
('4', 'Quarterly'),
|
||||||
('5', 'Monthly')
|
('12', 'Monthly')
|
||||||
],
|
],
|
||||||
string='Payment Type',
|
string='Payment Type',
|
||||||
compute='_compute_rent_from_contract',store=True,
|
compute='_compute_rent_from_contract',store=True,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class ServiceRequest(models.Model):
|
||||||
('1', 'Yearly'),
|
('1', 'Yearly'),
|
||||||
('2', 'Half-yearly'),
|
('2', 'Half-yearly'),
|
||||||
('4', 'Quarterly'),
|
('4', 'Quarterly'),
|
||||||
('5', 'Monthly')
|
('12', 'Monthly')
|
||||||
],
|
],
|
||||||
string='Payment Type',
|
string='Payment Type',
|
||||||
compute='_compute_rent_details',
|
compute='_compute_rent_details',
|
||||||
|
|
@ -1044,7 +1044,7 @@ class ServiceRequest(models.Model):
|
||||||
lambda
|
lambda
|
||||||
x: x.min_count_member <= rec.benefit_member_count <= x.max_count_member)).amount or 0
|
x: x.min_count_member <= rec.benefit_member_count <= x.max_count_member)).amount or 0
|
||||||
elif max_limit_type == 'region':
|
elif max_limit_type == 'region':
|
||||||
rec.service_max_amount = rec.estimated_rent_amount_payment
|
rec.service_max_amount = rec.estimated_rent_amount / 12
|
||||||
|
|
||||||
if rec.max_limit_period:
|
if rec.max_limit_period:
|
||||||
period_domain = base_domain.copy()
|
period_domain = base_domain.copy()
|
||||||
|
|
@ -1302,13 +1302,11 @@ class ServiceRequest(models.Model):
|
||||||
rec.family_id.property_type_id.type == 'rent' and
|
rec.family_id.property_type_id.type == 'rent' and
|
||||||
rec.family_id.property_type_id.is_shared
|
rec.family_id.property_type_id.is_shared
|
||||||
)
|
)
|
||||||
|
discount = item.discount_rate_shared_housing / 100.0 if is_shared_rent else 1
|
||||||
if branch_type == 'branches':
|
if branch_type == 'branches':
|
||||||
rec.estimated_rent_amount = item.estimated_rent_branches * (
|
rec.estimated_rent_amount = item.estimated_rent_branches * discount
|
||||||
item.discount_rate_shared_housing if is_shared_rent else 1)
|
|
||||||
elif branch_type == 'governorates':
|
elif branch_type == 'governorates':
|
||||||
rec.estimated_rent_amount = item.estimated_rent_governorate * (
|
rec.estimated_rent_amount = item.estimated_rent_governorate * discount
|
||||||
item.discount_rate_shared_housing if is_shared_rent else 1)
|
|
||||||
if rec.service_type == 'alternative_housing':
|
if rec.service_type == 'alternative_housing':
|
||||||
for item in rec.rent_for_alternative_housing.rent_lines:
|
for item in rec.rent_for_alternative_housing.rent_lines:
|
||||||
# Check if benefit category and member count match
|
# Check if benefit category and member count match
|
||||||
|
|
@ -1340,6 +1338,6 @@ class ServiceRequest(models.Model):
|
||||||
def _get_rent_amount_payment(self):
|
def _get_rent_amount_payment(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.rent_amount and rec.payment_type:
|
if rec.rent_amount and rec.payment_type:
|
||||||
rec.rent_amount_payment = rec.rent_amount / int(rec.payment_type)
|
rec.rent_amount_payment = rec.rent_amount * 12 / int(rec.payment_type)
|
||||||
else:
|
else:
|
||||||
rec.rent_amount_payment = 0.0
|
rec.rent_amount_payment = 0.0
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,7 @@ access_grant_benefit_account_move,access_grant_benefit_account_move,model_accoun
|
||||||
access_expense_line_family_services_manager,access_expense_line_family_services_manager,model_benefit_expense_line,odex_benefit.group_family_services_manager,1,1,1,1
|
access_expense_line_family_services_manager,access_expense_line_family_services_manager,model_benefit_expense_line,odex_benefit.group_family_services_manager,1,1,1,1
|
||||||
access_expense_line_benefit_manager,access_expense_line_benefit_manager,model_benefit_expense_line,odex_benefit.group_benefit_manager,1,1,1,1
|
access_expense_line_benefit_manager,access_expense_line_benefit_manager,model_benefit_expense_line,odex_benefit.group_benefit_manager,1,1,1,1
|
||||||
access_expense_researcher,access_expense_researcher,model_benefit_expense_line,odex_benefit.group_benefit_info,1,1,0,0
|
access_expense_researcher,access_expense_researcher,model_benefit_expense_line,odex_benefit.group_benefit_info,1,1,0,0
|
||||||
|
access_expense_line_payment_accountant_accept,access_expense_line_payment_accountant_accept,model_benefit_expense_line,odex_benefit.group_benefit_payment_accountant_accept,1,1,0,0
|
||||||
access_family_bank_report_wizard,access_family_bank_report_wizard,model_family_bank_report_wizard,base.group_user,1,1,1,1
|
access_family_bank_report_wizard,access_family_bank_report_wizard,model_family_bank_report_wizard,base.group_user,1,1,1,1
|
||||||
access_return_reason,access_return_reason,model_return_reason,base.group_user,1,1,1,1
|
access_return_reason,access_return_reason,model_return_reason,base.group_user,1,1,1,1
|
||||||
access_return_reason_wizard,access_return_reason_wizard,model_return_reason_wizard,base.group_user,1,1,1,1
|
access_return_reason_wizard,access_return_reason_wizard,model_return_reason_wizard,base.group_user,1,1,1,1
|
||||||
|
|
|
||||||
|
|
|
@ -814,7 +814,7 @@
|
||||||
'readonly': [('state', 'not in', ['draft', 'new', 'complete_info'])]
|
'readonly': [('state', 'not in', ['draft', 'new', 'complete_info'])]
|
||||||
}" /> -->
|
}" /> -->
|
||||||
<field name="mother_dead_country_id"
|
<field name="mother_dead_country_id"
|
||||||
attrs="{'invisible':[('mother_is_dead','=',False)],'required':[('mother_is_dead','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
attrs="{'invisible':[('mother_is_dead','=',False)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||||
<field name="mother_dead_country_id_code" invisible="1"/>
|
<field name="mother_dead_country_id_code" invisible="1"/>
|
||||||
<field name="mother_dead_res_city_id" attrs="{
|
<field name="mother_dead_res_city_id" attrs="{
|
||||||
'invisible':['|', ('mother_is_dead', '=', False), ('mother_dead_country_id_code', '!=', 'SA')],
|
'invisible':['|', ('mother_is_dead', '=', False), ('mother_dead_country_id_code', '!=', 'SA')],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue