Benefit customization
This commit is contained in:
parent
d1c8446130
commit
27318fb4cb
|
|
@ -106,7 +106,12 @@
|
|||
<tr><td valign="top" style="font-size: 13px;">
|
||||
<div>
|
||||
<center>
|
||||
We want to schedule visit date<br/><br/><br/>
|
||||
We want to schedule visit date with Researcher ${(object.researcher_ids[1])}<br/><br/><br/>
|
||||
to family ${(object.benefit_id.name)}
|
||||
in this location
|
||||
<a href="${object.get_url_local()}" target="_blank" style="color: blue; text-decoration: underline;">
|
||||
${object.get_url_local()}
|
||||
</a>
|
||||
</center><br/>
|
||||
</div>
|
||||
</td></tr>
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ class GrantBenefitProfile(models.Model):
|
|||
sms_phone = fields.Char(string="Contact Phone")
|
||||
name_in_bank = fields.Char()
|
||||
family_bank = fields.Many2one('res.partner.bank')
|
||||
acc_number = fields.Char('Account Number', required=True,copy=False)
|
||||
acc_holder_name = fields.Char('Account Holder Name', required=True)
|
||||
bank_id = fields.Many2one("res.bank",string='Bank',required = True)
|
||||
acc_number = fields.Char('Account Number',copy=False)
|
||||
acc_holder_name = fields.Char('Account Holder Name')
|
||||
bank_id = fields.Many2one("res.bank",string='Bank')
|
||||
account_relation = fields.Many2one('relation.settings',string="Account Owner Relation")
|
||||
orphan_status = fields.Selection(
|
||||
selection=[('father', 'Father-Orphan'), ('mother', 'Mother-Orphan'), ('parent', 'Parent-Orphan'), ],
|
||||
|
|
@ -687,38 +687,38 @@ class GrantBenefitProfile(models.Model):
|
|||
raise ValidationError(
|
||||
_('The Family Bank Already Exist!'))
|
||||
|
||||
@api.model
|
||||
def _geo_localize(self, street='', zip='', city='', state='', country=''):
|
||||
geo_obj = self.env['base.geocoder']
|
||||
search = geo_obj.geo_query_address(
|
||||
street=street, zip=zip, city=city, state=state, country=country
|
||||
)
|
||||
result = geo_obj.geo_find(search, force_country=country)
|
||||
if result is None:
|
||||
search = geo_obj.geo_query_address(
|
||||
city=city, state=state, country=country
|
||||
)
|
||||
result = geo_obj.geo_find(search, force_country=country)
|
||||
return result, search
|
||||
|
||||
def geo_localize(self):
|
||||
for location in self.with_context(lang='en_US'):
|
||||
result = self._geo_localize(
|
||||
street=location.street,
|
||||
zip=location.zip,
|
||||
city=location.city_id.name,
|
||||
state=location.state_id.name,
|
||||
country=location.country_id.name,
|
||||
)
|
||||
# url = "http://maps.google.com/maps?oi=map&q="
|
||||
if result:
|
||||
location.write(
|
||||
{
|
||||
'lat': result[0][0],
|
||||
'lon': result[0][1],
|
||||
}
|
||||
)
|
||||
return True
|
||||
# @api.model
|
||||
# def _geo_localize(self, street='', zip='', city='', state='', country=''):
|
||||
# geo_obj = self.env['base.geocoder']
|
||||
# search = geo_obj.geo_query_address(
|
||||
# street=street, zip=zip, city=city, state=state, country=country
|
||||
# )
|
||||
# result = geo_obj.geo_find(search, force_country=country)
|
||||
# if result is None:
|
||||
# search = geo_obj.geo_query_address(
|
||||
# city=city, state=state, country=country
|
||||
# )
|
||||
# result = geo_obj.geo_find(search, force_country=country)
|
||||
# return result, search
|
||||
#
|
||||
# def geo_localize(self):
|
||||
# for location in self.with_context(lang='en_US'):
|
||||
# result = self._geo_localize(
|
||||
# street=location.street,
|
||||
# zip=location.zip,
|
||||
# city=location.city_id.name,
|
||||
# state=location.state_id.name,
|
||||
# country=location.country_id.name,
|
||||
# )
|
||||
# # url = "http://maps.google.com/maps?oi=map&q="
|
||||
# if result:
|
||||
# location.write(
|
||||
# {
|
||||
# 'lat': result[0][0],
|
||||
# 'lon': result[0][1],
|
||||
# }
|
||||
# )
|
||||
# return True
|
||||
|
||||
# if result[1]:
|
||||
# url += result[1]
|
||||
|
|
@ -732,14 +732,15 @@ class GrantBenefitProfile(models.Model):
|
|||
# 'target': 'new',
|
||||
# 'url': url
|
||||
# }
|
||||
# def geo_localize(self):
|
||||
# for location in self.with_context(lang='en_US'):
|
||||
# url = location.location_url
|
||||
# return {
|
||||
# 'type': 'ir.actions.act_url',
|
||||
# 'target': 'new',
|
||||
# 'url': url
|
||||
# }
|
||||
def geo_localize(self):
|
||||
# href = "https://www.google.com/maps/search/?api=1&query=29.99841,30.96128"
|
||||
for location in self.with_context(lang='en_US'):
|
||||
url = "http://maps.google.com/maps/search/?api=1&query=%s,%s" % (location.lat, location.lon),
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'new',
|
||||
'url': url
|
||||
}
|
||||
|
||||
@api.depends('mother_marital_conf', 'mother_income', 'mother_location', 'mother_country_id', 'state')
|
||||
def check_mother_status(self):
|
||||
|
|
|
|||
|
|
@ -293,8 +293,9 @@ class Salary(models.Model):
|
|||
salary_amount = fields.Float(
|
||||
string='Income Amount',
|
||||
required=False)
|
||||
salary_attach = fields.Binary(string="Attachment", )
|
||||
|
||||
salary_attach = fields.Binary(string="Attachment",attachment=True)
|
||||
attach_start_date = fields.Date(string='Attach Start Date')
|
||||
attach_end_date = fields.Date(string='Attach End Date')
|
||||
|
||||
class ibanBanks(models.Model):
|
||||
_inherit = 'res.bank'
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ class Visit(models.Model):
|
|||
reason = fields.Text(string='Reason/Justification')
|
||||
name = fields.Char(string='Reference', required=True, copy=False, readonly=True, index=True,
|
||||
default=lambda self: _('New'))
|
||||
|
||||
def unlink(self):
|
||||
for order in self:
|
||||
if order.state not in ['draft']:
|
||||
|
|
@ -55,16 +54,6 @@ class Visit(models.Model):
|
|||
vals['name'] = self.env['ir.sequence'].next_by_code('visit.location.sequence') or _('New')
|
||||
return super(Visit, self).create(vals)
|
||||
|
||||
def geo_localize(self):
|
||||
for visit in self:
|
||||
if visit.benefit_id:
|
||||
url = visit.benefit_id.location_url
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'new',
|
||||
'url': url
|
||||
}
|
||||
|
||||
def get_researchers_email(self):
|
||||
email_ids = ''
|
||||
for rec in self.researcher_ids:
|
||||
|
|
@ -146,3 +135,18 @@ class Visit(models.Model):
|
|||
|
||||
return OTP
|
||||
|
||||
def geo_localize(self):
|
||||
for visit in self:
|
||||
if visit.benefit_id:
|
||||
url = "http://maps.google.com/maps/search/?api=1&query=%s,%s" % (visit.benefit_id.lat,visit.benefit_id.lon),
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'target': 'new',
|
||||
'url': url
|
||||
}
|
||||
|
||||
def get_url_local(self):
|
||||
for visit in self:
|
||||
if visit.benefit_id:
|
||||
url = "http://maps.google.com/maps/search/?api=1&query=%s,%s" % (visit.benefit_id.lat,visit.benefit_id.lon)
|
||||
return url
|
||||
|
|
@ -765,20 +765,20 @@
|
|||
<menuitem id='changes_requests_men' name='Changes Requests' parent='change_requests_menu'
|
||||
action="changes_requests_action"
|
||||
sequence="4"/>
|
||||
<menuitem id="benefit_generate_needs" name="needs Screen" parent="benefits_root_menu"
|
||||
action="benefit_benefits_needs_action_2" sequence="5"/>
|
||||
<!-- <menuitem id="benefit_generate_needs" name="needs Screen" parent="benefits_root_menu"-->
|
||||
<!-- action="benefit_benefits_needs_action_2" sequence="5"/>-->
|
||||
<menuitem id="visits_menu" name="Visits" parent="benefits_root_menu"
|
||||
action="visits_action" sequence="5"/>
|
||||
<menuitem id='benefit_report' name='Reports' parent='benefits_root_menu'
|
||||
sequence="6"/>
|
||||
<menuitem id="benefit_reports" name="Generate report" parent="benefits_root_menu"
|
||||
sequence="7"/>
|
||||
<menuitem id="benefit_generate_reports" name="Generate report Screen" parent="benefit_reports"
|
||||
action="benefit_generate_reports_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="benefit_reports_log" name="Generate report log" parent="benefit_reports"
|
||||
action="benefit_reports_log_action"
|
||||
sequence="2"/>
|
||||
<!-- <menuitem id='benefit_report' name='Reports' parent='benefits_root_menu'-->
|
||||
<!-- sequence="6"/>-->
|
||||
<!-- <menuitem id="benefit_reports" name="Generate report" parent="benefits_root_menu"-->
|
||||
<!-- sequence="7"/>-->
|
||||
<!-- <menuitem id="benefit_generate_reports" name="Generate report Screen" parent="benefit_reports"-->
|
||||
<!-- action="benefit_generate_reports_action"-->
|
||||
<!-- sequence="1"/>-->
|
||||
<!-- <menuitem id="benefit_reports_log" name="Generate report log" parent="benefit_reports"-->
|
||||
<!-- action="benefit_reports_log_action"-->
|
||||
<!-- sequence="2"/>-->
|
||||
<menuitem id='benefit_tools' name='Tools' parent='benefits_root_menu'
|
||||
sequence="8"/>
|
||||
|
||||
|
|
@ -886,16 +886,16 @@
|
|||
parent="benefit_tools"
|
||||
sequence="5"
|
||||
/>
|
||||
<menuitem id="housing_rooms_items_menu" name="Rooms Items"
|
||||
parent="menu_benefits_config_housing" action="housing_rooms_items_action" sequence="1"/>
|
||||
<menuitem id="housing_rooms_type_menu" name="Rooms Type"
|
||||
parent="menu_benefits_config_housing" action="housing_rooms_type_action" sequence="2"/>
|
||||
<menuitem id="housing_rooms_categories_menu" name="Rooms Categories"
|
||||
parent="menu_benefits_config_housing" action="rooms_categories_action" sequence="3"/>
|
||||
<menuitem id="domestic_labor_menu" name="The domestic labor" sequence="3"
|
||||
parent="menu_benefits_config_housing" action="domestic_labor_action"/>
|
||||
<menuitem id="item_status_menu" name="Item Status"
|
||||
parent="menu_benefits_config_housing" action="item_status_action" sequence="4"/>
|
||||
<!-- <menuitem id="housing_rooms_items_menu" name="Rooms Items"-->
|
||||
<!-- parent="menu_benefits_config_housing" action="housing_rooms_items_action" sequence="1"/>-->
|
||||
<!-- <menuitem id="housing_rooms_type_menu" name="Rooms Type"-->
|
||||
<!-- parent="menu_benefits_config_housing" action="housing_rooms_type_action" sequence="2"/>-->
|
||||
<!-- <menuitem id="housing_rooms_categories_menu" name="Rooms Categories"-->
|
||||
<!-- parent="menu_benefits_config_housing" action="rooms_categories_action" sequence="3"/>-->
|
||||
<!-- <menuitem id="domestic_labor_menu" name="The domestic labor" sequence="3"-->
|
||||
<!-- parent="menu_benefits_config_housing" action="domestic_labor_action"/>-->
|
||||
<!-- <menuitem id="item_status_menu" name="Item Status"-->
|
||||
<!-- parent="menu_benefits_config_housing" action="item_status_action" sequence="4"/>-->
|
||||
<menuitem
|
||||
id="menu_benefits_config_benefits"
|
||||
name="benefits"
|
||||
|
|
@ -903,10 +903,10 @@
|
|||
sequence="5"/>
|
||||
<menuitem id="res_bank_menu" name="Banks" parent="menu_benefits_config_benefits" action="res_bank_list_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="hospital_menu" name="Hospital" parent="menu_benefits_config_benefits" action="hospital_action"
|
||||
sequence="2"/>
|
||||
<menuitem id="insurance_company_menu" name="Insurance Company" parent="menu_benefits_config_benefits"
|
||||
action="insurance_company_action" sequence="3"/>
|
||||
<!-- <menuitem id="hospital_menu" name="Hospital" parent="menu_benefits_config_benefits" action="hospital_action"-->
|
||||
<!-- sequence="2"/>-->
|
||||
<!-- <menuitem id="insurance_company_menu" name="Insurance Company" parent="menu_benefits_config_benefits"-->
|
||||
<!-- action="insurance_company_action" sequence="3"/>-->
|
||||
<menuitem id="income_type_menu" name="Income Type"
|
||||
parent="menu_benefits_config_benefits" action="income_type_action" sequence="7"/>
|
||||
<menuitem id="expenses_type_menu" name="Expenses Type"
|
||||
|
|
@ -915,10 +915,10 @@
|
|||
parent="menu_benefits_config_benefits" action="loan_giver_action" sequence="9"/>
|
||||
<menuitem id="loan_reason_menu" name="Loan Reason"
|
||||
parent="menu_benefits_config_benefits" action="loan_reason_action" sequence="10"/>
|
||||
<menuitem id="sport_type_menu" name="Sport Type"
|
||||
parent="menu_benefits_config_benefits" action="sport_type_action" sequence="5"/>
|
||||
<menuitem id="needs_categories_menu" name="Needs Categories"
|
||||
parent="menu_benefits_config_benefits" action="needs_categories_action" sequence="6"/>
|
||||
<!-- <menuitem id="sport_type_menu" name="Sport Type"-->
|
||||
<!-- parent="menu_benefits_config_benefits" action="sport_type_action" sequence="5"/>-->
|
||||
<!-- <menuitem id="needs_categories_menu" name="Needs Categories"-->
|
||||
<!-- parent="menu_benefits_config_benefits" action="needs_categories_action" sequence="6"/>-->
|
||||
<menuitem
|
||||
id="menu_benefits_config_contact"
|
||||
name="contact"
|
||||
|
|
@ -938,8 +938,8 @@
|
|||
<!-- action="main_service_action" sequence="7"/>-->
|
||||
<menuitem id="exception_reason_menu" name="Exception Reason" parent="menu_benefits_config_others"
|
||||
action="exception_reason_action" sequence="8"/>
|
||||
<menuitem id="other_associations_menu" name="Other Associations"
|
||||
parent="menu_benefits_config_others" action="other_associations_action" sequence="1"/>
|
||||
<!-- <menuitem id="other_associations_menu" name="Other Associations"-->
|
||||
<!-- parent="menu_benefits_config_others" action="other_associations_action" sequence="1"/>-->
|
||||
<!--##########################################-->
|
||||
<!-- Benefit Services menu-->
|
||||
<!--##########################################-->
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@
|
|||
<field name="last_visit_date" readonly="1"/>
|
||||
<field name="benefit_category_id" readonly="1" force_save="1"/>
|
||||
<field name="member_income" readonly="1" force_save="1"/>
|
||||
<button name="%(odex_benefit.grant_map)d" string="Map" type="action" context="{'search_default_name': name}" icon="fa-map-marker" class="oe_highlight" attrs="{'invisible': ['|',('lat', '=', 0.0), ('lon', '=', 0.0)]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<!-- <field name="family_bank"-->
|
||||
|
|
@ -244,7 +245,7 @@
|
|||
<field name="sms_phone" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])],'required':True}"/>
|
||||
<field name="branch_custom_id" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}" required="1"/>
|
||||
<field name="district_id" attrs="{'required':[('state','!=','draft')],'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
|
||||
<button name="%(odex_benefit.grant_map)d" string="Map" type="action" context="{'search_default_name': name}" icon="fa-map-marker" class="oe_highlight" attrs="{'invisible': ['|',('lat', '=', 0.0), ('lon', '=', 0.0)]}"/>
|
||||
<button name="geo_localize" string="open in Map Directly" type="object" class="oe_highlight" attrs="{'invisible': ['|',('lat', '=', 0.0), ('lon', '=', 0.0)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
|
@ -705,16 +706,16 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="account_relation" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}" options='{"no_open": True,"no_create_edit": True}'/>
|
||||
<field name="account_relation" attrs="{'readonly':[('state','not in',['draft'])]}" options='{"no_open": True,"no_create_edit": True}'/>
|
||||
<label for="acc_number"/>
|
||||
<div class="o_row">
|
||||
<field name="acc_number" width="100%"/>
|
||||
<field name="acc_number" width="100%" attrs="{'required':[('state','!=','draft')],'readonly':[('state','not in',['draft'])]}"/>
|
||||
<field name="sa_iban"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bank_id" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
<field name="acc_holder_name" attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
<field name="bank_id" attrs="{'readonly':[('state','not in',['draft'])],'required':[('state','!=','draft')]}"/>
|
||||
<field name="acc_holder_name" attrs="{'readonly':[('state','not in',['draft'])],'required':[('state','!=','draft')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
|
@ -729,10 +730,10 @@
|
|||
<!-- </h1>-->
|
||||
<!-- </div>-->
|
||||
<h3>National address</h3>
|
||||
<group>
|
||||
<button name="geo_localize" string="Map" type="object"
|
||||
class="oe_highlight"/>
|
||||
</group>
|
||||
<!-- <group>-->
|
||||
<!-- <button name="geo_localize" string="Map" type="object"-->
|
||||
<!-- class="oe_highlight"/>-->
|
||||
<!-- </group>-->
|
||||
<group>
|
||||
<group>
|
||||
<field name="country_id" attrs="{'required':[('state','!=','draft')]}"
|
||||
|
|
@ -870,24 +871,16 @@
|
|||
</group>
|
||||
</page>
|
||||
<page string="Income and salary">
|
||||
<group string="Income and salary">
|
||||
<field name="salary_ids" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}">
|
||||
<tree editable="bottom">
|
||||
<field name="benefit_id" invisible="1"/>
|
||||
<field name="income_type"/>
|
||||
<field name="salary_amount" sum="salary_amount"/>
|
||||
<field name="salary_attach"/>
|
||||
</tree>
|
||||
</field>
|
||||
<!-- <field name="is_commercial_record"/>-->
|
||||
</group>
|
||||
<!-- <group string="Commercial Record"-->
|
||||
<!-- attrs="{'invisible': [('is_commercial_record', '=', False)]}">-->
|
||||
<!-- <field name="is_active"/>-->
|
||||
<!-- <field name="commercial_record_code"/>-->
|
||||
<!-- <field name="commercial_record_attach"/>-->
|
||||
<!-- <field name="commercial_record_amount"/>-->
|
||||
<!-- </group>-->
|
||||
<field name="salary_ids" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}">
|
||||
<tree editable="bottom">
|
||||
<field name="benefit_id" invisible="1"/>
|
||||
<field name="income_type"/>
|
||||
<field name="salary_amount" sum="salary_amount"/>
|
||||
<field name="salary_attach"/>
|
||||
<field name="attach_start_date"/>
|
||||
<field name="attach_end_date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Family Cars" attrs="{'invisible':[('has_car','=',False)]}">
|
||||
<group>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<!-- <field name="selector"/>-->
|
||||
<!-- <field name="researcher_id" attrs="{'invisible':[('selector','=','researcher_team')]}"/>-->
|
||||
<field name="researcher_team" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="researcher_ids" widget="many2many_tags" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="researcher_ids" widget="many2many_tags" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}" force_save="1"/>
|
||||
<field name="description" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="message" attrs="{'invisible':[('state', 'not in', ['draft', 'contact'])],'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="reason" attrs="{'invisible':[('state', 'not in', ['cancel'])],'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue