diff --git a/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml b/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml
index 0b4514f5a..b187c7711 100644
--- a/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml
+++ b/odex25_ensan/odex25_empowermentmanagement/views/empowerment_management.xml
@@ -152,7 +152,7 @@
diff --git a/odex25_ensan/odex25_program_activity/views/program.xml b/odex25_ensan/odex25_program_activity/views/program.xml
index 830cc4763..9e3a737bf 100644
--- a/odex25_ensan/odex25_program_activity/views/program.xml
+++ b/odex25_ensan/odex25_program_activity/views/program.xml
@@ -391,7 +391,7 @@
diff --git a/odex25_ensan/odex_benefit/controllers/benefit.py b/odex25_ensan/odex_benefit/controllers/benefit.py
index 3fb39b453..b1ab80c17 100644
--- a/odex25_ensan/odex_benefit/controllers/benefit.py
+++ b/odex25_ensan/odex_benefit/controllers/benefit.py
@@ -620,7 +620,7 @@ class BenefitPortal(http.Controller):
li = ['f_name', 'g_name', 'parent', 'family', 'id_number', 'birth_date', 'age',
'gender', 'id', 'institution_id', 'partner_id', 'relation', 'state']
if benefit:
- if benefit.state in ['edit_info', 'draft']:
+ if benefit.state in ['draft']:
for field_name, field_value in kw.items():
if field_name != "id_number_attach":
values[field_name] = field_value
@@ -630,8 +630,8 @@ class BenefitPortal(http.Controller):
if len(file) > 0:
values[fname] = base64.b64encode(file)
benefit.write(values)
- if benefit.state == 'edit_info':
- benefit.action_finish_edit()
+ # if benefit.state == 'edit_info':
+ # benefit.action_finish_edit()
data = {'status': True, 'msg': (_('Benefit Account Updated successfully')),
'data': benefit.read(li)}
else:
diff --git a/odex25_ensan/odex_benefit/i18n/ar_001.po b/odex25_ensan/odex_benefit/i18n/ar_001.po
index 29e67a423..e69c3c4b4 100644
--- a/odex25_ensan/odex_benefit/i18n/ar_001.po
+++ b/odex25_ensan/odex_benefit/i18n/ar_001.po
@@ -4558,9 +4558,6 @@ msgstr "مسودة"
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__edit_info
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__edit_info
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__edit_info
-#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__edit_info
msgid "Edit Information"
msgstr "تحرير البيانات"
@@ -8679,13 +8676,6 @@ msgstr "غير مستفيد"
msgid "Not Found benefit "
msgstr ""
-#. module: odex_benefit
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__not_leaving
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__not_leaving
-#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__not_leaving
-msgid "Not Leaving"
-msgstr "المتوفيين"
-
#. module: odex_benefit
#: code:addons/odex_benefit/models/benefit.py:0
#: code:addons/odex_benefit/models/family_members.py:0
@@ -10035,9 +10025,6 @@ msgstr "اخصائي اجتماعي"
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_family_wizard__researcher_team
#: model:ir.model.fields,field_description:odex_benefit.field_researcher_member_wizard__researcher_team
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__researcher_team
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__researcher_team
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__researcher_team
-#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__researcher_team
msgid "Researcher Team"
msgstr "الاخصائي الاجتماعي"
@@ -12176,13 +12163,6 @@ msgstr "مع الزوج والأطفال"
msgid "With_husband"
msgstr "مع الزوج"
-#. module: odex_benefit
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__woman_manager
-#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__woman_manager
-#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__woman_manager
-msgid "Woman Manager"
-msgstr "مدير اللجنة النسائية"
-
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__new
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
diff --git a/odex25_ensan/odex_benefit/models/benefit.py b/odex25_ensan/odex_benefit/models/benefit.py
index eeef563d6..36206353f 100644
--- a/odex25_ensan/odex_benefit/models/benefit.py
+++ b/odex25_ensan/odex_benefit/models/benefit.py
@@ -393,11 +393,8 @@ class GrantBenefitProfile(models.Model):
('new', 'Researcher Assignment'),
('complete_info', 'Waiting for Researcher'),
('waiting_approve', 'Waiting for Operation Manager'),
- ('woman_manager', 'Woman Manager'),
- ('researcher_team', 'Researcher Team'),
- ('edit_info', 'Edit Information'),
- ('first_refusal', 'First Refusal'),
('first_approve', 'Waiting for Branch Manager'),
+ ('first_refusal', 'First Refusal'),
('second_approve', 'Second Approved'),
('refused', 'Refused'),
('temporarily_suspended', 'Temporarily suspended'),
@@ -406,7 +403,6 @@ class GrantBenefitProfile(models.Model):
('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, group_expand='_expand_states')
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
@@ -582,6 +578,13 @@ class GrantBenefitProfile(models.Model):
is_from_portal = fields.Boolean(string='is Created from Portal?', default=False, readonly=True)
applicant_name = fields.Char(readonly=True)
doc_count = fields.Integer(compute='_compute_attached_docs_count', string="Number of documents attached")
+ action_type = fields.Selection(selection=[
+ ('new', 'New'),
+ ('edit_info', 'Edit Information'),
+ ('approved', 'Approved'),
+ ('suspended', 'Suspended'),
+ ('exception', 'Exception'),
+ ], string='Action Type', default='new')
_sql_constraints = [
('unique_code', "unique (code) WHERE state NOT IN ('draft', 'new')", 'This code already exists')
@@ -1267,6 +1270,7 @@ class GrantBenefitProfile(models.Model):
for id in self.message_follower_ids.ids:
partner_ids.append(self.env['mail.followers'].search([('id', '=', id)]).partner_id)
self.state = "second_approve"
+ self.action_type = "approved"
self.sudo()._send_notification(partner_ids, rec.state)
# for member in self.member_ids:
# member.create_member_partner()
@@ -1378,19 +1382,6 @@ class GrantBenefitProfile(models.Model):
# @api.multi
def action_edit_info(self):
- # bank_val = {
- # 'acc_number': self.acc_number,
- # 'acc_holder_name': self.acc_holder_name,
- # 'bank_id': self.bank_id.id,
- # }
- # self.partner_id.write({
- # 'name': self.name,
- # 'email': self.email,
- # 'phone': self.phone,
- # 'account_type': 'family',
- # 'code': self.code,
- # 'bank_ids': [(0, 0, bank_val)]
- # })
user = self.user_id
if not user:
user = self.env['res.users'].sudo().search(
@@ -1406,11 +1397,8 @@ class GrantBenefitProfile(models.Model):
template = self.env.ref('odex_benefit.edit_benefit_email', False)
except:
pass
- self.state = 'edit_info'
-
- def not_alive(self):
- self.life = False
- self.state = 'not_leaving'
+ self.state = 'complete_info'
+ self.action_type = 'edit_info'
def action_suspend(self):
self.is_excluded_suspension = False
diff --git a/odex25_ensan/odex_benefit/models/benefit_config.py b/odex25_ensan/odex_benefit/models/benefit_config.py
index 2091ffc03..0cdcc55a5 100644
--- a/odex25_ensan/odex_benefit/models/benefit_config.py
+++ b/odex25_ensan/odex_benefit/models/benefit_config.py
@@ -613,6 +613,7 @@ class Committees(models.Model):
name = fields.Char()
employee_id = fields.Many2many('hr.employee')
+ # , domain = "[('gender', 'in', employee_gender_domain)]"
benefit_ids = fields.Many2many('grant.benefit',compute="get_benefit_ids")
type = fields.Selection(
string='',
@@ -623,6 +624,16 @@ class Committees(models.Model):
required=False, )
branch_custom_id = fields.Many2one("branch.settings", string="Branch")
active = fields.Boolean('Active', default=True)
+ benefit_count = fields.Integer(compute="get_benefit_count")
+ # employee_gender_domain = fields.Char(compute='_compute_employee_gender_domain')
+ #
+ # @api.depends('type')
+ # def _compute_employee_gender_domain(self):
+ # for record in self:
+ # if record.type in ['male', 'female']:
+ # record.employee_gender_domain = [record.type]
+ # else:
+ # record.employee_gender_domain = ['male', 'female']
def get_benefit_ids(self):
obj = self.env["grant.benefit"].search([])
@@ -632,6 +643,20 @@ class Committees(models.Model):
else:
self.write({'benefit_ids': []})
+ def get_benefit_count(self):
+ for record in self:
+ record.benefit_count = len(record.benefit_ids)
+
+ def action_view_benefits(self):
+ return {
+ 'name': _('Benefits'),
+ 'type': 'ir.actions.act_window',
+ 'res_model': 'grant.benefit',
+ 'view_mode': 'tree,form',
+ 'domain': [('id', 'in', self.benefit_ids.ids)],
+ 'target': 'current',
+ }
+
class ResDistricts(models.Model):
_name = 'res.districts'
diff --git a/odex25_ensan/odex_benefit/models/family_members.py b/odex25_ensan/odex_benefit/models/family_members.py
index 70b01d879..a290db0a3 100644
--- a/odex25_ensan/odex_benefit/models/family_members.py
+++ b/odex25_ensan/odex_benefit/models/family_members.py
@@ -188,11 +188,9 @@ class FamilyMemberProfile(models.Model):
# ('waiting_approve', 'Waiting Approved'),
# ('woman_manager', 'Woman Manager'),
# ('researcher_team', 'Researcher Team'),
- # ('edit_info', 'Edit Information'),
# ('first_refusal', 'First Refusal'),
# ('first_approve', 'Approved'),
# ('refused', 'Refused'),
- # ('not_leaving', 'Not Leaving'),
# ('black_list', 'Black List'),
# ], string='state', default="draft", tracking=True,related="benefit_id.state")
state = fields.Selection([
@@ -200,9 +198,6 @@ class FamilyMemberProfile(models.Model):
('new', 'New'),
('complete_info', 'Complete Information'),
('waiting_approve', 'Waiting Approved'),
- ('woman_manager', 'Woman Manager'),
- ('researcher_team', 'Researcher Team'),
- ('edit_info', 'Edit Information'),
('first_refusal', 'First Refusal'),
('first_approve', 'First Approved'),
('second_approve', 'Second Approved'),
@@ -214,16 +209,12 @@ class FamilyMemberProfile(models.Model):
('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', tracking=True,compute='_get_state',store = True)
state_a = fields.Selection([
('draft', 'Draft'),
('complete_info', 'Complete Information'),
('waiting_approve', 'Waiting Approved'),
- ('woman_manager', 'Woman Manager'),
- ('researcher_team', 'Researcher Team'),
- ('edit_info', 'Edit Information'),
('first_refusal', 'First Refusal'),
('first_approve', 'First Approved'),
('second_approve', 'Second Approved'),
@@ -235,7 +226,6 @@ class FamilyMemberProfile(models.Model):
('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)
member_status = fields.Selection(selection=[
@@ -807,22 +797,8 @@ class FamilyMemberProfile(models.Model):
'context': context,
}
def action_edit_info(self):
- # user = self.user_id
- # if not user:
- # user = self.env['res.users'].sudo().search(
- # [('partner_id', '=', self.partner_id.id), ('active', '=', False)])
- # if user:
- # user.write({'active': True})
- # else:
- # user = self.create_user()
- # group_e = self.env.ref('odex_benefit.group_benefit_edit', False)
- # try:
- # group_e.sudo().write({'users': [(4, user.id)]})
- # self.old_stage = self.state
- # template = self.env.ref('odex_benefit.edit_benefit_email', False)
- # except:
- # pass
- self.state = 'edit_info'
+ self.state = 'complete_info'
+
def action_finish_edit(self):
for rec in self:
# group_e = self.env.ref('odex_benefit.group_benefit_edit', False)
@@ -839,9 +815,6 @@ class FamilyMemberProfile(models.Model):
# 'researcher_team': rec.researcher_team.id,
'state': 'draft'
})
- def not_alive(self):
- self.life = False
- self.state_a = 'not_leaving'
@api.onchange('member_phone')
def _onchange_member_phone_validation(self):
diff --git a/odex25_ensan/odex_benefit/models/sms.py b/odex25_ensan/odex_benefit/models/sms.py
index dfd960737..bb94a5ea3 100644
--- a/odex25_ensan/odex_benefit/models/sms.py
+++ b/odex25_ensan/odex_benefit/models/sms.py
@@ -9,7 +9,6 @@ class SmsConfiguration(models.Model):
case_text = fields.Text("case Text", tracking=True)
state = fields.Selection([
('draft', 'Draft'),
- ('edit_info', 'Edit Information'),
('complete_info', 'Complete Information'),
('waiting_approve', 'Waiting Approved'),
('approve', 'Approved'),
diff --git a/odex25_ensan/odex_benefit/views/actions_and_menus.xml b/odex25_ensan/odex_benefit/views/actions_and_menus.xml
index 1a7abb31c..a3ddfde07 100644
--- a/odex25_ensan/odex_benefit/views/actions_and_menus.xml
+++ b/odex25_ensan/odex_benefit/views/actions_and_menus.xml
@@ -71,7 +71,7 @@
tree,form
{'create': False}
- [('state','in',['not_leaving','black_list'])]
+ [('state','in',['black_list'])]
diff --git a/odex25_ensan/odex_benefit/views/benefit_view.xml b/odex25_ensan/odex_benefit/views/benefit_view.xml
index 4a779adfe..d41c629f8 100644
--- a/odex25_ensan/odex_benefit/views/benefit_view.xml
+++ b/odex25_ensan/odex_benefit/views/benefit_view.xml
@@ -144,7 +144,7 @@
+ states="complete_info"/>
-
-
-
@@ -257,6 +254,16 @@
+
+
+
+
+
+
@@ -315,42 +323,53 @@
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
Father
+
+
+
+
+
+
+
+
+
-
-
+ attrs="{'required':[('state','=','complete_info')],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
@@ -361,28 +380,22 @@
-
-
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
@@ -402,19 +415,19 @@
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
@@ -424,45 +437,45 @@
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ 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)],'required':[('mother_is_dead','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'invisible':[('mother_is_dead','=',False)],'required':[('mother_is_dead','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('is_mother_work','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
@@ -480,19 +493,19 @@
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'invisible':[('replacement_mother_is_dead','=',False)],'required':[('replacement_mother_is_dead','=',True),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('state','not in',['draft','new']),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'required':[('replacement_is_mother_work','=',True),('add_replacement_mother','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
@@ -550,7 +563,7 @@
+ attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}">