Merge pull request #4492 from expsa/kchyounes_dev_odex25_ensan
Kchyounes dev odex25 ensan
This commit is contained in:
commit
be746a56b5
|
|
@ -2254,7 +2254,7 @@ msgstr "ادارة المستفيدين"
|
|||
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Benefit Member"
|
||||
msgstr "فردمستفيد"
|
||||
msgstr "فرد مستفيد"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__benefit_member_count
|
||||
|
|
@ -3158,8 +3158,6 @@ msgstr "عنوان الشركة"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__complete_info
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__complete_info
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__complete_info
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Complete Information"
|
||||
msgstr "إكمال البيانات"
|
||||
|
|
@ -4934,15 +4932,6 @@ msgstr "تاريخ نهاية الاستثناء"
|
|||
msgid "Exception Final Approve"
|
||||
msgstr "اعتماد المدير العام للاستثناء"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__exception_first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__exception_first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__exception_first_approve
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Exception First Approve"
|
||||
msgstr "اعتماد رئيس العمليات للاستثناء"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.actions.act_window,name:odex_benefit.exception_reason_action
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_exception_wizard__exception_reason
|
||||
|
|
@ -4964,8 +4953,8 @@ msgstr "رفض الاستثناء"
|
|||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__exception_second_approve
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Exception Second Approve"
|
||||
msgstr "اعتماد مدير الفرع للاستثناء"
|
||||
msgid "Waiting for General Manager"
|
||||
msgstr "بانتظار المدير العام"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_exception_wizard__exception_start_date
|
||||
|
|
@ -11085,13 +11074,6 @@ msgstr "نوع الإيقاف"
|
|||
msgid "Suspended First Approve"
|
||||
msgstr "اعتماد الإيقاف المبدئي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__suspended_first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__suspended_first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__suspended_first_approve
|
||||
msgid "Suspended First Approved"
|
||||
msgstr "اعتماد الإيقاف المبدئي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
msgid "Suspended Second Approve"
|
||||
|
|
@ -11143,10 +11125,7 @@ msgstr "نوع الفريق"
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__exception_wizard__exception_type__temporarily_exception
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__exception_type__temporarily_exception
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__temporarily_exception
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__temporarily_exception
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__exception_type__temporarily_exception
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__temporarily_exception
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.family_member_form
|
||||
msgid "Temporarily Exception"
|
||||
msgstr "استثناء مؤقت"
|
||||
|
|
@ -11161,13 +11140,6 @@ msgstr "استثناء مؤقت"
|
|||
msgid "Temporarily Suspended"
|
||||
msgstr "إيقاف مبدئي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__temporarily_suspended
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__temporarily_suspended
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__temporarily_suspended
|
||||
msgid "Temporarily suspended"
|
||||
msgstr "إيقاف مبدئي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
|
|
@ -12053,8 +12025,6 @@ msgstr "نوع الزيارة"
|
|||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_food_surplus__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_need__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__benefit_sms_configuration__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__receive_food_surplus__state__waiting_approve
|
||||
msgid "Waiting Approved"
|
||||
msgstr "بانتظار الموافقة"
|
||||
|
|
@ -12295,6 +12265,7 @@ msgstr "مع الزوج"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__new
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__new
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
msgid "New"
|
||||
msgstr "اسناد الاخصائي"
|
||||
|
|
@ -14734,13 +14705,13 @@ msgstr "هل أنت متأكد أنك تريد إرجاع هذا السجل إل
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Set To new"
|
||||
msgid "Set To for Researcher"
|
||||
msgstr "إرجاع للاخصائي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Are you sure you want to set the state to New?"
|
||||
msgstr "هل أنت متأكد أنك تريد تعيين الحالة إلى جديد؟"
|
||||
msgid "Are you sure you want to set the state to Waiting for Researcher?"
|
||||
msgstr "هل أنت متأكد أنك تريد الإرجاع للاخصائي؟"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
|
|
@ -14849,18 +14820,24 @@ msgstr "هل أنت متأكد أنك تريد إسناد الأخصائي؟"
|
|||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__complete_info
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__complete_info
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__complete_info
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
msgid "Waiting for Researcher"
|
||||
msgstr "بانتظار الاخصائي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__waiting_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__waiting_approve
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
msgid "Waiting for Operation Manager"
|
||||
msgstr "بانتظار رئيسة العمليات"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__exception_first_approve
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__exception_first_approve
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_search
|
||||
msgid "Waiting for Branch Manager"
|
||||
msgstr "بانتظار مدير الفرع"
|
||||
|
|
@ -15218,4 +15195,10 @@ msgstr "رمز التحقق OTP غير صالح. يرجى المحاولة مر
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model,name:odex_benefit.model_visit_skip_otp_wizard
|
||||
msgid "Skip OTP Reason Wizard"
|
||||
msgstr "معالج سبب تخطي رمز OTP"
|
||||
msgstr "معالج سبب تخطي رمز OTP"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
msgid "Please complete your pending visits before proceeding."
|
||||
msgstr "برجا اتمام الزيارة الاولية للأسرة لإستكمال الإجراء"
|
||||
|
|
@ -219,7 +219,7 @@ class GrantBenefitProfile(models.Model):
|
|||
mother_location_conf = fields.Many2one('location.settings',string='Mother Location',domain="[('location_type','=','mother_location')]")
|
||||
is_mother_work = fields.Boolean('Is Mother Work?')
|
||||
mother_has_disabilities = fields.Boolean('Has Disabilities?')
|
||||
mother_income = fields.Float("Mother Income")
|
||||
mother_income = fields.Float("Mother Income", digits=(16, 0))
|
||||
mother_birth_date = fields.Date(string="Birth Date")
|
||||
mother_age = fields.Integer(string="Age", compute='_compute_get_mother_age')
|
||||
mother_city_id = fields.Many2one('res.country.city', string='City')
|
||||
|
|
@ -403,12 +403,8 @@ class GrantBenefitProfile(models.Model):
|
|||
('first_refusal', 'First Refusal'),
|
||||
('second_approve', 'Second Approved'),
|
||||
('refused', 'Refused'),
|
||||
('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'),
|
||||
('exception_second_approve', 'Waiting for General Manager'),
|
||||
('black_list', 'Black List'),
|
||||
], string='state', default="draft", tracking=True, group_expand='_expand_states')
|
||||
branch_custom_id = fields.Many2one('branch.settings', string="Branch")
|
||||
|
|
@ -589,11 +585,16 @@ class GrantBenefitProfile(models.Model):
|
|||
('approved', 'Approved'),
|
||||
('suspended', 'Suspended'),
|
||||
('exception', 'Exception'),
|
||||
], string='Action Type', default='new')
|
||||
], string='Action Type', default='new', tracking=True)
|
||||
contact_type = fields.Selection([
|
||||
('email', 'Email'),
|
||||
('sms', 'SMS'),
|
||||
], string='Contact Type',default='sms')
|
||||
company_id = fields.Many2one('res.company', default=lambda self: self.env.company)
|
||||
currency_id = fields.Many2one(
|
||||
comodel_name='res.currency',
|
||||
string="Company Currency",
|
||||
related='company_id.currency_id')
|
||||
|
||||
_sql_constraints = [
|
||||
('unique_code', "unique (code) WHERE state NOT IN ('draft', 'new')", 'This code already exists')
|
||||
|
|
@ -1248,6 +1249,9 @@ class GrantBenefitProfile(models.Model):
|
|||
message = self.create_message('waiting_approve')
|
||||
self.partner_id.send_sms_notification(message, self.phone)
|
||||
for rec in self:
|
||||
visits = self.env['visit.location'].search([('benefit_id', '=', rec.id),('state', 'not in', ['close', 'done'])])
|
||||
if rec.action_type == 'new' and visits:
|
||||
raise ValidationError(_("Please complete your pending visits before proceeding."))
|
||||
# if not rec.benefit_category_id and not rec.member_income:
|
||||
# raise ValidationError(_("يرجى اكمال ادخال او الموافقة على القيم المرتبطة ببيانات الدخل والمرتب والالتزامات لتحديد فئة الاسرة بشكل صحيح"))
|
||||
#
|
||||
|
|
@ -1354,7 +1358,7 @@ class GrantBenefitProfile(models.Model):
|
|||
|
||||
def action_set_to_new(self):
|
||||
context = dict(self.env.context or {})
|
||||
context['target_state'] = "new"
|
||||
context['target_state'] = "complete_info"
|
||||
context['active_id'] = self.id
|
||||
return {
|
||||
'name': _('Return Reason Wizard'),
|
||||
|
|
@ -1456,11 +1460,10 @@ class GrantBenefitProfile(models.Model):
|
|||
'view_id': self.env.ref('odex_benefit.view_suspend_reason_wizard_form').id,
|
||||
'target': 'new',
|
||||
}
|
||||
# rec.state = 'temporarily_suspended'
|
||||
|
||||
def action_suspend_first_accept(self):
|
||||
for rec in self:
|
||||
rec.state = 'suspended_first_approve'
|
||||
rec.state = 'first_approve'
|
||||
|
||||
def action_suspend_second_accept(self):
|
||||
for rec in self:
|
||||
|
|
@ -1483,7 +1486,8 @@ class GrantBenefitProfile(models.Model):
|
|||
if attachment.attach_status == 'expired':
|
||||
# Change state to temporarily suspended if there are benefit members
|
||||
if grant.benefit_member_count != 0:
|
||||
grant.state = 'temporarily_suspended'
|
||||
grant.state = 'waiting_approve'
|
||||
grant.action_type = 'suspended'
|
||||
grant.suspend_method = 'auto'
|
||||
break # Exit attachment loop after processing
|
||||
|
||||
|
|
@ -1493,7 +1497,8 @@ class GrantBenefitProfile(models.Model):
|
|||
if member_attachment.attach_status == 'expired':
|
||||
# Change state to temporarily suspended if there are benefit members
|
||||
if grant.benefit_member_count != 0:
|
||||
grant.state = 'temporarily_suspended'
|
||||
grant.state = 'waiting_approve'
|
||||
grant.action_type = 'suspended'
|
||||
grant.suspend_method = 'auto'
|
||||
break # Exit member attachment loop after processing
|
||||
|
||||
|
|
@ -1517,7 +1522,7 @@ class GrantBenefitProfile(models.Model):
|
|||
|
||||
def action_exception_first_accept(self):
|
||||
for rec in self:
|
||||
rec.state = 'exception_first_approve'
|
||||
rec.state = 'first_approve'
|
||||
|
||||
def action_exception_second_accept(self):
|
||||
for rec in self:
|
||||
|
|
@ -1543,6 +1548,8 @@ class GrantBenefitProfile(models.Model):
|
|||
def action_exception_refuse(self):
|
||||
for rec in self:
|
||||
rec.state = 'suspended_second_approve'
|
||||
rec.action_type = 'suspended'
|
||||
|
||||
# @api.multi
|
||||
def action_remove_from_black_list(self):
|
||||
"""Remove entity from black list"""
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class FamilyComplaints(models.Model):
|
|||
|
||||
|
||||
complaints_date = fields.Datetime(string="Complaints Date",default=fields.Datetime.now)
|
||||
family_id = fields.Many2one('grant.benefit',string='Family',domain="['|','|',('state','=','second_approve'),('state','=','temporarily_suspended'),('state','=','suspended_first_approve')]")
|
||||
family_id = fields.Many2one('grant.benefit',string='Family',domain="['|',('state','=','second_approve'),'&',('state','in',['waiting_approve','first_approve']),('action_type','=','suspended')]")
|
||||
researcher_id = fields.Many2one("committees.line", string="Researcher",related="family_id.researcher_id")
|
||||
branch_custom_id = fields.Many2one('branch.settings', string="Branch",related='family_id.branch_custom_id')
|
||||
complaints_reason = fields.Char(string="Complaints Reason")
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ class ConfirmBenefitExpense(models.Model):
|
|||
# Define base domain for family selection
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
|
||||
# base_domain = [('state', 'in', ('second_approve', 'temporarily_suspend', 'suspend'))]
|
||||
base_domain = [('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve'))]
|
||||
# base_domain = ['|',('state','=','second_approve'),'&',('state','=',('waiting_approve','first_approve')),('action_type','=','suspended')]
|
||||
base_domain = ['|',('state','=','second_approve'),'&',('state','in',('waiting_approve','first_approve')),('action_type','=','suspended')]
|
||||
if rec.branch_custom_id:
|
||||
base_domain.append(('branch_custom_id', '=', rec.branch_custom_id.id))
|
||||
min_income = validation_setting.benefit_category_ids.mapped('mini_income_amount')
|
||||
|
|
@ -260,7 +260,7 @@ class ConfirmBenefitExpense(models.Model):
|
|||
# Define base domain for family selection
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
|
||||
base_domain = [('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve'))]
|
||||
base_domain = ['|',('state','=','second_approve'),'&',('state','in',('waiting_approve','first_approve')),('action_type','=','suspended')]
|
||||
if self.branch_custom_id:
|
||||
base_domain.append(('branch_custom_id', '=', self.branch_custom_id.id))
|
||||
min_income = validation_setting.benefit_category_ids.mapped('mini_income_amount')
|
||||
|
|
@ -305,10 +305,10 @@ class ConfirmBenefitExpense(models.Model):
|
|||
for rec in self:
|
||||
if rec.expense_type == 'family_expense':
|
||||
benefits = rec.family_ids
|
||||
if any(benefit.state not in ('second_approve', 'temporarily_suspended', 'suspended_first_approve') for benefit in
|
||||
if any(benefit.state != 'second_approve' or not (benefit.state in ('waiting_approve', 'first_approve') and benefit.action_type == 'suspended') for benefit in
|
||||
benefits):
|
||||
raise UserError(_("All selected benefits should be either state of "
|
||||
"'second_approve','temporarily_suspended','suspended_first_approve' state."))
|
||||
"'second_approve','waiting_approve','first_approve' state."))
|
||||
|
||||
validation_setting = self.env["family.validation.setting"].search([], limit=1)
|
||||
|
||||
|
|
|
|||
|
|
@ -195,39 +195,38 @@ class FamilyMemberProfile(models.Model):
|
|||
# ], string='state', default="draft", tracking=True,related="benefit_id.state")
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('new', 'New'),
|
||||
('complete_info', 'Complete Information'),
|
||||
('waiting_approve', 'Waiting Approved'),
|
||||
('new', 'Researcher Assignment'),
|
||||
('complete_info', 'Waiting for Researcher'),
|
||||
('waiting_approve', 'Waiting for Operation Manager'),
|
||||
('first_approve', 'Waiting for Branch Manager'),
|
||||
('first_refusal', 'First Refusal'),
|
||||
('first_approve', 'First Approved'),
|
||||
('second_approve', 'Second Approved'),
|
||||
('refused', 'Refused'),
|
||||
('temporarily_suspended', 'Temporarily suspended'),
|
||||
('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'),
|
||||
('exception_second_approve', 'Waiting for General Manager'),
|
||||
('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'),
|
||||
('new', 'Researcher Assignment'),
|
||||
('complete_info', 'Waiting for Researcher'),
|
||||
('waiting_approve', 'Waiting for Operation Manager'),
|
||||
('first_approve', 'Waiting for Branch Manager'),
|
||||
('first_refusal', 'First Refusal'),
|
||||
('first_approve', 'First Approved'),
|
||||
('second_approve', 'Second Approved'),
|
||||
('refused', 'Refused'),
|
||||
('temporarily_suspended', 'Temporarily suspended'),
|
||||
('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'),
|
||||
('exception_second_approve', 'Waiting for General Manager'),
|
||||
('black_list', 'Black List'),
|
||||
], string='stateA', default="draft", tracking=True)
|
||||
action_type = fields.Selection(selection=[
|
||||
('new', 'New'),
|
||||
('edit_info', 'Edit Information'),
|
||||
('approved', 'Approved'),
|
||||
('suspended', 'Suspended'),
|
||||
('exception', 'Exception'),
|
||||
], string='Action Type', default='new', tracking=True)
|
||||
member_status = fields.Selection(selection=[
|
||||
('benefit', 'Benefit'),
|
||||
('non_benefit', 'Non Benefit'),
|
||||
|
|
@ -670,7 +669,7 @@ class FamilyMemberProfile(models.Model):
|
|||
}
|
||||
def action_suspend_first_accept(self):
|
||||
for rec in self:
|
||||
rec.state_a = 'suspended_first_approve'
|
||||
rec.state_a = 'first_approve'
|
||||
def action_suspend_second_accept(self):
|
||||
for rec in self:
|
||||
rec.state_a = 'suspended_second_approve'
|
||||
|
|
@ -694,7 +693,7 @@ class FamilyMemberProfile(models.Model):
|
|||
|
||||
def action_exception_first_accept(self):
|
||||
for rec in self:
|
||||
rec.state_a = 'exception_first_approve'
|
||||
rec.state_a = 'first_approve'
|
||||
|
||||
def action_exception_second_accept(self):
|
||||
for rec in self:
|
||||
|
|
@ -706,7 +705,7 @@ class FamilyMemberProfile(models.Model):
|
|||
for rec in self:
|
||||
rec.is_excluded_suspension = True
|
||||
rec.state_a = 'second_approve'
|
||||
# rec.is_member_workflow = False
|
||||
rec.is_member_workflow = False
|
||||
|
||||
def action_auto_exception(self):
|
||||
obj = self.env["family.member"].search(
|
||||
|
|
@ -719,7 +718,6 @@ class FamilyMemberProfile(models.Model):
|
|||
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):
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class SeasonalService(models.Model):
|
|||
def get_families(self):
|
||||
if self.family_ids:
|
||||
self.family_ids.unlink()
|
||||
domain = ['|', '|', ('state', '=', 'second_approve'), ('state', '=', 'temporarily_suspended'), ('state', '=', 'suspended_first_approve')]
|
||||
domain = ['|', ('state', '=', 'second_approve'), '&', ('state', 'in', ('waiting_approve','first_approve')),('action_type', '=', 'suspended')]
|
||||
if self.branch_ids:
|
||||
domain.append(('branch_custom_id', 'in', self.branch_ids.ids)) # Filter by selected branches
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ class SeasonalGrantBenefit(models.Model):
|
|||
|
||||
@api.onchange('family_id')
|
||||
def get_family_id_domain(self):
|
||||
domain = ['|', '|', ('state', '=', 'second_approve'), ('state', '=', 'temporarily_suspended'), ('state', '=', 'suspended_first_approve')]
|
||||
domain = ['|', ('state', '=', 'second_approve'), '&', ('state', 'in', ('waiting_approve','first_approve')),('action_type', '=', 'suspended')]
|
||||
if self.seasonal_service_id:
|
||||
if self.seasonal_service_id.branch_ids:
|
||||
domain.append(('branch_custom_id', 'in', self.seasonal_service_id.branch_ids.ids)) # Filter by selected branches
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class ServiceRequest(models.Model):
|
|||
# rent_lines = fields.One2many('rent.lines','services_settings_id')
|
||||
benefit_type = fields.Selection(string='Benefit Type',selection=[('family', 'Family'),('member', 'Member')])
|
||||
date = fields.Datetime(string='Request Date',default=fields.Datetime.now)
|
||||
family_id = fields.Many2one('grant.benefit',string='Family',domain="['|','|',('state','=','second_approve'),('state','=','temporarily_suspended'),('state','=','suspended_first_approve')]")
|
||||
family_id = fields.Many2one('grant.benefit',string='Family',domain="['|',('state','=','second_approve'),'&',('state','in',['waiting_approve','first_approve']),('action_type','=','suspended')]")
|
||||
researcher_id = fields.Many2one("committees.line", string="Researcher", related="family_id.researcher_id",store=True)
|
||||
family_category = fields.Many2one('benefit.category',string='Family Category',related='family_id.benefit_category_id')
|
||||
benefit_member_count = fields.Integer(string="Benefit Member count", related='family_id.benefit_member_count')
|
||||
|
|
|
|||
|
|
@ -118,30 +118,18 @@
|
|||
string="First Accept" class="oe_highlight"
|
||||
confirm="Are you sure you want to accept ?"
|
||||
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
|
||||
attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','first_refusal'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','not in',['new','edit_info']),('state','not in',['waiting_approve'])]}"/>
|
||||
<button name="action_second_accepted" type="object"
|
||||
string="Second Accept" class="oe_highlight"
|
||||
confirm="Are you sure you want to accept ?"
|
||||
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
|
||||
attrs="{'invisible': ['|',('action_type','in',['new','edit_info']),('state','not in',['first_approve','first_refusal'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','not in',['new','edit_info']),('state','not in',['first_approve'])]}"/>
|
||||
<button name="action_refuse" type="object"
|
||||
string="Final Refuse" class="oe_highlight"
|
||||
confirm="Are you sure you want to final refuse ?"
|
||||
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
|
||||
states="first_refusal"
|
||||
/>
|
||||
<button name="action_first_refusal" type="object"
|
||||
string="First Refuse" class="btn btn-danger"
|
||||
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"
|
||||
attrs="{'invisible': ['|',('action_type','!=','new'),('state','not in',['waiting_approve'])]}"
|
||||
/>
|
||||
<button name="action_set_to_new" type="object"
|
||||
string="Set To new" class="btn btn-warning"
|
||||
confirm="Are you sure you want to set the state to New?"
|
||||
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
|
||||
attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','first_approve'])]}"
|
||||
/>
|
||||
<button name="complete_data" type="object"
|
||||
string="Researcher Assignment" class="oe_highlight"
|
||||
confirm="Are you sure you want to Researcher assignment ?"
|
||||
|
|
@ -151,9 +139,21 @@
|
|||
string="Finish Complete" class="oe_highlight"
|
||||
confirm="Are you sure you want to Finish Complete data ?"
|
||||
states="complete_info"/>
|
||||
<button name="action_first_refusal" type="object"
|
||||
string="First Refuse" class="btn btn-danger"
|
||||
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,odex_benefit.group_benefit_researcher"
|
||||
attrs="{'invisible': ['|',('action_type','!=','new'),('state','not in',['waiting_approve','complete_info'])]}"
|
||||
/>
|
||||
<button name="action_set_to_new" type="object"
|
||||
string="Set To for Researcher" class="btn btn-warning"
|
||||
confirm="Are you sure you want to set the state to Waiting for Researcher?"
|
||||
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
|
||||
attrs="{'invisible': ['|',('action_type','not in',['new','edit_info']),('state','not in',['waiting_approve','first_approve','refused','first_refusal'])]}"
|
||||
/>
|
||||
<button name="action_black_list" type="object"
|
||||
string="Black List" class="btn btn-dark"
|
||||
attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','refused'])]}"
|
||||
string="Black List" class="btn btn-dark-grey"
|
||||
attrs="{'invisible': ['|',('action_type','not in',['new','edit_info']),('state','not in',['waiting_approve','refused'])]}"
|
||||
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
|
||||
confirm="Are you sure you want to move to black list ?"/>
|
||||
<button name="action_suspend" type="object"
|
||||
|
|
@ -167,10 +167,10 @@
|
|||
<button name="action_suspend_second_accept" type="object"
|
||||
string="Second Approve" class="oe_highlight"
|
||||
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
|
||||
states="suspended_first_approve"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"/>
|
||||
<button name="action_suspend_refuse" type="object"
|
||||
string="Suspend Refuse" class="oe_highlight"
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','suspended_first_approve','suspended_second_approve'])]}"
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','first_approve','suspended_second_approve'])]}"
|
||||
/>
|
||||
<!-- Exception -->
|
||||
<button name="action_exception" type="object"
|
||||
|
|
@ -180,17 +180,18 @@
|
|||
<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"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve'])]}"/>
|
||||
<button name="action_exception_second_accept" type="object"
|
||||
string="Exception Second Approve" class="oe_highlight"
|
||||
states="exception_first_approve"
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}"
|
||||
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
|
||||
<button name="action_exception_final_accept" type="object"
|
||||
string="Exception Final Approve" class="oe_highlight"
|
||||
states="exception_second_approve" groups="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"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','first_approve','exception_second_approve'])]}"
|
||||
/>
|
||||
<button name="action_edit_info" type="object"
|
||||
string="Open Edit Info" class="btn btn-info"
|
||||
groups="odex_benefit.group_benefit_edit"
|
||||
|
|
@ -292,7 +293,9 @@
|
|||
<!-- required="1"-->
|
||||
<!-- required="1"-->
|
||||
<field name="benefit_category_id" readonly="1" force_save="1"/>
|
||||
<field name="member_income" readonly="1" force_save="1"/>
|
||||
<field name="company_id"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="member_income" widget="monetary" options="{'currency_field': 'currency_id'}" 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"
|
||||
|
|
@ -492,7 +495,7 @@
|
|||
attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||
<field name="mother_has_disabilities"
|
||||
attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||
<field name="mother_income"
|
||||
<field name="mother_income" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': False}" digits="[16,0]"
|
||||
attrs="{'required':[('is_mother_work','=',True)],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||
<field name="is_alhaju" widget="radio"
|
||||
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
|
||||
|
|
@ -1188,7 +1191,7 @@
|
|||
</group>
|
||||
</page>
|
||||
<page string="Suspend Reason"
|
||||
attrs="{'invisible': [('action_type','!=','suspended')]}"
|
||||
attrs="{'invisible': [('action_type','not in',['suspended','exception'])]}"
|
||||
>
|
||||
<group>
|
||||
<group>
|
||||
|
|
@ -1203,7 +1206,7 @@
|
|||
</group>
|
||||
</page>
|
||||
<page string="Exception"
|
||||
attrs="{'invisible': [('state', 'not in', ['temporarily_exception','exception_first_approve','exception_second_approve']),('is_excluded_suspension','=',False)]}">
|
||||
attrs="{'invisible': [('action_type', 'not in', ['exception']),('is_excluded_suspension','=',False)]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="exception_start_date"/>
|
||||
|
|
@ -1483,9 +1486,9 @@
|
|||
domain="[('state','=','first_approve')]"/>
|
||||
<separator/>
|
||||
<filter string="Temporarily Suspended" name="temporarily_suspended"
|
||||
domain="[('state','=','temporarily_suspended')]"/>
|
||||
domain="[('state','=','waiting_approve'),('action_type','=','suspended')]"/>
|
||||
<filter string="Suspended First Approve" name="suspended_first_approve"
|
||||
domain="[('state', '=', 'suspended_first_approve')]"/>
|
||||
domain="[('state', '=', 'first_approve'),('action_type','=','suspended')]"/>
|
||||
<filter string="Suspended Second Approve" name="suspended_second_approve"
|
||||
domain="[('state', '=', 'suspended_second_approve')]"/>
|
||||
<filter string="Manual Suspended" name="manual_suspend"
|
||||
|
|
|
|||
|
|
@ -6,19 +6,23 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Family Member">
|
||||
<header>
|
||||
<!-- Suspend -->
|
||||
<button name="action_suspend" type="object"
|
||||
string="Temporarily Suspended" class="oe_highlight"
|
||||
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','not in',['temporarily_suspended'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve'])]}"
|
||||
/>
|
||||
<button name="action_suspend_second_accept" type="object"
|
||||
string="Second Approve" class="oe_highlight"
|
||||
attrs="{'invisible': [('state','not in',['suspended_first_approve'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['first_approve'])]}"
|
||||
/>
|
||||
<button name="action_suspend_refuse" type="object"
|
||||
string="Suspend Refuse" class="oe_highlight"
|
||||
attrs="{'invisible': [('state','not in',['temporarily_suspended','suspended_first_approve'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','first_approve','suspended_second_approve'])]}"
|
||||
/>
|
||||
<!-- Exception -->
|
||||
<button name="action_exception" type="object"
|
||||
string="Temporarily Exception" class="oe_highlight"
|
||||
|
|
@ -27,22 +31,24 @@
|
|||
<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'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state','not in',['waiting_approve'])]}"/>
|
||||
<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'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['first_approve'])]}"
|
||||
/>
|
||||
<button name="action_exception_final_accept" type="object"
|
||||
string="Exception Final Approve" class="oe_highlight"
|
||||
attrs="{'invisible': [('state','not in',['exception_second_approve'])]}"
|
||||
groups="odex_benefit.group_benefit_manager"/>
|
||||
<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'])]}"/>
|
||||
attrs="{'invisible': ['|',('action_type','!=','exception'),('state', 'not in', ['waiting_approve','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"/>
|
||||
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"/>
|
||||
<field name="state_a" widget="statusbar"
|
||||
statusbar_visible="draft,complete_info,waiting_approve,first_approve,second_approve,first_refusal,refused,temporarily_suspended"
|
||||
statusbar_visible="draft,new,complete_info,waiting_approve,first_approve,second_approve"
|
||||
invisible="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
|
@ -52,6 +58,7 @@
|
|||
widget="statinfo"/>
|
||||
</button>
|
||||
</div>
|
||||
<field name="action_type"/>
|
||||
<field name="is_member_workflow" invisible="1"/>
|
||||
<widget name="web_ribbon" title="Non Benefit Member" bg_color="bg-danger"
|
||||
attrs="{'invisible': ['|',('member_status', '=', False),('member_status', '!=', 'non_benefit')]}"/>
|
||||
|
|
@ -97,7 +104,7 @@
|
|||
invisible="1"/>
|
||||
<field name="member_phone"
|
||||
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
<field name="member_location_conf"
|
||||
<field name="member_location_conf" required="1"
|
||||
attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>
|
||||
</group>
|
||||
<group>
|
||||
|
|
@ -264,8 +271,7 @@
|
|||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Suspend Reason"
|
||||
attrs="{'invisible': [('state_a', 'not in', ['temporarily_suspended','suspended_first_approve','suspended_second_approve'])]}">
|
||||
<page string="Suspend Reason" attrs="{'invisible': [('action_type','not in',['suspended','exception'])]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="suspend_reason"/>
|
||||
|
|
@ -279,7 +285,7 @@
|
|||
</group>
|
||||
</page>
|
||||
<page string="Exception"
|
||||
attrs="{'invisible': [('state_a', 'not in', ['temporarily_exception','exception_first_approve','exception_second_approve'])]}">
|
||||
attrs="{'invisible': [('action_type','not in',['exception'])]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="exception_start_date"/>
|
||||
|
|
@ -330,6 +336,25 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="family_member_search" model="ir.ui.view">
|
||||
<field name="name">family.member.search</field>
|
||||
<field name="model">family.member</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name"/>
|
||||
<field name="member_first_name"/>
|
||||
<field name="member_second_name"/>
|
||||
<field name="member_third_name"/>
|
||||
<field name="member_family_name"/>
|
||||
<field name="benefit_id"/>
|
||||
<group string="Group By">
|
||||
<filter string="State" name="state" context="{'group_by': 'state'}"/>
|
||||
<filter string="Benefit" name="benefit_id" context="{'group_by': 'benefit_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Action for family members -->
|
||||
<record model="ir.actions.act_window" id="family_member_action">
|
||||
<field name="name">Family Members</field>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<field name="name">visit.location.kanban</field>
|
||||
<field name="model">visit.location</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban default_group_by="state" quick_create="false">
|
||||
<kanban default_group_by="state" quick_create="false" records_draggable="0">
|
||||
<field name="name"/>
|
||||
<field name="color"/>
|
||||
<field name="visit_date"/>
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class EntityReturnReasonWizard(models.TransientModel):
|
|||
return self._context.get('active_id')
|
||||
|
||||
def _get_target_state(self):
|
||||
return self._context.get('target_state', 'new')
|
||||
return self._context.get('target_state', 'complete_info')
|
||||
|
||||
entity_id = fields.Many2one("grant.benefit", string="Benefit", default=_default_entity)
|
||||
return_reason = fields.Text(string='Return Reason', required=True)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ class ExceptionWizard(models.TransientModel):
|
|||
|
||||
def action_submit(self):
|
||||
for rec in self:
|
||||
rec.entity_id.state = 'temporarily_exception'
|
||||
rec.entity_id.state = 'waiting_approve'
|
||||
rec.entity_id.action_type = 'exception'
|
||||
rec.entity_id.exception_start_date = rec.exception_start_date
|
||||
rec.entity_id.exception_end_date = rec.exception_end_date
|
||||
rec.entity_id.exception_reason = rec.exception_reason
|
||||
|
|
@ -41,8 +42,9 @@ class ExceptionWizard(models.TransientModel):
|
|||
|
||||
def action_member_submit(self):
|
||||
for rec in self:
|
||||
rec.member_id.state_a = 'temporarily_exception'
|
||||
rec.member_id.state = 'temporarily_exception'
|
||||
rec.member_id.state_a = 'waiting_approve'
|
||||
rec.member_id.state = 'waiting_approve'
|
||||
rec.member_id.action_type = 'exception'
|
||||
rec.member_id.exception_start_date = rec.exception_start_date
|
||||
rec.member_id.exception_end_date = rec.exception_end_date
|
||||
rec.member_id.exception_reason = rec.exception_reason
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SuspendReasonWizard(models.TransientModel):
|
|||
def action_member_submit(self):
|
||||
for rec in self:
|
||||
rec.member_id.state_a = 'waiting_approve'
|
||||
rec.entity_id.action_type = 'suspended'
|
||||
rec.member_id.action_type = 'suspended'
|
||||
rec.member_id.suspend_reason = rec.suspend_reason
|
||||
rec.member_id.suspend_description = rec.suspend_description
|
||||
rec.member_id.suspend_type = rec.suspend_type
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ class TakafulSponsorship(models.Model):
|
|||
if self.benefit_type == 'orphan' and self.sponsorship_type:
|
||||
base_domain = \
|
||||
[
|
||||
('state', 'in', ['second_approve', 'temporarily_suspended', 'suspended_first_approve']),
|
||||
'|', ('state', '=', 'second_approve'), '&', ('state', 'in', ('waiting_approve', 'first_approve')),('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'),
|
||||
'|',
|
||||
('relationn.relation_type', '=', 'daughter'),
|
||||
|
|
@ -607,11 +607,12 @@ class TakafulSponsorship(models.Model):
|
|||
if self.gender:
|
||||
if self.gender == 'female':
|
||||
base_domain = [
|
||||
('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve')),
|
||||
'|', ('state', '=', 'second_approve'), '&',
|
||||
('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'), ('relationn.relation_type', '=', 'daughter')]
|
||||
if self.gender == 'male':
|
||||
base_domain = [
|
||||
('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve')),
|
||||
'|', ('state', '=', 'second_approve'), '&',('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'),('relationn.relation_type', '=', 'son')]
|
||||
if self.education_status:
|
||||
base_domain.append(('education_status', '=', self.education_status))
|
||||
|
|
@ -627,7 +628,7 @@ class TakafulSponsorship(models.Model):
|
|||
self.benefit_count = 0
|
||||
self.min_needs_percent = 0
|
||||
self.max_needs_percent = 0
|
||||
base_domain = [('state', 'in', ['second_approve', 'temporarily_suspended', 'suspended_first_approve']),('member_status','=','benefit'),'|',('relationn.relation_type', '=', 'mother'),('relationn.relation_type', '=', 'replacement_mother')]
|
||||
base_domain = ['|',('state','=','second_approve'),'&',('state','in',('waiting_approve','first_approve')),('action_type','=','suspended'),('member_status','=','benefit'),'|',('relationn.relation_type', '=', 'mother'),('relationn.relation_type', '=', 'replacement_mother')]
|
||||
if self.education_status:
|
||||
base_domain.append(('education_status', '=', self.education_status))
|
||||
if self.education_level:
|
||||
|
|
@ -2069,7 +2070,7 @@ class DonationsDetailsLines(models.Model):
|
|||
if rec.benefit_type == 'orphan' and rec.sponsorship_type:
|
||||
base_domain = \
|
||||
[
|
||||
('state', 'in', ['second_approve', 'temporarily_suspended', 'suspended_first_approve']),
|
||||
'|', ('state', '=', 'second_approve'), '&',('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'),
|
||||
'|',
|
||||
('relationn.relation_type', '=', 'daughter'),
|
||||
|
|
@ -2078,11 +2079,12 @@ class DonationsDetailsLines(models.Model):
|
|||
if rec.gender:
|
||||
if rec.gender == 'female':
|
||||
base_domain = [
|
||||
('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve')),
|
||||
'|', ('state', '=', 'second_approve'), '&',
|
||||
('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'), ('relationn.relation_type', '=', 'daughter')]
|
||||
if rec.gender == 'male':
|
||||
base_domain = [
|
||||
('state', 'in', ('second_approve', 'temporarily_suspended', 'suspended_first_approve')),
|
||||
'|', ('state', '=', 'second_approve'), '&',('state', 'in', ('waiting_approve', 'first_approve')), ('action_type', '=', 'suspended'),
|
||||
('member_status', '=', 'benefit'), ('relationn.relation_type', '=', 'son')]
|
||||
if rec.education_status:
|
||||
base_domain.append(('education_status', '=', rec.education_status))
|
||||
|
|
@ -2096,7 +2098,7 @@ class DonationsDetailsLines(models.Model):
|
|||
domain = {'benefit_id': [('id', 'in', rec.members_domain_ids.ids)]}
|
||||
return {'domain': domain}
|
||||
if rec.benefit_type == 'widow' and rec.sponsorship_type:
|
||||
base_domain = [('state', 'in', ['second_approve', 'temporarily_suspended', 'suspended_first_approve']),
|
||||
base_domain = ['|',('state','=','second_approve'),'&',('state','in',('waiting_approve','first_approve')),('action_type','=','suspended'),
|
||||
('member_status', '=', 'benefit'), '|', ('relationn.relation_type', '=', 'mother'),
|
||||
('relationn.relation_type', '=', 'replacement_mother')]
|
||||
if rec.education_status:
|
||||
|
|
@ -2111,7 +2113,7 @@ class DonationsDetailsLines(models.Model):
|
|||
domain = {'benefit_id': [('id', 'in', rec.members_domain_ids.ids)]}
|
||||
return {'domain': domain}
|
||||
if rec.benefit_type == 'both' and rec.sponsorship_type:
|
||||
base_domain = [('state', 'in', ['second_approve', 'temporarily_suspended', 'suspended_first_approve']),
|
||||
base_domain = ['|',('state','=','second_approve'),'&',('state','in',('waiting_approve','first_approve')),('action_type','=','suspended'),
|
||||
('member_status', '=', 'benefit')]
|
||||
if rec.education_status:
|
||||
base_domain.append(('education_status', '=', rec.education_status))
|
||||
|
|
|
|||
|
|
@ -99,7 +99,8 @@ class ReplacementWiz(models.TransientModel):
|
|||
sponsorship_id.donations_details_lines_mechanism_ids.mapped('benefit_id').ids +
|
||||
sponsorship_id.donations_details_lines_mechanism_ids.mapped('benefit_ids').ids
|
||||
))
|
||||
domain = [('state', 'in', ['second_approve', 'temporarily_suspended'])]
|
||||
|
||||
domain = ['|', ('state', '=', 'second_approve'), '&', ('state', '=', 'waiting_approve'),('action_type', '=', 'suspended')]
|
||||
if self.branch_id:
|
||||
domain.append(('branch_custom_id', '=', self.branch_id.id))
|
||||
if self.family_category_ids:
|
||||
|
|
|
|||
Loading…
Reference in New Issue