Merge pull request #2037 from expsa/benefits_notes_1_1

Service Tasks
This commit is contained in:
enagahh 2025-01-01 23:39:36 +02:00 committed by GitHub
commit 09ba6702c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 3 deletions

View File

@ -94,6 +94,7 @@ class ServiceRequest(models.Model):
vendor_bill = fields.Many2one('account.move')
requested_quantity = fields.Integer(string='Requested Quantity')
exception_or_steal = fields.Boolean(string='Exception Or Steal?')
exception_or_steal_attach = fields.Many2many('ir.attachment', 'rel_exception_or_steal_attachment_service_request', 'exception_or_steal_id','attachment_id', string='Exception or steal Attachment')
#Home furnishing Exception
home_furnishing_exception = fields.Boolean(string='Exception(Fire Or Steal or Natural disaster)')
furnishing_items_ids = fields.One2many('home.furnishing.items','service_request_id', string="Furnishing Items")
@ -124,6 +125,7 @@ class ServiceRequest(models.Model):
#Buy home
amount_for_buy_home_for_member_count = fields.Float(string="Amount For Buy Home for member count",compute='_get_amount_for_buy_home')
home_age = fields.Integer(string='Home Age')
required_attach = fields.Boolean(string='Required Attach',related='service_cat.required_attach')
state = fields.Selection( selection = [
('draft', 'Draft'),
('researcher', 'Researcher'),
@ -131,12 +133,14 @@ class ServiceRequest(models.Model):
('first_approve', 'Request First Approve'),
('second_approve', 'Request Second Approve'),
('accounting_approve', 'Accounting Approve'),
('send_request_to_supplier', 'Send Request To Supplier'),
('approval_of_beneficiary_services', 'Approval of beneficiary services'),
('send_request_to_supplier', 'Send Request To Supplier'),
('family_received_device', 'Family Received Device'),
('refused', 'Refused')
], string='state',default='draft', tracking=True)
state_a = fields.Selection(related='state', tracking=False)
state_b = fields.Selection(related='state', tracking=False)
state_c = 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")
specialist_note = fields.Text(string="Specialist's Note After Return")
@ -386,6 +390,10 @@ class ServiceRequest(models.Model):
for rec in self:
rec.state = 'second_approve'
def action_approval_of_beneficiary_services(self):
for rec in self:
rec.state = 'approval_of_beneficiary_services'
def action_accounting_approve(self):
for rec in self:
rec.state = 'accounting_approve'

View File

@ -81,6 +81,7 @@ class ServicesSettings(models.Model):
buy_home_lines = fields.One2many('buy.home.lines', 'services_settings_id')
buy_home_max_total_amount = fields.Float(string='Buy Home Max Total Amount')
home_age = fields.Integer(string='Home Age')
required_attach = fields.Boolean(string='Required Attach')
class RentLines(models.Model):
_name = 'rent.lines'

View File

@ -37,6 +37,12 @@
<field name="implied_ids" eval="[(4, ref('group_benefit_info'))]"/>
<field name="comment">the user will be able to approve Beneficiaries requests.</field>
</record>
<record id="group_approval_of_beneficiary_services" model="res.groups">
<field name="name">Approval Of Beneficiary Services</field>
<field name="category_id" ref="module_category_benefit"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
<field name="comment">the user will be able to approve Beneficiaries Services.</field>
</record>
<record id="group_benefit_researcher" model="res.groups">
<field name="name">Beneficiaries Researcher</field>
<field name="category_id" ref="module_category_benefit"/>

View File

@ -95,10 +95,11 @@
<field name="refuse_reason_id" readonly="1"/>
<field name="return_reason" readonly="1"/>
<field name="specialist_note" attrs="{'invisible': [('return_reason', '=', False)]}"/>
<field name="required_attach" invisible="1"/>
</group>
</group>
<notebook>
<page string="Services Attachments Settings">
<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"/>
@ -206,6 +207,7 @@
<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')]}">

View File

@ -19,10 +19,11 @@
<field name="is_main_service"/>
<field name="is_service_producer" attrs="{'invisible':[('is_main_service','=',True)]}"/>
<field name="is_this_service_for_student" attrs="{'invisible':[('is_main_service','=',True)]}"/>
<field name="required_attach" attrs="{'invisible':[('is_main_service','=',True)]}"/>
</group>
</group>
<notebook>
<page string="Services Attachments Settings">
<page string="Services Attachments Settings" attrs="{'invisible':[('required_attach','=',False)]}">
<field name="attachment_lines" widget="one2many_list">
<tree editable="bottom">
<field name="name"/>

View File

@ -11,6 +11,11 @@
<field name="project_create" invisible="1"/>
<field name="project_id" readonly="1" attrs="{'invisible': ['|',('state','!=','accounting_approve'),('project_create', '=',False)]}"/>
</xpath>
<xpath expr="//button[@name='action_second_approve']" position="after">
<button name="action_approval_of_beneficiary_services" type="object"
string="Approval of beneficiary services" class="oe_highlight"
confirm="Are you sure you want to approval_of_beneficiary_services ?" groups="odex_benefit.group_approval_of_beneficiary_services" attrs="{'invisible': ['|',('project_create', '=', False),('state', 'not in', ['second_approve'])]}"/>
</xpath>
</field>
</record>
</data>