Merge pull request #4817 from expsa/youneskch_dev_odex25_ensan

Youneskch dev odex25 ensan
This commit is contained in:
kchyounes19 2025-10-06 16:03:20 +01:00 committed by GitHub
commit 5914104a69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 391 additions and 217 deletions

View File

@ -1395,7 +1395,7 @@ msgstr "مدة الانتهاء بالايام"
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__benefit_category_ids
#: model:ir.model.fields,field_description:odex_benefit.field_services_settings__benefit_category_ids
msgid "Allowed Categories"
msgstr ""
msgstr "الفئات المستفيدة"
#. module: odex_benefit
#: model:ir.model.fields.selection,name:odex_benefit.selection__services_settings__service_type__alternative_housing
@ -10506,7 +10506,6 @@ msgid "Self"
msgstr "نفس"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_search
msgid "Send Request"
msgstr "إرسال الطلب"
@ -14247,11 +14246,6 @@ msgstr "اختر سبب الرفض"
msgid "Return the request to the specialist"
msgstr "إعادة الطلب إلي الاخصائي"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
msgid "RESEARCHER ACCEPT"
msgstr "قبول الباحث "
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__return_reason
msgid "Reason for Returning the Request"
@ -15947,4 +15941,41 @@ msgstr "شروط الاستحقاق"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_services_settings__allow_non_beneficiary
msgid "Allow Non Beneficiary"
msgstr "منح الخدمة لغير المستفيد"
msgstr "منح الخدمة لغير المستفيد"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
msgid "Send"
msgstr "إرسال الطلب"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
msgid "Researcher Approval"
msgstr "موافقة الأخصائي"
#. module: odex_benefit
#: model_terms:ir.ui.view,arch_db:odex_benefit.service_request_form
msgid "Family Received"
msgstr "تم الاستلام"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_service_refuse_reason_wizard__notes
msgid "Additional Notes"
msgstr "ملاحظات"
#. module: odex_benefit
#: code:addons/odex_benefit/wizards/service_refuse_reason_wizard.py:0
#, python-format
msgid ""
"Request was refused.\n"
"Reason: %s\n"
"Notes: %s"
msgstr ""
"تم رفض طلب الخدمة.\n"
"السبب: %s\n"
"الملاحظات: %s"
#. module: odex_benefit
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__refuse_reason
msgid "Reason for Refusal"
msgstr "سبب الرفض"

View File

@ -174,6 +174,7 @@ class ServiceRequest(models.Model):
state_b = fields.Selection(related='state', tracking=False)
refuse_reason_id = fields.Many2one('service.refuse.reason', string="Refuse Reason")
return_reason = fields.Text(string="Reason for Returning the Request")
refuse_reason = fields.Text(string="Reason for Refusal")
specialist_note = fields.Text(string="Specialist's Note After Return")
exception = fields.Boolean(string='Exception',default=False)
exception_attach = fields.Many2many('ir.attachment', 'rel_exception_attachment_service_request', 'service_request_id',
@ -497,8 +498,6 @@ class ServiceRequest(models.Model):
}
def action_refuse(self):
# for rec in self:
# rec.state = 'refused'
return {
'name': 'Select Reason',
'type': 'ir.actions.act_window',

View File

@ -8,140 +8,234 @@
<form string="Service Request">
<header>
<button name="action_send_to_researcher" type="object" states="draft"
string="Researcher Accept" class="oe_highlight"/>
string="Send" class="oe_highlight" />
<button name="action_researcher_send_request" type="object" states="researcher"
string="Send Request" class="oe_highlight"/>
string="Researcher Approval" class="oe_highlight"
groups="odex_benefit.group_benefit_researcher"
/>
<button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger"
states="researcher" groups="odex_benefit.group_benefit_researcher"/>
<button name="action_operations_chief_approve" type="object"
string="Request First Approve" class="oe_highlight"
confirm="Are you sure you want to first approve ?"
states="send_request" groups="odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_manager"/>
states="send_request"
groups="odex_benefit.group_benefit_woman_commitee"
/>
<button name="action_first_refuse" type="object"
string="Return the request to the specialist" class="btn btn-warning"
states="send_request"
groups="odex_benefit.group_benefit_woman_commitee"/>
<button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger"
states="send_request"
groups="odex_benefit.group_benefit_woman_commitee"
/>
<button name="action_branch_manager_approve" type="object"
string="Request Second Approve" class="oe_highlight"
confirm="Are you sure you want to second approve ?"
states="first_approve" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
<button name="action_beneficiary_manager_approve" type="object"
string="Beneficiary Approve" class="oe_highlight"
confirm="Are you sure you want to approve ?"
states="second_approve" groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
states="first_approve"
groups="odex_benefit.group_benefit_branch_manager"/>
<button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger"
states="first_approve"
groups="odex_benefit.group_benefit_branch_manager"
/>
<button name="action_accounting_approve" type="object"
string="Accounting Approve" class="oe_highlight"
confirm="Are you sure you want to approve ?"
states="accounting_approve" groups="odex_benefit.group_benefit_accounting_accept"/>
<button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger"
states="accounting_approve"
groups="odex_benefit.group_benefit_accounting_accept"
/>
<button name="action_request_done" type="object"
string="Family Received" class="oe_highlight"
states="send_request_to_supplier"/>
<button name="action_refuse" type="object"
string="Refuse" class="btn btn-danger"
states="send_request_to_supplier"
/>
<button name="action_first_refuse" type="object"
string="Return the request to the specialist" class="btn btn-warning"
states="refused"
/>
<button name="action_beneficiary_manager_approve" type="object"
string="Beneficiary Approve" class="oe_highlight"
confirm="Are you sure you want to approve ?"
states="second_approve"
groups="odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
<button name="action_supplier_approve" type="object"
string="Supplier Approve" class="oe_highlight"
confirm="Are you sure you want to approve ?"
states="approval_of_beneficiary_services" groups="odex_benefit.group_benefit_accounting_accept"/>
<button name="action_request_done" type="object"
string="Family Received Device" class="oe_highlight"
groups="odex_benefit.group_benefit_accounting_accept" states="send_request_to_supplier" />
<button name="action_first_refuse" type="object"
string="Return the request to the specialist" class="oe_highlight"
attrs="{'invisible': ['|',('return_reason','!=', False), ('state', 'not in', ['accounting_approve', 'second_approve' ,'send_request' ,'first_approve'])]}"
groups="odex_benefit.group_benefit_accounting_accept,odex_benefit.group_benefit_woman_commitee,odex_benefit.group_benefit_branch_manager,odex_benefit.group_benefit_manager"/>
<button name="action_refuse" type="object"
string="Refuse" class="oe_highlight"
states="first_approve,second_approve,draft,send_request"/>
<field name="state" widget="statusbar" statusbar_visible="draft,researcher,send_request,first_approve,accounting_approve,send_request_to_supplier,family_received_device,refused"/>
</header>
<sheet>
<field name="is_payment_order_done" invisible="1"/>
<widget name="web_ribbon" title="Payment Order Done" bg_color="bg-success"
attrs="{'invisible': [('is_payment_order_done', '=', False)]}"/>
states="approval_of_beneficiary_services"
groups="odex_benefit.group_benefit_accounting_accept"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,researcher,send_request,first_approve,accounting_approve,send_request_to_supplier,family_received_device,refused"/>
</header>
<sheet>
<field name="is_payment_order_done" invisible="1"/>
<widget name="web_ribbon" title="Payment Order Done" bg_color="bg-success"
attrs="{'invisible': [('is_payment_order_done', '=', False)]}"/>
<group>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<field name="date" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" required="1"/>
<field name="benefit_type" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" required="1"/>
<field name="family_id" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" required="1"/>
<field name="family_category" force_save="1"/>
<field name="researcher_id" force_save="1"/>
<field name="benefit_member_count" force_save="1"/>
<field name="eid_gift_benefit_count" attrs="{'invisible':['|',('service_type','!=','eid_gift'),('benefit_type','!=','family')]}"/>
<field name="branch_custom_id" force_save="1"/>
<field name="member_id" attrs="{'invisible':[('benefit_type','!=','member')],'readonly':[('state','not in',['draft','researcher','send_request'])],'required':[('benefit_type','=','member')]}"/>
<field name="member_age" attrs="{'invisible':[('benefit_type','!=','member')]}"/>
<field name="account_id" invisible="1"/>
<field name="device_account_id" invisible="1"/>
<field name="accountant_id" attrs="{'invisible':[('state','in',['draft','researcher','send_request','first_approve','second_approve'])]}"/>
<field name="payment_order_id" readonly="1" groups="odex_benefit.group_benefit_accounting_accept" invisible="1"/>
<field name="vendor_bill" readonly="1" attrs="{'invisible':[('service_type','!=','electrical_devices')]}"/>
<field name="is_service_producer" invisible="1"/>
<field name="service_producer_id" attrs="{'invisible':[('is_service_producer','=',False)],'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
</group>
<group>
<field name="available_service_cats" invisible="1"/>
<field name="service_cat" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" domain="[('id','in',available_service_cats)]" required="1"/>
<field name="need_status" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="main_service_category" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" invisible="1"/>
<field name="sub_service_category" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" invisible="1"/>
<field name="requested_service_amount" attrs="{'readonly': [
<field name="date"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
required="1"/>
<field name="benefit_type"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
required="1"/>
<field name="family_id"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
required="1"/>
<field name="family_category" force_save="1"/>
<field name="researcher_id" force_save="1"/>
<field name="benefit_member_count" force_save="1"/>
<field name="eid_gift_benefit_count"
attrs="{'invisible':['|',('service_type','!=','eid_gift'),('benefit_type','!=','family')]}"/>
<field name="branch_custom_id" force_save="1"/>
<field name="member_id"
attrs="{'invisible':[('benefit_type','!=','member')],'readonly':[('state','not in',['draft','researcher','send_request'])],'required':[('benefit_type','=','member')]}"/>
<field name="member_age" attrs="{'invisible':[('benefit_type','!=','member')]}"/>
<field name="account_id" invisible="1"/>
<field name="device_account_id" invisible="1"/>
<field name="accountant_id"
attrs="{'invisible':[('state','in',['draft','researcher','send_request','first_approve','second_approve'])]}"/>
<field name="payment_order_id" readonly="1"
groups="odex_benefit.group_benefit_accounting_accept" invisible="1"/>
<field name="vendor_bill" readonly="1"
attrs="{'invisible':[('service_type','!=','electrical_devices')]}"/>
<field name="is_service_producer" invisible="1"/>
<field name="service_producer_id"
attrs="{'invisible':[('is_service_producer','=',False)],'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
</group>
<group>
<field name="available_service_cats" invisible="1"/>
<field name="service_cat"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
domain="[('id','in',available_service_cats)]" required="1"/>
<field name="need_status"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="main_service_category"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
invisible="1"/>
<field name="sub_service_category"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"
invisible="1"/>
<field name="requested_service_amount" attrs="{'readonly': [
'|',
'&amp;',
('state', 'not in', ['draft', 'researcher', 'send_request', 'first_approve', 'second_approve', 'accounting_approve']),
('service_type', 'in', ['marriage', 'eid_gift', 'winter_clothing', 'ramadan_basket']),
('service_type', 'in', ['electrical_devices', 'home_furnishing'])
]}" force_save="1" required="1" />
<field name="exception" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="exception_attach" attrs="{'invisible': [('exception', '=', False)]}" widget="many2many_attachment_preview"/>
<field name="amount_for_buy_home_for_member_count" attrs="{'invisible':[('service_type','!=','buy_home')]}"/>
<field name="home_age" attrs="{'invisible':[('service_type','!=','buy_home')]}"/>
<field name="max_electricity_bill_amount" readonly="1" force_save="1" attrs="{'invisible':[('service_type','!=','electricity_bill')]}"/>
<field name="max_water_bill_amount" readonly="1" force_save="1" attrs="{'invisible':[('service_type','!=','water_bill')]}"/>
<field name="aid_amount" invisible="1"/>
<field name="description" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="service_attach" invisible="1" widget="many2many_attachment_preview"/>
<field name="has_marriage_course" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])],'invisible':[('service_type','!=','marriage')],'required':[('service_type','=','marriage')]}"/>
<field name="service_type" invisible="1"/>
<field name="refuse_reason_id" attrs="{'invisible': [('refuse_reason_id', '=', False)]}" readonly="1"/>
<field name="return_reason" attrs="{'invisible': [('return_reason', '=', False)]}" readonly="1"/>
<field name="specialist_note" attrs="{'invisible': [('return_reason', '=', False)]}"/>
<field name="required_attach" invisible="1"/>
</group>
]}" force_save="1" required="1"/>
<field name="exception"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="exception_attach" attrs="{'invisible': [('exception', '=', False)]}"
widget="many2many_attachment_preview"/>
<field name="amount_for_buy_home_for_member_count"
attrs="{'invisible':[('service_type','!=','buy_home')]}"/>
<field name="home_age" attrs="{'invisible':[('service_type','!=','buy_home')]}"/>
<field name="max_electricity_bill_amount" readonly="1" force_save="1"
attrs="{'invisible':[('service_type','!=','electricity_bill')]}"/>
<field name="max_water_bill_amount" readonly="1" force_save="1"
attrs="{'invisible':[('service_type','!=','water_bill')]}"/>
<field name="aid_amount" invisible="1"/>
<field name="description"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<field name="service_attach" invisible="1" widget="many2many_attachment_preview"/>
<field name="has_marriage_course"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])],'invisible':[('service_type','!=','marriage')],'required':[('service_type','=','marriage')]}"/>
<field name="service_type" invisible="1"/>
<field name="refuse_reason_id" attrs="{'invisible': [('refuse_reason_id', '=', False)]}"
readonly="1"/>
<field name="refuse_reason" attrs="{'invisible': [('refuse_reason', '=', False)]}"
readonly="1"/>
<field name="return_reason" attrs="{'invisible': [('return_reason', '=', False)]}"
readonly="1"/>
<field name="specialist_note" attrs="{'invisible': [('return_reason', '=', False)]}"/>
<field name="required_attach" invisible="1"/>
</group>
<notebook>
<page string="Services Attachments Settings" attrs="{'invisible':[('required_attach','=',False)]}">
<field name="attachment_lines" widget="one2many_list">
<tree editable="bottom" delete="0">
<field name="name"/>
<field name="service_attach" widget="many2many_attachment_preview"/>
<field name="notes"/>
<field name="service_type" invisible="1"/>
</tree>
</field>
</page>
<page string="Rent Information" attrs="{'invisible':[('service_type', '!=', 'rent'),'|',('service_type', '!=', 'alternative_housing'),('providing_alternative_housing_based_rent','=',False)]}">
</group>
<notebook>
<page string="Services Attachments Settings"
attrs="{'invisible':[('required_attach','=',False)]}">
<field name="attachment_lines" widget="one2many_list">
<tree editable="bottom" delete="0">
<field name="name"/>
<field name="service_attach" widget="many2many_attachment_preview"/>
<field name="notes"/>
<field name="service_type" invisible="1"/>
</tree>
</field>
</page>
<page string="Rent Information"
attrs="{'invisible':[('service_type', '!=', 'rent'),'|',('service_type', '!=', 'alternative_housing'),('providing_alternative_housing_based_rent','=',False)]}">
<form>
<sheet>
<group>
<group attrs="{'invisible':[('service_type', '=', 'alternative_housing')]}">
<group attrs="{'invisible':[('service_type', '=', 'alternative_housing')]}">
<separator string="Rent Contract Information" colspan="2"/>
<br/>
<field name="rent_payment_date_exception" widget="boolean_toggle"/>
<field name="rent_payment_date" attrs="{'required':[('service_type','=','rent'),('new_rent_contract','=',False)]}"/>
<field name="rent_contract_number" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="rent_start_date" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="rent_end_date" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<label for="start" string="Period" />
<field name="rent_payment_date"
attrs="{'required':[('service_type','=','rent'),('new_rent_contract','=',False)]}"/>
<field name="rent_contract_number"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="rent_start_date"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="rent_end_date"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<label for="start" string="Period"/>
<div name="dates" class="o_row">
<field name="start" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<i class="fa fa-long-arrow-right mx-2 oe_edit_only" aria-label="Arrow icon" title="Arrow" />
<i class="fa fa-long-arrow-right mx-2 oe_read_only" aria-label="Arrow icon" title="Arrow" attrs="{'invisible': [('start', '=', False), ('end', '=', False)]}" />
<field name="end" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" />
<field name="start"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<i class="fa fa-long-arrow-right mx-2 oe_edit_only"
aria-label="Arrow icon" title="Arrow"/>
<i class="fa fa-long-arrow-right mx-2 oe_read_only"
aria-label="Arrow icon" title="Arrow"
attrs="{'invisible': [('start', '=', False), ('end', '=', False)]}"/>
<field name="end"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
</div>
<field name="rent_amount" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="rent_amount_payment" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="payment_type" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="rent_attachment" widget="many2many_attachment_preview" attrs="{'invisible':[('benefit_type','!=','family')]}" force_save="1"/>
<field name="member_rent_contract_number" attrs="{'invisible':[('benefit_type','!=','member')]}" force_save="1"/>
<field name="member_rent_start_date" attrs="{'invisible':[('benefit_type','!=','member')]}" force_save="1"/>
<field name="member_rent_end_date" attrs="{'invisible':[('benefit_type','!=','member')]}" force_save="1"/>
<field name="member_rent_attachment" widget="many2many_attachment_preview" attrs="{'invisible':[('benefit_type','!=','member')]}" force_save="1"/>
<field name="new_rent_contract" widget="boolean_toggle" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<!-- <field name="is_alternative_housing" widget="boolean_toggle"/>-->
<field name="rent_amount"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="rent_amount_payment"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="payment_type"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="rent_attachment" widget="many2many_attachment_preview"
attrs="{'invisible':[('benefit_type','!=','family')]}"
force_save="1"/>
<field name="member_rent_contract_number"
attrs="{'invisible':[('benefit_type','!=','member')]}"
force_save="1"/>
<field name="member_rent_start_date"
attrs="{'invisible':[('benefit_type','!=','member')]}"
force_save="1"/>
<field name="member_rent_end_date"
attrs="{'invisible':[('benefit_type','!=','member')]}"
force_save="1"/>
<field name="member_rent_attachment"
widget="many2many_attachment_preview"
attrs="{'invisible':[('benefit_type','!=','member')]}"
force_save="1"/>
<field name="new_rent_contract" widget="boolean_toggle"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<!-- <field name="is_alternative_housing" widget="boolean_toggle"/>-->
</group>
<group attrs="{'invisible':[('benefit_type','!=','family')]}">
<separator string="Rent Amounts" colspan="2"/>
@ -149,7 +243,8 @@
<field name="estimated_rent_amount"/>
<field name="estimated_rent_amount_payment"/>
<field name="paid_rent_amount"/>
<field name="added_amount_if_mother_dead" attrs="{'invisible':[('service_type','=','alternative_housing')]}"/>
<field name="added_amount_if_mother_dead"
attrs="{'invisible':[('service_type','=','alternative_housing')]}"/>
</group>
</group>
<group attrs="{'invisible':[('new_rent_contract','=',False),'|',('service_type', '!=', 'alternative_housing'),('providing_alternative_housing_based_rent','=',False)]}">
@ -157,21 +252,36 @@
<separator string="New Rent Contract Information" colspan="2"/>
<br/>
<field name="new_rent_payment_date_exception" widget="boolean_toggle"/>
<field name="new_rent_payment_date" attrs="{'required':[('service_type','=','rent'),('new_rent_contract','=',True)]}"/>
<field name="new_rent_contract_number" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_start_date" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_end_date" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<label for="new_start" string="Period" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<div name="dates" class="o_row" attrs="{'invisible':[('benefit_type','!=','family')]}">
<field name="new_start" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<i class="fa fa-long-arrow-right mx-2 oe_edit_only" aria-label="Arrow icon" title="Arrow" />
<i class="fa fa-long-arrow-right mx-2 oe_read_only" aria-label="Arrow icon" title="Arrow" attrs="{'invisible': [('new_start', '=', False), ('new_end', '=', False)]}" />
<field name="new_end" attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}" />
<field name="new_rent_payment_date"
attrs="{'required':[('service_type','=','rent'),('new_rent_contract','=',True)]}"/>
<field name="new_rent_contract_number"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_start_date"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_end_date"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<label for="new_start" string="Period"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<div name="dates" class="o_row"
attrs="{'invisible':[('benefit_type','!=','family')]}">
<field name="new_start"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
<i class="fa fa-long-arrow-right mx-2 oe_edit_only"
aria-label="Arrow icon" title="Arrow"/>
<i class="fa fa-long-arrow-right mx-2 oe_read_only"
aria-label="Arrow icon" title="Arrow"
attrs="{'invisible': [('new_start', '=', False), ('new_end', '=', False)]}"/>
<field name="new_end"
attrs="{'readonly':[('state','not in',['draft','researcher','send_request'])]}"/>
</div>
<field name="new_rent_amount" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_amount_payment" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_payment_type" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_attachment" widget="many2many_attachment_preview" attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_amount"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_amount_payment"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_payment_type"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
<field name="new_rent_attachment" widget="many2many_attachment_preview"
attrs="{'invisible':[('benefit_type','!=','family')]}"/>
</group>
<group>
</group>
@ -179,80 +289,93 @@
</sheet>
</form>
</page>
<page string="Maintenance Service" attrs="{'invisible':[('service_type', '!=', 'home_maintenance')]}">
<field name="maintenance_items_ids" widget="one2many_list">
<tree editable="bottom">
<field name="maintenance_items_id"/>
</tree>
</field>
</page>
<page string="Home Restoration Service" attrs="{'invisible':[('service_type', '!=', 'home_restoration')]}">
<group>
<page string="Maintenance Service"
attrs="{'invisible':[('service_type', '!=', 'home_maintenance')]}">
<field name="maintenance_items_ids" widget="one2many_list">
<tree editable="bottom">
<field name="maintenance_items_id"/>
</tree>
</field>
</page>
<page string="Home Restoration Service"
attrs="{'invisible':[('service_type', '!=', 'home_restoration')]}">
<group>
<field name="restoration_max_amount"/>
<field name="has_money_field_is_appearance" invisible="1"/>
<field name="has_money_to_pay_first_payment" attrs="{'invisible':[('has_money_field_is_appearance', '=', False)],'required':[('has_money_field_is_appearance', '=', True)]}"/>
</group>
</page>
<page string="Complete Building House" attrs="{'invisible':[('service_type', '!=', 'complete_building_house')]}">
<group>
<field name="max_complete_building_house_amount"/>
<field name="has_money_for_payment" attrs="{'invisible':[('has_money_for_payment_is_appearance', '=', False)],'required':[('has_money_for_payment_is_appearance', '=', True)]}"/>
<field name="has_money_for_payment_is_appearance" invisible="1"/>
</group>
<field name="has_money_to_pay_first_payment"
attrs="{'invisible':[('has_money_field_is_appearance', '=', False)],'required':[('has_money_field_is_appearance', '=', True)]}"/>
</group>
</page>
<page string="Alternative Housing Service" attrs="{'invisible':[('service_type', '!=', 'alternative_housing')]}">
<group>
<page string="Complete Building House"
attrs="{'invisible':[('service_type', '!=', 'complete_building_house')]}">
<group>
<field name="max_complete_building_house_amount"/>
<field name="has_money_for_payment"
attrs="{'invisible':[('has_money_for_payment_is_appearance', '=', False)],'required':[('has_money_for_payment_is_appearance', '=', True)]}"/>
<field name="has_money_for_payment_is_appearance" invisible="1"/>
</group>
</page>
<page string="Alternative Housing Service"
attrs="{'invisible':[('service_type', '!=', 'alternative_housing')]}">
<group>
<field name="providing_alternative_housing_based_rent"/>
<field name="rent_for_alternative_housing"/>
</group>
</page>
<page string="Electrical Devices Service" attrs="{'invisible':[('service_type', '!=', 'electrical_devices')]}">
<group>
<field name="device_id" attrs="{'required':[('service_type', '=', 'electrical_devices')]}"/>
<field name="requested_quantity" attrs="{'required':[('service_type', '=', 'electrical_devices')]}"/>
</group>
</page>
<page string="Electrical Devices Service"
attrs="{'invisible':[('service_type', '!=', 'electrical_devices')]}">
<group>
<field name="device_id"
attrs="{'required':[('service_type', '=', 'electrical_devices')]}"/>
<field name="requested_quantity"
attrs="{'required':[('service_type', '=', 'electrical_devices')]}"/>
<field name="exception_or_steal" widget="boolean_toggle"/>
<field name="exception_or_steal_attach" widget="many2many_attachment_preview" attrs="{'invisible':[('exception_or_steal', '=', False)]}"/>
</group>
</page>
<page string="Home Furnishing Service" attrs="{'invisible':[('service_type', '!=', 'home_furnishing')]}">
<field name="exception_or_steal_attach" widget="many2many_attachment_preview"
attrs="{'invisible':[('exception_or_steal', '=', False)]}"/>
</group>
</page>
<page string="Home Furnishing Service"
attrs="{'invisible':[('service_type', '!=', 'home_furnishing')]}">
<group>
<field name="home_furnishing_exception"/>
</group>
</group>
<field name="furnishing_items_ids" widget="one2many_list">
<tree editable="bottom">
<field name="home_furnishing_items"/>
<field name="furnishing_cost"/>
<!-- <field name="max_furnishing_cost"/>-->
<field name="price_first"/>
<field name="price_first_attach" widget="many2many_attachment_preview"/>
<field name="price_second"/>
<field name="price_second_attach" widget="many2many_attachment_preview"/>
</tree>
<tree editable="bottom">
<field name="home_furnishing_items"/>
<field name="furnishing_cost"/>
<!-- <field name="max_furnishing_cost"/>-->
<field name="price_first"/>
<field name="price_first_attach" widget="many2many_attachment_preview"/>
<field name="price_second"/>
<field name="price_second_attach" widget="many2many_attachment_preview"/>
</tree>
</field>
</page>
<page string="Transportation Insurance Service" attrs="{'invisible':[('service_type', '!=', 'transportation_insurance')]}">
</page>
<page string="Transportation Insurance Service"
attrs="{'invisible':[('service_type', '!=', 'transportation_insurance')]}">
<group>
<field name="service_reason_id" options="{'no_create': True, 'no_open': True, 'no_create_edit': True}"/>
<field name="service_reason_id"
options="{'no_create': True, 'no_open': True, 'no_create_edit': True}"/>
<field name="max_amount" readonly="1" force_save="1"/>
<field name="requests_counts"/>
</group>
</page>
<page string="Marriage Service" attrs="{'invisible':[('service_type','!=','marriage')]}">
<group>
<field name="member_age"/>
<field name="member_payroll"/>
</group>
</page>
<page string="Eligibility Criteria">
<group>
<field name="service_conditions"/>
</group>
</page>
</notebook>
</sheet>
</group>
</page>
<page string="Marriage Service" attrs="{'invisible':[('service_type','!=','marriage')]}">
<group>
<field name="member_age"/>
<field name="member_payroll"/>
</group>
</page>
<page string="Eligibility Criteria">
<group>
<field name="service_conditions"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
<field name="activity_ids" />
<field name="activity_ids"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
@ -272,11 +395,14 @@
<field name="main_service_category" invisible="1"/>
<field name="sub_service_category" invisible="1"/>
<field name="service_cat"/>
<field name="requested_service_amount" />
<field name="requested_service_amount"/>
<field name="payment_order_id" invisible="1" groups="odex_benefit.group_benefit_accounting_accept"/>
<field name="vendor_bill" invisible="1" groups="odex_benefit.group_benefit_accounting_accept"/>
<field name="state" widget="badge" decoration-success="state in ['second_approve']" decoration-muted="state == 'draft'"
decoration-danger="state in ['refused']" decoration-info="state in ['first_approve','send_request']" decoration-warning="state in ['researcher']"/>
<field name="state" widget="badge" decoration-success="state in ['second_approve']"
decoration-muted="state == 'draft'"
decoration-danger="state in ['refused']"
decoration-info="state in ['first_approve','send_request']"
decoration-warning="state in ['researcher']"/>
</tree>
</field>
</record>
@ -286,51 +412,62 @@
<field name="arch" type="xml">
<search>
<group string="Group By">
<filter string="Branch" name="branch_custom_id" context="{'group_by': 'branch_custom_id'}"/>
<filter string="Main Service" name="main_service_category" context="{'group_by': 'main_service_category'}"/>
<filter string="Sub Service Category" name="sub_service_category" context="{'group_by': 'sub_service_category'}"/>
<filter string="Service Cat" name="service_cat" context="{'group_by': 'service_cat'}"/>
<filter string="Branch" name="branch_custom_id" context="{'group_by': 'branch_custom_id'}"/>
<filter string="Main Service" name="main_service_category"
context="{'group_by': 'main_service_category'}"/>
<filter string="Sub Service Category" name="sub_service_category"
context="{'group_by': 'sub_service_category'}"/>
<filter string="Service Cat" name="service_cat" context="{'group_by': 'service_cat'}"/>
</group>
<separator/>
<filter string="Draft" name="draft" domain="[('state','=','draft')]"/>
<filter string="Draft" name="draft" domain="[('state','=','draft')]"/>
<separator/>
<separator/>
<filter string="Send Request" name="send_request" domain="[('state', '=', 'send_request')]"/>
<filter string="Send Request" name="send_request" domain="[('state', '=', 'send_request')]"/>
<separator/>
<separator/>
<filter string="Request First Approve" name="first_approve" domain="[('state', '=', 'first_approve')]"/>
<filter string="Request First Approve" name="first_approve"
domain="[('state', '=', 'first_approve')]"/>
<separator/>
<separator/>
<filter string="Request Second Approve" name="second_approve" domain="[('state', '=', 'second_approve')]"/>
<filter string="Request Second Approve" name="second_approve"
domain="[('state', '=', 'second_approve')]"/>
<separator/>
<separator/>
<filter string="Accounting Approve" name="accounting_approve" domain="[('state', '=', 'accounting_approve')]"/>
<filter string="Accounting Approve" name="accounting_approve"
domain="[('state', '=', 'accounting_approve')]"/>
<separator/>
<separator/>
<filter string="Refused" name="refused" domain="[('state', '=', 'refused')]"/>
<filter string="Refused" name="refused" domain="[('state', '=', 'refused')]"/>
<separator/>
<separator/>
<filter string="Payment Order Done" name="payment_order_done" domain="[('payment_order_id', '!=', False)]"/>
<filter string="Payment Order Done" name="payment_order_done"
domain="[('payment_order_id', '!=', False)]"/>
<separator/>
<separator/>
<filter string="Need Payment Order" name="payment_order_done" domain="[('payment_order_id', '=', False),('state','=','accounting_approve')]"/>
<filter string="Need Payment Order" name="payment_order_done"
domain="[('payment_order_id', '=', False),('state','=','accounting_approve')]"/>
<separator/>
<separator/>
<filter string="Need Vendor Bill" name="need_vendor_bill" domain="[('vendor_bill', '=', False),('state','=','family_received_device')]"/>
<filter string="Need Vendor Bill" name="need_vendor_bill"
domain="[('vendor_bill', '=', False),('state','=','family_received_device')]"/>
<separator/>
<separator/>
<filter string="Vendor Bill Done" name="need_vendor_bill" domain="[('vendor_bill', '!=', False),('state','=','family_received_device')]"/>
<separator/>
<separator/>
<filter string="Send Request To Supplier" name="send_request_to_supplier" domain="[('state','=','send_request_to_supplier')]"/>
<filter string="Vendor Bill Done" name="need_vendor_bill"
domain="[('vendor_bill', '!=', False),('state','=','family_received_device')]"/>
<separator/>
<separator/>
<filter string="Family Received Device" name="family_received_device" domain="[('state','=','family_received_device')]"/>
<filter string="Send Request To Supplier" name="send_request_to_supplier"
domain="[('state','=','send_request_to_supplier')]"/>
<separator/>
<separator/>
<filter string="Family Received Device" name="family_received_device"
domain="[('state','=','family_received_device')]"/>
<separator/>
<searchpanel>
<field name="state" string="State" enable_counters="1"/>
<field name="service_cat" string="Categories" enable_counters="1"/>
</searchpanel>
<field name="service_cat" string="Categories" enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>

View File

@ -12,5 +12,5 @@ class ReasonForReturnWizard(models.TransientModel):
for record in self:
record.env['service.request'].browse(self._context.get('active_id')).write({
'return_reason': record.reason,
'state': 'draft',
'state': 'researcher',
})

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
from odoo import models, fields, _
class RefuseReasonWizard(models.TransientModel):
@ -7,10 +7,16 @@ class RefuseReasonWizard(models.TransientModel):
_description = 'Wizard to select a reason for service rejection'
reason_id = fields.Many2one('service.refuse.reason', string="Reason", required=True)
notes = fields.Text(string="Additional Notes", required=True)
def action_confirm(self):
for record in self:
record.env['service.request'].browse(self._context.get('active_id')).write({
'refuse_reason_id': record.reason_id.id,
service_request = self.env['service.request'].browse(self._context.get('active_id'))
if service_request:
service_request.write({
'refuse_reason_id': self.reason_id.id,
'refuse_reason': self.notes,
'state': 'refused',
})
message = _("Request was refused.\nReason: %s\nNotes: %s") % (self.reason_id.name, self.notes)
service_request.message_post(body=message, message_type='notification')
return {'type': 'ir.actions.act_window_close'}

View File

@ -6,6 +6,7 @@
<form string="Select Reason">
<group>
<field name="reason_id"/>
<field name="notes"/>
</group>
<footer>
<button string="Confirm" type="object" name="action_confirm" class="btn-primary"/>