Benefit(Exception)

This commit is contained in:
eman 2024-10-13 13:48:25 +03:00
parent 169cea3fd0
commit 0d13391112
8 changed files with 185 additions and 212 deletions

View File

@ -20,6 +20,7 @@
'views/branch_inherit.xml',
'wizards/researcher_wizard.xml',
'wizards/suspend_reason_wizard.xml',
'wizards/exception_wizard.xml',
'views/visit.xml',
'views/main_service.xml',
'views/member_location.xml',

View File

@ -40,26 +40,16 @@
<field name="code">model.update_data_automatically()</field>
<field name="state">code</field>
</record>
<!-- <record id="ir_cron_auto_suspend" model="ir.cron">-->
<!-- <field name="name">Automatic Suspend</field>-->
<!-- <field name="interval_number">1</field>-->
<!-- <field name="interval_type">days</field>-->
<!-- <field name="numbercall">-1</field>-->
<!-- <field name="doall" eval="False"/>-->
<!-- <field name="model_id" ref="model_grant_benefit"/>-->
<!-- <field name="code">model.action_auto_suspend()</field>-->
<!-- <field name="state">code</field>-->
<!-- </record>-->
<!-- &lt;!&ndash; Cron for send notification for expiry date attachment for members&ndash;&gt;-->
<!-- <record id="members_send_notification" model="ir.cron">-->
<!-- <field name="name">Notification: Expiry date Attachment</field>-->
<!-- <field name="interval_number">1</field>-->
<!-- <field name="interval_type">days</field>-->
<!-- <field name="numbercall">-1</field>-->
<!-- <field name="doall" eval="False"/>-->
<!-- <field name="model_id" ref="model_family_members"/>-->
<!-- <field name="code">model.send_expiry_date_notification()</field>-->
<!-- <field name="state">code</field>-->
<!-- </record>-->
<record id="ir_cron_auto_exception" model="ir.cron">
<field name="name">Check Temporarily Exception</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="nextcall" eval="(DateTime.today() + relativedelta(hours=0, minutes=0)).strftime('%Y-%m-%d 00:00:00')"/>
<field name="doall" eval="False"/>
<field name="model_id" ref="model_grant_benefit"/>
<field name="code">model.action_auto_exception()</field>
<field name="state">code</field>
</record>
</data>
</odoo>

View File

@ -374,6 +374,9 @@ class GrantBenefitProfile(models.Model):
('temporarily_suspended', 'Temporarily suspended'),
('suspended_first_approve', 'Suspended First Approved'),
('suspended_second_approve', 'Suspended Second Approved'),
('temporarily_exception', 'Temporarily Exception'),
('exception_first_approve', 'Exception First Approve'),
('exception_second_approve', 'Exception Second Approve'),
('not_leaving', 'Not Leaving'),
('black_list', 'Black List'),
], string='state', default="draft", tracking=True)
@ -435,6 +438,16 @@ class GrantBenefitProfile(models.Model):
suspend_type = fields.Selection(
selection=[('temporarily_suspend', 'Temporarily Suspended'), ('suspend', 'Suspend')], string="Suspend Type")
suspend_method = fields.Selection(selection=[('manual', 'Manual'), ('auto', 'Auto')], string="Suspend Method")
#Exception fields
exception_reason = fields.Many2one('exception.reason', string='Exception Reason')
exception_description = fields.Text(string='Exception Description')
exception_type = fields.Selection(
selection=[('temporarily_exception', 'Temporarily Exception'), ('permanent_exception', 'Permanent Exception')],
string="Exception Type")
exception_attachment = fields.Binary(string='Exception Attachment', attachment=True)
exception_start_date = fields.Datetime(string='Exception Start Date')
exception_end_date = fields.Datetime(string='Exception End Date')
sponsor_id = fields.Many2one('res.partner', string='Sponsor',domain="[('account_type','=','sponsor')]")
family_monthly_income = fields.Float(string="Family Monthly Income", compute='_get_family_monthly_values')
@ -518,21 +531,6 @@ class GrantBenefitProfile(models.Model):
rec.family_monthly_clotting = 0
rec.total_family_expenses = 0
# @api.depends('company_type', 'first_name', 'second_name', 'middle_name', 'family_name','father_name','father_second_name','father_third_name','father_family_name')
# def get_partner_name(self):
# for rec in self:
# if rec.company_type == 'person':
# rec.name = ''
# if all([rec.second_name, rec.first_name, rec.middle_name, rec.family_name]):
# rec.name = rec.first_name + " " + rec.second_name + " " + rec.middle_name + " " + rec.family_name
# elif all([rec.father_name, rec.father_second_name, rec.father_third_name, rec.father_family_name]):
# rec.name = rec.father_name + " " + rec.father_second_name + " " + rec.father_third_name + " " + rec.father_family_name
# else:
# rec.second_name = ''
# rec.first_name = ''
# rec.middle_name = ''
# rec.family_name = ''
def get_html(self):
for rec in self:
print(f'<iframe id="custom_src" height="500" width="500" src="{rec.url}"></iframe>')
@ -563,15 +561,6 @@ class GrantBenefitProfile(models.Model):
if self.image_url:
self.img_attach = '<img id="img" src="%s"/>' % self.url
# # @api.onchange('attachment_ids')
# def onchange_attachment_ids(self):
# if self.attachment_ids:
# for rec in self.attachment_ids:
# if rec.is_required and not rec.datas == False:
# self.required_attach = 'true'
# else:
# self.required_attach = None
@api.depends('room_ids')
def get_rooms_total(self):
@ -762,14 +751,6 @@ class GrantBenefitProfile(models.Model):
res = super(GrantBenefitProfile, self).create(vals)
if not res.code or res.code == _('New'):
res.code = self.env['ir.sequence'].sudo().next_by_code('benefit.sequence') or _('New')
# default_attachment = self.env["attachments.settings"].search([('is_default','=',True)])
# for attach in default_attachment:
# if attach.attach_type == 'family_attach':
# for rec in res:
# rec.attachment_ids = [(0,0,{'name':attach.name,'is_required':attach.is_required,'is_default':attach.is_default})]
# if attach.attach_type == 'member_attach':
# for rec in res:
# rec.attachment_ids = [(0,0,{'name':attach.name,'is_required':attach.is_required,'is_default':attach.is_default})]
# if res.branch_id:
# if res.branch_id != self.env.user.branch_id:
# raise UserError(_('You cannot register outside Saudi Arabia'))
@ -974,6 +955,40 @@ class GrantBenefitProfile(models.Model):
rec.state = 'second_approve'
rec.get_member_income()
#Excption Work flow
def action_exception(self):
return {
'name': _('Exception Wizard'),
'view_mode': 'form',
'view_type': 'form',
'type': 'ir.actions.act_window',
'res_model': 'exception.wizard',
'view_id': self.env.ref('odex_benefit.view_exception_wizard_form').id,
'target': 'new',
}
def action_exception_first_accept(self):
for rec in self:
rec.state = 'exception_first_approve'
def action_exception_second_accept(self):
for rec in self:
rec.is_excluded_suspension = True
rec.state = 'second_approve'
def action_auto_exception(self):
obj = self.env["grant.benefit"].search(
[('state', '=', 'second_approve'), ('is_excluded_suspension', '=', True)])
for rec in obj:
if rec.exception_end_date and rec.exception_end_date <= fields.Datetime.now():
rec.is_excluded_suspension = False
rec.state = 'suspended_second_approve'
for member in rec.member_ids:
member.is_excluded_suspension = False
def action_exception_refuse(self):
for rec in self:
rec.state = 'suspended_second_approve'
# @api.multi
def action_remove_from_black_list(self):
"""Remove entity from black list"""

View File

@ -140,9 +140,12 @@ class FamilyMemberProfile(models.Model):
('suspended', 'suspended'),
('suspended_first_approve', 'Suspended First Approved'),
('suspended_second_approve', 'Suspended Second Approved'),
('temporarily_exception', 'Temporarily Exception'),
('exception_first_approve', 'Exception First Approve'),
('exception_second_approve', 'Exception Second Approve'),
('not_leaving', 'Not Leaving'),
('black_list', 'Black List'),
], string='state', default="draft", tracking=True,related="benefit_id.state")
], string='state', tracking=True,compute='_get_state',store = True)
state_a = fields.Selection([
('draft', 'Draft'),
('complete_info', 'Complete Information'),
@ -158,6 +161,9 @@ class FamilyMemberProfile(models.Model):
('suspended', 'suspended'),
('suspended_first_approve', 'Suspended First Approved'),
('suspended_second_approve', 'Suspended Second Approved'),
('temporarily_exception', 'Temporarily Exception'),
('exception_first_approve', 'Exception First Approve'),
('exception_second_approve', 'Exception Second Approve'),
('not_leaving', 'Not Leaving'),
('black_list', 'Black List'),
], string='stateA', default="draft", tracking=True)
@ -175,6 +181,16 @@ class FamilyMemberProfile(models.Model):
is_member_workflow = fields.Boolean('Is Member Workflow?')
sponsor_id = fields.Many2one('res.partner', string='Sponsor',domain="[('account_type','=','sponsor')]")
required_attach = fields.Selection(selection=[('true', 'True'), ('false', 'False')], compute='get_required_attach',store=True,string='Member Required Attach')
# Exception fields
exception_reason = fields.Many2one('exception.reason', string='Exception Reason')
exception_description = fields.Text(string='Exception Description')
exception_type = fields.Selection(
selection=[('temporarily_exception', 'Temporarily Exception'), ('permanent_exception', 'Permanent Exception')],
string="Exception Type")
exception_attachment = fields.Binary(string='Exception Attachment', attachment=True)
exception_start_date = fields.Datetime(string='Exception Start Date')
exception_end_date = fields.Datetime(string='Exception End Date')
is_excluded_suspension = fields.Boolean('Excluded from suspension?')
def unlink(self):
for order in self:
@ -182,6 +198,14 @@ class FamilyMemberProfile(models.Model):
raise UserError(_('You cannot delete this record'))
return super(FamilyMemberProfile, self).unlink()
@api.depends('is_member_workflow', 'benefit_id.state','state_a')
def _get_state(self):
for rec in self:
if not rec.is_member_workflow:
rec.state = rec.benefit_id.state
else:
rec.state = rec.state_a
@api.model
def default_get(self, fields):
res = super(FamilyMemberProfile, self).default_get(fields)
@ -323,32 +347,6 @@ class FamilyMemberProfile(models.Model):
else:
rec.age = 0
@api.onchange("name")
def onchange_member_name(self):
print("llllllllllllllllllllllllll")
# for rec in self._origin:
# print(rec.id,"llllllllllllllllllllllllll")
# Search for default attachments with attach_type as 'member_attach'
default_attachment = self.env["attachments.settings"].search([
('is_default', '=', True),
('attach_type', '=', 'member_attach')
])
# Add default attachments to attachment_ids, avoid duplicating existing ones
existing_attachment_names = self.attachment_ids.mapped('name')
new_attachments = []
for attach in default_attachment:
# Check if the attachment is already in attachment_ids
if attach.name not in existing_attachment_names:
new_attachments.append((0, 0, {
'name': attach.name,
'is_required': attach.is_required,
'is_default': attach.is_default
}))
if new_attachments:
self.attachment_ids = new_attachments
@api.onchange("member_id_number")
def onchange_member_id_number(self):
for rec in self:
@ -358,65 +356,6 @@ class FamilyMemberProfile(models.Model):
raise ValidationError(
_('The ID Number Already Exist!'))
# @api.onchange('member_id_number','birth_date', 'is_scientific_specialty', 'is_medical_specialty', 'has_disabilities', 'is_married',
# 'minor_siblings')
# def onchange_member_info(self):
# for rec in self:
# if rec.birth_date:
# validation_setting = self.env["family.validation.setting"].search([], limit=1)
# female_benefit_age = validation_setting.female_benefit_age
# male_benefit_age = validation_setting.male_benefit_age
# exceptional_age_scientific_specialty = validation_setting.exceptional_age_scientific_specialty
# exceptional_age_medical_specialty = validation_setting.exceptional_age_medical_specialty
# exceptional_age_has_disabilities = validation_setting.exceptional_age_has_disabilities
# minor_siblings_age = validation_setting.minor_siblings_age
# if rec.is_mother == False:
# res = {}
# if rec.gender == 'male' and rec.age > male_benefit_age:
# if rec.is_scientific_specialty and rec.age > exceptional_age_scientific_specialty and not rec.has_disabilities:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register',rec.age)}
# if rec.is_medical_specialty and rec.age > exceptional_age_medical_specialty and not rec.has_disabilities:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# if rec.has_disabilities and rec.age > exceptional_age_has_disabilities:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register',rec.age)}
# if rec.gender == 'male' and rec.age > male_benefit_age and not rec.is_scientific_specialty and not rec.is_medical_specialty and not rec.has_disabilities:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age > female_benefit_age and not rec.minor_siblings:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age > female_benefit_age and rec.age > minor_siblings_age:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age < female_benefit_age and rec.is_work:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age < female_benefit_age and rec.is_married:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age > female_benefit_age and rec.minor_siblings and rec.age < minor_siblings_age:
# continue
# elif rec.gender == 'female' and rec.age > female_benefit_age and rec.minor_siblings and rec.age < minor_siblings_age and rec.is_work == True:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# elif rec.gender == 'female' and rec.age > female_benefit_age and rec.minor_siblings and rec.age < minor_siblings_age and rec.is_married == True:
# rec.member_id_number = False
# res['warning'] = {'title': _('ValidationError'),
# 'message': _('beneficiary over "%s" cannot register', rec.age)}
# return res
@api.onchange('relationn','member_status','gender','birth_date', 'is_scientific_specialty', 'is_medical_specialty', 'has_disabilities', 'is_married',
'minor_siblings','member_income','is_married','member_location','education_status','case_study')
def onchange_member_status(self):
@ -450,12 +389,40 @@ class FamilyMemberProfile(models.Model):
for rec in self:
rec.state_a = 'second_approve'
rec.is_member_workflow = False
# def action_auto_suspend(self):
# obj = self.env["grant.benefit"].search([('state','=','second_approve'),('is_excluded_suspension','=',False)])
# for rec in obj:
# if rec.benefit_member_count == 0 and rec.state == 'second_approve':
# rec.state = 'suspended_second_approve'
# rec.suspend_method = 'auto'
# Excption Work flow
def action_exception(self):
return {
'name': _('Exception Wizard'),
'view_mode': 'form',
'view_type': 'form',
'type': 'ir.actions.act_window',
'res_model': 'exception.wizard',
'view_id': self.env.ref('odex_benefit.view_exception_member_wizard_form').id,
'target': 'new',
}
def action_exception_first_accept(self):
for rec in self:
rec.state_a = 'exception_first_approve'
def action_exception_second_accept(self):
for rec in self:
rec.is_excluded_suspension = True
rec.state_a = 'second_approve'
rec.is_member_workflow = False
def action_auto_exception(self):
obj = self.env["family.member"].search(
[('state_a', '=', 'exception_second_approve'), ('is_excluded_suspension', '=', True)])
for rec in obj:
if rec.exception_end_date and rec.exception_end_date <= fields.Datetime.now():
rec.is_excluded_suspension = False
rec.state_a = 'suspended_second_approve'
def action_exception_refuse(self):
for rec in self:
rec.state_a = 'suspended_second_approve'
rec.is_member_workflow = False
# Methods for Work flow for Member
def complete_data(self):

View File

@ -119,4 +119,5 @@ access_loan_giver,access_loan_giver,model_loan_giver,base.group_user,1,1,1,1
access_loan_reason,access_loan_reason,model_loan_reason,base.group_user,1,1,1,1
access_hobbies_settings,access_hobbies_settings,model_hobbies_settings,base.group_user,1,1,1,1
access_disabilities_settings,access_disabilities_settings,model_disabilities_settings,base.group_user,1,1,1,1
access_diseases_settings,access_diseases_settings,model_diseases_settings,base.group_user,1,1,1,1
access_diseases_settings,access_diseases_settings,model_diseases_settings,base.group_user,1,1,1,1
access_exception_wizard,access_exception_wizard,model_exception_wizard,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
119 access_loan_reason access_loan_reason model_loan_reason base.group_user 1 1 1 1
120 access_hobbies_settings access_hobbies_settings model_hobbies_settings base.group_user 1 1 1 1
121 access_disabilities_settings access_disabilities_settings model_disabilities_settings base.group_user 1 1 1 1
122 access_diseases_settings access_diseases_settings model_diseases_settings base.group_user 1 1 1 1
123 access_exception_wizard access_exception_wizard model_exception_wizard base.group_user 1 1 1 1

View File

@ -117,12 +117,6 @@
string="First Refuse" class="oe_highlight"
confirm="Are you sure you want to refuse ?" groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
states="waiting_approve"/>
<!-- <button name="woman_manager" type="object"-->
<!-- string="Woman Manager" class="oe_highlight"-->
<!-- states="draft"/>-->
<!-- <button name="research" type="object"-->
<!-- string="Research" class="oe_highlight"-->
<!-- states="woman_manager"/>-->
<button name="complete_data" type="object"
string="Complete Information" class="oe_highlight"
confirm="Are you sure you want to Complete data ?"
@ -140,18 +134,28 @@
states="second_approve"
confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_suspend_first_accept" type="object"
string="First Approve" class="oe_highlight"
string="First Approve" class="oe_highlight" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
states="temporarily_suspended"/>
<button name="action_suspend_second_accept" type="object"
string="Second Approve" class="oe_highlight"
string="Second Approve" class="oe_highlight" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
states="suspended_first_approve"/>
<button name="action_suspend_refuse" type="object"
string="Suspend Refuse" class="oe_highlight"
states="temporarily_suspended,suspended_first_approve,suspended_second_approve"/>
<!-- <button name="action_remove_from_black_list" type="object"-->
<!-- string="Remove from Black List" class="oe_highlight"-->
<!-- states="black_list"-->
<!-- confirm="Are you sure you want to remove from black list ?"/>-->
<!-- Exception -->
<button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight"
states="suspended_second_approve"
confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
states="temporarily_exception"/>
<button name="action_exception_second_accept" type="object"
string="Exception Second Approve" class="oe_highlight"
states="exception_first_approve" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
<button name="action_exception_refuse" type="object"
string="Exception Refuse" class="oe_highlight"
states="temporarily_exception,exception_first_approve,exception_second_approve"/>
<button name="action_edit_info" type="object"
string="Open Edit Info" class="oe_highlight"
groups="odex_benefit.group_benefit_edit"
@ -237,13 +241,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'])]}"/>
<!-- <group>-->
<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="%(odex_benefit.grant_map)d" type="action" class="oe_stat_button" context="{'search_default_name': name}" icon="fa-map-marker" string="Google Map" attrs="{'invisible': ['|',('lat', '=', 0.0), ('lon', '=', 0.0)]}"/>-->
<!-- <button name="%(odex_benefit.grant_map)d" type="action" class="oe_stat_button" context="{'search_default_name': name}" icon="fa-map-marker" string="Google Map" attrs="{'invisible': ['|',('lat', '=', 0.0), ('lon', '=', 0.0)]}"/>-->
<!-- </group>-->
</group>
</group>
<notebook>
@ -441,6 +439,7 @@
<field name="has_disabilities"/>
<field name="minor_siblings"/>
<field name="sponsor_id"/>
<field name="is_excluded_suspension" readonly="1" force_save="1"/>
<field name="member_status" readonly="1" widget="badge"
decoration-success="member_status == 'benefit'"
decoration-danger="member_status == 'non_benefit'"/>
@ -950,6 +949,20 @@
</group>
</group>
</page>
<page string="Exception"
attrs="{'invisible': [('state', 'not in', ['temporarily_exception','exception_first_approve','exception_second_approve'])]}">
<group>
<group>
<field name="exception_start_date"/>
<field name="exception_description"/>
<field name="exception_type"/>
</group>
<group>
<field name="exception_end_date"/>
<field name="exception_attachment"/>
</group>
</group>
</page>
<page string="Family Monthly salary">
<group>
<field name="family_monthly_income"/>
@ -987,7 +1000,7 @@
attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
<field name="has_car" widget="boolean_toggle"
attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
<field name="is_excluded_suspension" groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"/>
<field name="is_excluded_suspension" groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee" readonly="1" force_save="1"/>
</group>
<group>
<field name="request_producer"

View File

@ -11,58 +11,29 @@
attrs="{'invisible': ['|',('state','not in',['second_approve']),('is_member_workflow','=',True)]}"
confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_suspend_first_accept" type="object"
string="First Approve" class="oe_highlight" attrs="{'invisible': [('state_a','not in',['temporarily_suspended'])]}"/>
string="First Approve" class="oe_highlight" attrs="{'invisible': [('state','not in',['temporarily_suspended'])]}"/>
<button name="action_suspend_second_accept" type="object"
string="Second Approve" class="oe_highlight" attrs="{'invisible': [('state_a','not in',['suspended_first_approve'])]}"/>
string="Second Approve" class="oe_highlight" attrs="{'invisible': [('state','not in',['suspended_first_approve'])]}"/>
<button name="action_suspend_refuse" type="object"
string="Suspend Refuse" class="oe_highlight" attrs="{'invisible': [('state_a','not in',['temporarily_suspended','suspended_first_approve'])]}"/>
<!-- <button name="action_accepted" type="object"-->
<!-- string="Accept" class="oe_highlight"-->
<!-- confirm="Are you sure you want to accept ?"-->
<!-- attrs="{'invisible': [('state','not in',['waiting_approve','edit_info','first_refusal'])]}"/>-->
<!-- <button name="action_refuse" type="object"-->
<!-- string="Final Refuse" class="oe_highlight"-->
<!-- confirm="Are you sure you want to final refuse ?"-->
<!-- states="edit_info,first_refusal"-->
<!-- />-->
<!-- <button name="action_first_refusal" type="object"-->
<!-- string="First Refuse" class="oe_highlight"-->
<!-- confirm="Are you sure you want to refuse ?"-->
<!-- states="waiting_approve"/>-->
<!-- <button name="complete_data" type="object"-->
<!-- string="Complete Information" class="oe_highlight"-->
<!-- confirm="Are you sure you want to Complete data ?"-->
<!-- states="draft"/>-->
<!-- <button name="finish_complete_data" type="object"-->
<!-- string="Finish Complete" class="oe_highlight"-->
<!-- confirm="Are you sure you want to Finish Complete data ?"-->
<!-- states="complete_info"/>-->
<!-- <button name="action_black_list" type="object"-->
<!-- string="Black List" class="oe_highlight"-->
<!-- states="waiting_approve,refused"-->
<!-- confirm="Are you sure you want to move to black list ?"/>-->
<!-- <button name="action_edit_info" type="object"-->
<!-- string="Open Edit Info" class="oe_highlight"-->
<!-- groups="odex_benefit.group_benefit_edit"-->
<!-- states="refused,approve,first_refusal"-->
<!-- confirm="Are you sure you want to open info edition !"-->
<!-- />-->
<!-- <button name="create_manual_visit" type="object"-->
<!-- string="Create Periodic visit" class="oe_highlight"-->
<!-- states="approve"-->
<!-- />-->
<!-- <button name="action_finish_edit" type="object"-->
<!-- string="Stop Edit "-->
<!-- states="edit_info" class="oe_highlight"-->
<!-- confirm="Are you sure you want to Stop info edition !"-->
<!-- />-->
string="Suspend Refuse" class="oe_highlight" attrs="{'invisible': [('state','not in',['temporarily_suspended','suspended_first_approve'])]}"/>
<!-- Exception -->
<button name="action_exception" type="object"
string="Temporarily Exception" class="oe_highlight"
confirm="Are you sure you want to move to Temporarily Exception ?" attrs="{'invisible': [('state','not in',['suspended_second_approve'])]}"/>
<button name="action_exception_first_accept" type="object"
string="Exception First Approve" class="oe_highlight" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager" attrs="{'invisible': [('state','not in',['temporarily_exception'])]}"/>
<button name="action_exception_second_accept" type="object"
string="Exception Second Approve" class="oe_highlight" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
attrs="{'invisible': [('state','not in',['exception_first_approve'])]}"/>
<button name="action_exception_refuse" type="object"
string="Exception Refuse" class="oe_highlight" attrs="{'invisible': [('state','not in',['temporarily_exception','exception_first_approve','exception_second_approve'])]}"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,complete_info,waiting_approve,first_approve,second_approve,first_refusal,refused,temporarily_suspended" attrs="{'invisible': [('is_member_workflow','=',True)]}"/>
statusbar_visible="draft,complete_info,waiting_approve,first_approve,second_approve,first_refusal,refused,temporarily_suspended"/>
<field name="state_a" widget="statusbar"
statusbar_visible="draft,complete_info,waiting_approve,first_approve,second_approve,first_refusal,refused,temporarily_suspended" attrs="{'invisible': [('is_member_workflow','=',False)]}"/>
statusbar_visible="draft,complete_info,waiting_approve,first_approve,second_approve,first_refusal,refused,temporarily_suspended" invisible="1"/>
</header>
<sheet>
<field name="is_member_workflow" invisible="1"/>
<field name="is_member_workflow"/>
<widget name="web_ribbon" title="Non Benefit Member" bg_color="bg-danger" attrs="{'invisible': ['|',('member_status', '=', False),('member_status', '!=', 'non_benefit')]}"/>
<widget name ="web_ribbon" title="Benefit Member" bg_color="bg-success" attrs="{'invisible': ['|',('member_status', '=', False),('member_status', '!=', 'benefit')]}"/>
<h1>
@ -89,6 +60,7 @@
<field name="has_disabilities" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
<field name="minor_siblings" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
<field name="sponsor_id" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}"/>
<field name="is_excluded_suspension" readonly="1" force_save="1"/>
</group>
<group>
<field name="second_name" attrs="{'readonly':[('state','not in',['draft','complete_info','edit_info'])]}" required="1"/>
@ -198,6 +170,19 @@
<field name="suspend_method" readonly="1" force_save="1"/>
</group>
</group>
</page>
<page string="Exception" attrs="{'invisible': [('state_a', 'not in', ['temporarily_exception','exception_first_approve','exception_second_approve'])]}">
<group>
<group>
<field name="exception_start_date"/>
<field name="exception_description"/>
<field name="exception_type"/>
</group>
<group>
<field name="exception_end_date"/>
<field name="exception_attachment"/>
</group>
</group>
</page>
<page string="Attachments">
<field name="attachment_ids" widget="one2many_list">
@ -219,7 +204,7 @@
<field name="name">family.member.tree</field>
<field name="model">family.member</field>
<field name="arch" type="xml">
<tree string="Family Members">
<tree string="Family Members" create="0">
<field name="name"/>
<!-- <field name="gender" required="1"/>-->
<field name="relationn"/>

View File

@ -3,4 +3,5 @@ from . import entity_refused_wizard
from . import entity_black_list_wizard
from . import researcher_wizard
from . import suspend_reason_wizard
from . import exception_wizard