IMP benefit

This commit is contained in:
younes 2025-08-27 16:35:02 +01:00
parent 5ccaab9e4e
commit 8bb2cf046c
5 changed files with 67 additions and 48 deletions

View File

@ -4564,7 +4564,6 @@ msgstr ""
#: model:ir.model.fields.selection,name:odex_benefit.selection__external_request__state__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__external_request__state__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__state_a__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__receive_appliances_furniture__state__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__receive_appliances_furniture__state__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__receive_benefit_loans__state__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__receive_benefit_loans__state__draft
#: model:ir.model.fields.selection,name:odex_benefit.selection__receive_benefit_zkat__state__draft #: model:ir.model.fields.selection,name:odex_benefit.selection__receive_benefit_zkat__state__draft
@ -4576,6 +4575,11 @@ msgstr ""
msgid "Draft" msgid "Draft"
msgstr "مسودة" msgstr "مسودة"
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__draft
msgid "Draft"
msgstr "بانتظار الاسرة"
#. module: odex_benefit #. 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__benefit_sms_configuration__state__edit_info
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__edit_info #: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__action_type__edit_info
@ -14642,7 +14646,7 @@ msgstr "هل أنت متأكد أنك تريد إرجاع هذا السجل إل
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Set To new" msgid "Set To new"
msgstr "إرجاع إلى جديد" msgstr "إرجاع للاخصائي"
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
@ -14732,7 +14736,7 @@ msgstr "يسمح للمستخدم بإعادة ملف المستفيد إلى ح
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
msgid "Set to Draft" msgid "Set to Draft"
msgstr "إرجاع إلى المسودة" msgstr "إرجاع إلى الاسرة"
#. module: odex_benefit #. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form #: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form

View File

@ -429,7 +429,6 @@ class GrantBenefitProfile(models.Model):
required=False, required=False,
states={ states={
'second_approve': [('readonly', True)], 'second_approve': [('readonly', True)],
'complete_info': [('required', True)]
} }
) )
zip = fields.Char('Zip', change_default=True, readonly=False, store=True) zip = fields.Char('Zip', change_default=True, readonly=False, store=True)
@ -1232,7 +1231,7 @@ class GrantBenefitProfile(models.Model):
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'res_model': 'researcher.family.wizard', 'res_model': 'researcher.family.wizard',
'view_id': self.env.ref('odex_benefit.view_resarcher_family_wizard_form').id, 'view_id': self.env.ref('odex_benefit.view_resarcher_family_wizard_form').id,
'target': 'current', 'target': 'new',
} }
def finish_complete_data(self): def finish_complete_data(self):
@ -1268,6 +1267,22 @@ class GrantBenefitProfile(models.Model):
def action_second_accepted(self): def action_second_accepted(self):
"""Accept registration""" """Accept registration"""
for rec in self: for rec in self:
messages = []
if not rec.acc_number:
messages.append(_("Account Number is required."))
if not rec.iban_document:
messages.append(_("IBAN Document is required."))
if not rec.bank_id:
messages.append(_("Bank is required."))
if not rec.is_family_member and not rec.acc_holder_name:
messages.append(_("Account Holder Name is required for non-family members."))
if rec.is_family_member and not rec.family_member_id:
messages.append(_("Family Member must be selected."))
if messages:
raise UserError("\n".join(messages))
if not rec.user_id: if not rec.user_id:
self.create_user() self.create_user()
@ -1475,6 +1490,7 @@ class GrantBenefitProfile(models.Model):
def action_suspend_refuse(self): def action_suspend_refuse(self):
for rec in self: for rec in self:
rec.state = 'second_approve' rec.state = 'second_approve'
rec.action_type = 'approved'
rec.get_member_income() rec.get_member_income()
#Excption Work flow #Excption Work flow

View File

