[IMP] odex_benefit: IMP benefit
This commit is contained in:
parent
ac6b017b22
commit
711b6eefa0
|
|
@ -2080,7 +2080,7 @@ class GrantBenefitProfile(models.Model):
|
|||
for rec in self:
|
||||
rec.expenses_ids = False
|
||||
for expenses in rec.benefit_category_id:
|
||||
if expenses.state == 'second_pprove':
|
||||
if expenses.state == 'second_approve':
|
||||
for i in expenses.expenses_ids:
|
||||
expenses = {}
|
||||
expenses['expenses_type'] = i.expenses_type
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class ServiceRequest(models.Model):
|
|||
start = fields.Date(string="Start Date")
|
||||
end = fields.Date(string='End Date')
|
||||
added_amount_if_mother_dead = fields.Float(string="Added Amount (If mother dead)",
|
||||
compute="_get_added_amount_if_mother_dead")
|
||||
compute="_get_added_amount_if_mother_dead",store=True)
|
||||
attachment_lines = fields.One2many(
|
||||
'service.attachments.settings',
|
||||
'service_request_id',
|
||||
|
|
@ -510,12 +510,6 @@ class ServiceRequest(models.Model):
|
|||
rec.payment_type = False
|
||||
rec.rent_attachment = [(5, 0, 0)]
|
||||
|
||||
def _get_added_amount_if_mother_dead(self):
|
||||
for rec in self:
|
||||
rec.added_amount_if_mother_dead = 0.0
|
||||
if rec.family_id.mother_marital_conf.is_dead:
|
||||
rec.added_amount_if_mother_dead = rec.service_cat.raise_amount_for_orphan
|
||||
|
||||
def _get_aid_amount(self):
|
||||
for rec in self:
|
||||
if rec.service_type == 'rent':
|
||||
|
|
@ -1043,7 +1037,7 @@ class ServiceRequest(models.Model):
|
|||
lambda
|
||||
x: x.min_count_member <= rec.benefit_member_count <= x.max_count_member)).amount or 0
|
||||
elif max_limit_type == 'region':
|
||||
rec.service_max_amount = rec.estimated_rent_amount / 12
|
||||
rec.service_max_amount = rec.estimated_rent_amount / 12 + rec.added_amount_if_mother_dead
|
||||
|
||||
if rec.max_limit_period:
|
||||
period_domain = base_domain.copy()
|
||||
|
|
@ -1065,7 +1059,7 @@ class ServiceRequest(models.Model):
|
|||
rec.service_max_amount *= num_months
|
||||
if service_type == 'rent':
|
||||
rec.requested_service_amount = min(rec.rent_amount_payment,
|
||||
rec.estimated_rent_amount_payment)
|
||||
rec.estimated_rent_amount_payment) + rec.added_amount_if_mother_dead
|
||||
elif rec.max_limit_period == "calendar_year":
|
||||
current_date = rec.date.date() if isinstance(rec.date, datetime) else rec.date
|
||||
allowed_years = rec.service_cat.allowed_period or 1
|
||||
|
|
@ -1347,3 +1341,13 @@ class ServiceRequest(models.Model):
|
|||
rec.rent_amount_payment = rec.rent_amount * 12 / int(rec.payment_type)
|
||||
else:
|
||||
rec.rent_amount_payment = 0.0
|
||||
|
||||
@api.depends('family_id','service_cat','payment_type')
|
||||
def _get_added_amount_if_mother_dead(self):
|
||||
for rec in self:
|
||||
added_amount_if_mother_dead = 0.0
|
||||
if rec.family_id.mother_marital_conf.is_dead:
|
||||
added_amount_if_mother_dead = rec.service_cat.raise_amount_for_orphan
|
||||
if rec.service_cat.raise_amount_for_orphan and rec.payment_type:
|
||||
added_amount_if_mother_dead = rec.service_cat.raise_amount_for_orphan / int(rec.payment_type)
|
||||
rec.added_amount_if_mother_dead = added_amount_if_mother_dead
|
||||
|
|
@ -364,7 +364,7 @@
|
|||
<br/>
|
||||
<field name="estimated_rent_amount"/>
|
||||
<field name="estimated_rent_amount_payment"/>
|
||||
<field name="added_amount_if_mother_dead"
|
||||
<field name="added_amount_if_mother_dead" force_save="1"
|
||||
attrs="{'invisible':[('service_type','=','alternative_housing')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<field name="max_amount"
|
||||
attrs="{'invisible': [('max_limit_type', '!=', 'fixed')]}"/>
|
||||
<field name="raise_amount_for_orphan"
|
||||
attrs="{'invisible':['|',('service_type','!=','rent'),('benefit_type','!=','member')]}"/>
|
||||
attrs="{'invisible':['|',('service_type','!=','rent'),('benefit_type','!=','family')]}"/>
|
||||
<field name="min_count_member"
|
||||
attrs="{'invisible':[('service_type','!=','buy_car')]}"/>
|
||||
<field name="buy_home_max_total_amount"
|
||||
|
|
|
|||
Loading…
Reference in New Issue