@ -17,10 +17,10 @@ class Visit(models.Model):
('family', 'Family'), ('family', 'Family'),
], string='Type', default="benefit") ], string='Type', default="benefit")
benefit_id = fields.Many2one( benefit_id = fields.Many2one(
'grant.benefit',string='Family file',domain="[('researcher_id','=',researcher_team),('state', '=', 'second_approve')]") 'grant.benefit',string='Family file',domain="[('state', '=', 'second_approve')]")
benefit_name = fields.Char(related="benefit_id.name") benefit_name = fields.Char(related="benefit_id.name")
benefit_code= fields.Char(related="benefit_id.code") benefit_code= fields.Char(related="benefit_id.code")
researcher_team = fields.Many2one("committees.line", string="Researcher Team", default=_default_researcher_team) researcher_team = fields.Many2one("committees.line", string="Researcher Team",related="benefit_id.researcher_id")
researcher_ids = fields.Many2many("hr.employee", string="Researcher",compute="get_researcher_ids",readonly=False) researcher_ids = fields.Many2many("hr.employee", string="Researcher",compute="get_researcher_ids",readonly=False)
visit_date = fields.Datetime(string='Visit Date', tracking=True) visit_date = fields.Datetime(string='Visit Date', tracking=True)
description = fields.Char(string='Description') description = fields.Char(string='Description')

View File

@ -118,19 +118,12 @@
string="First Accept" class="oe_highlight" string="First Accept" class="oe_highlight"
confirm="Are you sure you want to accept ?" confirm="Are you sure you want to accept ?"
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
attrs="{'invisible': [('state','not in',['waiting_approve','first_refusal'])]}"/> attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','first_refusal'])]}"/>
<button name="action_second_accepted" type="object" <button name="action_second_accepted" type="object"
string="Second Accept" class="oe_highlight" string="Second Accept" class="oe_highlight"
confirm="Are you sure you want to accept ?" confirm="Are you sure you want to accept ?"
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
attrs="{'invisible': [('state','not in',['first_approve','first_refusal'])]}"/> attrs="{'invisible': ['|',('action_type','in',['new','edit_info']),('state','not in',['first_approve','first_refusal'])]}"/>
<button name="action_set_waiting_approve" type="object"
string="Return to Waiting Approval" class="oe_highlight"
confirm="Are you sure you want to return this record to Waiting Approval?"
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
states="first_approve"/>
<!-- <button name="action_view_beneficiary_guardian" type="object"-->
<!-- string="create" class="oe_highlight"/>-->
<button name="action_refuse" type="object" <button name="action_refuse" type="object"
string="Final Refuse" class="oe_highlight" string="Final Refuse" class="oe_highlight"
confirm="Are you sure you want to final refuse ?" confirm="Are you sure you want to final refuse ?"
@ -138,15 +131,17 @@
states="first_refusal" states="first_refusal"
/> />
<button name="action_first_refusal" type="object" <button name="action_first_refusal" type="object"
string="First Refuse" class="oe_highlight" string="First Refuse" class="btn btn-danger"
confirm="Are you sure you want to refuse ?" 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" groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
states="waiting_approve"/> attrs="{'invisible': ['|',('action_type','!=','suspended'),('state','not in',['waiting_approve'])]}"
/>
<button name="action_set_to_new" type="object" <button name="action_set_to_new" type="object"
string="Set To new" class="oe_highlight" string="Set To new" class="btn btn-warning"
confirm="Are you sure you want to set the state to New?" 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" groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee"
states="waiting_approve"/> attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','first_approve'])]}"
/>
<button name="complete_data" type="object" <button name="complete_data" type="object"
string="Researcher Assignment" class="oe_highlight" string="Researcher Assignment" class="oe_highlight"
confirm="Are you sure you want to Researcher assignment ?" confirm="Are you sure you want to Researcher assignment ?"
@ -157,25 +152,26 @@
confirm="Are you sure you want to Finish Complete data ?" confirm="Are you sure you want to Finish Complete data ?"
states="complete_info"/> states="complete_info"/>
<button name="action_black_list" type="object" <button name="action_black_list" type="object"
string="Black List" class="oe_highlight" string="Black List" class="btn btn-dark"
states="waiting_approve,refused" attrs="{'invisible': ['|',('action_type','=','suspended'),('state','not in',['waiting_approve','refused'])]}"
groups="odex_benefit.group_benefit_manager,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_woman_commitee" 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 ?"/> confirm="Are you sure you want to move to black list ?"/>
<button name="action_suspend" type="object" <button name="action_suspend" type="object"
string="Temporarily Suspended" class="oe_highlight" string="Temporarily Suspended" class="btn btn-danger"
states="second_approve" states="second_approve"
confirm="Are you sure you want to move to Temporarily Suspended ?"/> confirm="Are you sure you want to move to Temporarily Suspended ?"/>
<button name="action_suspend_first_accept" type="object" <button name="action_suspend_first_accept" type="object"
string="First Approve" class="oe_highlight" string="First Approve" class="oe_highlight" attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve'])]}"
groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"
states="temporarily_suspended"/> />
<button name="action_suspend_second_accept" type="object" <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" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"
states="suspended_first_approve"/> states="suspended_first_approve"/>
<button name="action_suspend_refuse" type="object" <button name="action_suspend_refuse" type="object"
string="Suspend Refuse" class="oe_highlight" string="Suspend Refuse" class="oe_highlight"
states="temporarily_suspended,suspended_first_approve,suspended_second_approve"/> attrs="{'invisible': ['|',('action_type','!=','suspended'),('state', 'not in', ['waiting_approve','suspended_first_approve','suspended_second_approve'])]}"
/>
<!-- Exception --> <!-- Exception -->
<button name="action_exception" type="object" <button name="action_exception" type="object"
string="Exception from suspension" class="oe_highlight" string="Exception from suspension" class="oe_highlight"
@ -196,7 +192,7 @@
string="Exception Refuse" class="oe_highlight" string="Exception Refuse" class="oe_highlight"
states="temporarily_exception,exception_first_approve,exception_second_approve"/> states="temporarily_exception,exception_first_approve,exception_second_approve"/>
<button name="action_edit_info" type="object" <button name="action_edit_info" type="object"
string="Open Edit Info" class="oe_highlight" string="Open Edit Info" class="btn btn-info"
groups="odex_benefit.group_benefit_edit" groups="odex_benefit.group_benefit_edit"
states="second_approve" states="second_approve"
confirm="Are you sure you want to open info edition !" confirm="Are you sure you want to open info edition !"
@ -206,9 +202,9 @@
states="second_approve" states="second_approve"
/> />
<button name="action_set_to_draft" type="object" <button name="action_set_to_draft" type="object"
string="Set to Draft" class="oe_highlight" string="Set to Draft" class="btn btn-warning"
groups="odex_benefit.group_benefit_back_to_draft" groups="odex_benefit.group_benefit_back_to_draft"
attrs="{'invisible':[('state','in',['draft','first_approve','second_approve'])]}"/> attrs="{'invisible':['|',('action_type','!=','new'),('state','not in',['complete_info'])]}"/>
<button name="edit_password" type="object" <button name="edit_password" type="object"
string="Send Reset Password" states="second_approve" string="Send Reset Password" states="second_approve"
confirm="Are you sure you want to send link to reset password !"/> confirm="Are you sure you want to send link to reset password !"/>
@ -369,7 +365,7 @@
<group> <group>
<field name="father_dead_reason" <field name="father_dead_reason"
attrs="{'required':[('state','=','complete_info')],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'required':[('state','=','complete_info')],'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="father_dead_date" <field name="father_dead_date" required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="father_dead_country_id" required="1" <field name="father_dead_country_id" required="1"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}" attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"
@ -804,6 +800,8 @@
<h3>Property details</h3> <h3>Property details</h3>
<field name="housing_type" <field name="housing_type"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="housing_cat"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="property_type" <field name="property_type"
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'])]}"/>
<field name="rent_amount" <field name="rent_amount"
@ -865,22 +863,20 @@
<!-- <field name="location_url"--> <!-- <field name="location_url"-->
<!-- attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>--> <!-- attrs="{'readonly':[('state','not in',['draft','complete_info'])]}"/>-->
</group> </group>
<group> <group invisible="1">
<h3>Housing details</h3> <h3>Housing details</h3>
<field name="floor" <field name="floor"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="housing_number" <field name="housing_number"
attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="block" <field name="block"
attrs="{'required':[('state','not in',['draft','new'])],'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="nearby_mosque" <field name="nearby_mosque"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="housing_note" <field name="housing_note"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="note_neighborhood" <field name="note_neighborhood"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/> attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
<field name="housing_cat"
attrs="{'readonly':[('state','not in',['draft','new','complete_info'])]}"/>
</group> </group>
</group> </group>
<group colspan="2" col="2"> <group colspan="2" col="2">
@ -1131,22 +1127,22 @@
<label for="acc_number"/> <label for="acc_number"/>
<div class="o_row"> <div class="o_row">
<field name="acc_number" width="100%" <field name="acc_number" width="100%"
attrs="{'required':[('state','in',['first_approve'])],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/> attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
<field name="sa_iban"/> <field name="sa_iban"/>
</div> </div>
<field name="iban_document" <field name="iban_document"
attrs="{'required':[('state','in',['first_approve'])], 'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}" attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"
widget="many2many_attachment_preview"/> widget="many2many_attachment_preview"/>
</group> </group>
<group> <group>
<field name="bank_id" <field name="bank_id"
attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve'])]}" attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"
options="{'no_create': True, 'no_create_edit': True}" options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/> groups="!odex_benefit.group_benefit_manager"/>
<field name="acc_holder_name" <field name="acc_holder_name"
attrs="{'invisible':[('is_family_member','=',True)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve']),('is_family_member','=',False)]}"/> attrs="{'invisible':[('is_family_member','=',True)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
<field name="family_member_id" <field name="family_member_id"
attrs="{'invisible':[('is_family_member','=',False)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve']),('is_family_member','=',True)]}" attrs="{'invisible':[('is_family_member','=',False)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"
options="{'no_create': True, 'no_create_edit': True}" options="{'no_create': True, 'no_create_edit': True}"
groups="!odex_benefit.group_benefit_manager"/> groups="!odex_benefit.group_benefit_manager"/>
<field name="owner_identity_attachment_ids" <field name="owner_identity_attachment_ids"
@ -1170,7 +1166,8 @@
</group> </group>
</page> </page>
<page string="Suspend Reason" <page string="Suspend Reason"
attrs="{'invisible': [('state', 'not in', ['temporarily_suspended','suspended_first_approve','suspended_second_approve'])]}"> attrs="{'invisible': [('action_type','!=','suspended')]}"
>
<group> <group>
<group> <group>
<field name="suspend_reason"/> <field name="suspend_reason"/>
@ -1290,26 +1287,26 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='account_relation']" position="replace"> <xpath expr="//field[@name='account_relation']" position="replace">
<field name="account_relation" <field name="account_relation"
attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve'])]}"/> attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
</xpath> </xpath>
<xpath expr="//field[@name='acc_number']" position="replace"> <xpath expr="//field[@name='acc_number']" position="replace">
<field name="acc_number" <field name="acc_number"
attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve'])]}"/> attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
</xpath> </xpath>
<xpath expr="//field[@name='acc_holder_name']" position="replace"> <xpath expr="//field[@name='acc_holder_name']" position="replace">
<field name="acc_holder_name" <field name="acc_holder_name"
attrs="{'invisible':[('is_family_member','=',True)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve']),('is_family_member','=',False)]}"/> attrs="{'invisible':[('is_family_member','=',True)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
</xpath> </xpath>
<xpath expr="//field[@name='family_member_id']" position="replace"> <xpath expr="//field[@name='family_member_id']" position="replace">
<field name="family_member_id" <field name="family_member_id"
attrs="{'invisible':[('is_family_member','=',False)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve']),('is_family_member','=',True)]}"/> attrs="{'invisible':[('is_family_member','=',False)],'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
</xpath> </xpath>
<xpath expr="//field[@name='bank_id']" position="replace"> <xpath expr="//field[@name='bank_id']" position="replace">
<field name="bank_id" <field name="bank_id"
attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])],'required':[('state','in',['first_approve'])]}"/> attrs="{'readonly':[('state','not in',['complete_info','waiting_approve','first_approve'])]}"/>
</xpath> </xpath>

View File

@ -28,7 +28,8 @@ class SuspendReasonWizard(models.TransientModel):
def action_submit(self): def action_submit(self):
for rec in self: for rec in self:
rec.entity_id.state = 'temporarily_suspended' rec.entity_id.state = 'waiting_approve'
rec.entity_id.action_type = 'suspended'
rec.entity_id.suspend_reason = rec.suspend_reason rec.entity_id.suspend_reason = rec.suspend_reason
rec.entity_id.suspend_description = rec.suspend_description rec.entity_id.suspend_description = rec.suspend_description
rec.entity_id.suspend_type = rec.suspend_type rec.entity_id.suspend_type = rec.suspend_type
@ -37,7 +38,8 @@ class SuspendReasonWizard(models.TransientModel):
def action_member_submit(self): def action_member_submit(self):
for rec in self: for rec in self:
rec.member_id.state_a = 'temporarily_suspended' rec.member_id.state_a = 'waiting_approve'
rec.entity_id.action_type = 'suspended'
rec.member_id.suspend_reason = rec.suspend_reason rec.member_id.suspend_reason = rec.suspend_reason
rec.member_id.suspend_description = rec.suspend_description rec.member_id.suspend_description = rec.suspend_description
rec.member_id.suspend_type = rec.suspend_type rec.member_id.suspend_type = rec.suspend_type