Family Complaints
This commit is contained in:
parent
7be0484560
commit
f855da65cc
|
|
@ -22,6 +22,7 @@
|
|||
'views/committees_view.xml',
|
||||
'views/branch_inherit.xml',
|
||||
'views/family_members.xml',
|
||||
'views/family_complaints.xml',
|
||||
|
||||
'wizards/researcher_wizard.xml',
|
||||
'wizards/suspend_reason_wizard.xml',
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ from . import services_settings
|
|||
from . import res_country_inherit
|
||||
from . import service_request
|
||||
from . import payment_order
|
||||
from . import family_complaints
|
||||
# from . import res_config_settings
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from random import randint
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
|
@ -693,6 +694,16 @@ class AgeCategory(models.Model):
|
|||
else:
|
||||
record.name = ""
|
||||
|
||||
class ComplaintsCategory(models.Model):
|
||||
_name = 'complaints.category'
|
||||
|
||||
def _get_default_color(self):
|
||||
return randint(1, 11)
|
||||
|
||||
name = fields.Char('Category Name', required=True, translate=True)
|
||||
color = fields.Integer('Color', default=_get_default_color)
|
||||
|
||||
|
||||
class ServiceAttachmentsSettings(models.Model):
|
||||
_name = 'service.attachments.settings'
|
||||
_description = "Service Attachments Settings"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class FamilyComplaints(models.Model):
|
||||
_name = 'family.complaints'
|
||||
_rec_name = 'complaints_reason'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
|
||||
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')]")
|
||||
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")
|
||||
message = fields.Text(string="Message")
|
||||
complaints_category_ids = fields.Many2many('complaints.category',relation="family_complaints_category_rel",
|
||||
column1="family_complaints",
|
||||
column2="category",
|
||||
string="Complaints Categories")
|
||||
priority = fields.Selection( [ ('0', 'Normal'),('1', 'Low'),('2', 'High'),('3', 'Very High'),('4', 'Very Very High'),('5', 'Danger')], string='Priority')
|
||||
state = fields.Selection([('draft', 'Draft'),('receiving_complaint', 'Receiving the complaint'),('review_complaint', 'Review Complaint'),
|
||||
('work_in_complaint', 'Work in complaint'),('complaint_done', 'Complaint Done'),('refuse', 'Refuse')],
|
||||
default='draft',tracking=True)
|
||||
|
||||
def unlink(self):
|
||||
for order in self:
|
||||
if order.state not in ['draft']:
|
||||
raise UserError(_('You cannot delete this record'))
|
||||
return super(FamilyComplaints, self).unlink()
|
||||
|
||||
|
||||
def action_receiving_complaint(self):
|
||||
for rec in self:
|
||||
rec.state = 'receiving_complaint'
|
||||
|
||||
def action_review_complaint(self):
|
||||
for rec in self:
|
||||
rec.state = 'review_complaint'
|
||||
|
||||
def action_work_in_complaint(self):
|
||||
for rec in self:
|
||||
rec.state = 'work_in_complaint'
|
||||
|
||||
def action_done(self):
|
||||
for rec in self:
|
||||
rec.state = 'complaint_done'
|
||||
|
||||
def action_refuse(self):
|
||||
for rec in self:
|
||||
rec.state = 'refuse'
|
||||
|
||||
|
|
@ -135,4 +135,6 @@ access_home_furnishing_lines,access_home_furnishing_lines,model_home_furnishing_
|
|||
access_home_furnishing_items,access_home_furnishing_items,model_home_furnishing_items,base.group_user,1,1,1,1
|
||||
access_electricity_bill_lines,access_electricity_bill_lines,model_electricity_bill_lines,base.group_user,1,1,1,1
|
||||
access_water_bill_lines,access_water_bill_lines,model_water_bill_lines,base.group_user,1,1,1,1
|
||||
access_age_category,access_age_category,model_age_category,base.group_user,1,1,1,1
|
||||
access_age_category,access_age_category,model_age_category,base.group_user,1,1,1,1
|
||||
access_complaints_category,access_complaints_category,model_complaints_category,base.group_user,1,1,1,1
|
||||
access_family_complaints,access_family_complaints,model_family_complaints,base.group_user,1,1,1,1
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
<field name="domain">[('state','in',['not_leaving','black_list'])]
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- committees.line-->
|
||||
<!-- البحث الاجتماعي -->
|
||||
<!-- 1-اللجان الرجالية -->
|
||||
|
|
@ -277,6 +276,15 @@
|
|||
<p class="oe_view_nocontent_create">Create the Age Category
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="complaints_category_action">
|
||||
<field name="name">Complaints Category</field>
|
||||
<field name="res_model">complaints.category</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">Create the Complaints Category
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="visits_types_action">
|
||||
<field name="name">Visits Types</field>
|
||||
|
|
@ -733,6 +741,12 @@
|
|||
sequence="3"/>
|
||||
<menuitem id='benefit_services' name='Services'
|
||||
parent="benefits_root_menu" sequence="7"/>
|
||||
<!-- family complaints -->
|
||||
<menuitem id='family_complaints_menu' name='Family Complaints' parent='benefits_root_menu'
|
||||
sequence="3"/>
|
||||
<menuitem id='family_complaints_child_menu' name='Family Complaints' parent='family_complaints_menu'
|
||||
action="family_complaints_action"
|
||||
sequence="1"/>
|
||||
|
||||
<!--#ملفات المستفيدين-->
|
||||
<!--#طلب تسجيل مستفيد مبدئ-->
|
||||
|
|
@ -861,6 +875,9 @@
|
|||
<menuitem id="age_category_menu" name="Age Category" parent="menu_benefits_config_organizing"
|
||||
action="age_category_action"
|
||||
sequence="5"/>
|
||||
<menuitem id="complaints_category_menu" name="Complaints Category" parent="menu_benefits_config_organizing"
|
||||
action="complaints_category_action"
|
||||
sequence="6"/>
|
||||
<!-- <menuitem id="hobbies_settings_menu" name="Hobbies Settings" parent="menu_benefits_config_organizing"-->
|
||||
<!-- action="hobbies_settings_action"-->
|
||||
<!-- sequence="4"/>-->
|
||||
|
|
|
|||
|
|
@ -1277,5 +1277,39 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Complaints Category Form AND tree -->
|
||||
<record id="complaints_category_form" model="ir.ui.view">
|
||||
<field name="name">Complaints Category Form</field>
|
||||
<field name="model">complaints.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Complaints Category">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name"/>
|
||||
</div>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="color" required="True"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="age_category_tree" model="ir.ui.view">
|
||||
<field name="name">Complaints Category Tree</field>
|
||||
<field name="model">complaints.category</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Complaints Category" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="color" widget="color_picker" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<record id="family_complaints_view_form" model="ir.ui.view">
|
||||
<field name="name">family.complaints.view.form</field>
|
||||
<field name="model">family.complaints</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Family Complaints">
|
||||
<header>
|
||||
<button name="action_receiving_complaint" type="object" string="Receiving the complaint" states="draft" class="oe_highlight"/>
|
||||
<button name="action_review_complaint" type="object" string="Review Complaint" states="receiving_complaint" class="oe_highlight"/>
|
||||
<button name="action_work_in_complaint" type="object" string="Work in complaint" states="review_complaint" class="oe_highlight"/>
|
||||
<button name="action_done" type="object" string="Complaint Done" states="work_in_complaint" class="oe_highlight"/>
|
||||
<button name="action_refuse" type="object" string="Refuse" states="review_complaint,work_in_complaint" class="oe_highlight"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="complaints_date"/>
|
||||
<field name="family_id"/>
|
||||
<field name="researcher_id"/>
|
||||
<field name="branch_custom_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="priority" widget="priority"/>
|
||||
<field name="complaints_reason"/>
|
||||
<field name="message"/>
|
||||
<field name="complaints_category_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
|
||||
<field name="activity_ids" />
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="family_complaints_view_tree" model="ir.ui.view">
|
||||
<field name="name">family.complaints.view.tree</field>
|
||||
<field name="model">family.complaints</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Family Complaints">
|
||||
<field name="complaints_date"/>
|
||||
<field name="family_id"/>
|
||||
<field name="researcher_id"/>
|
||||
<field name="branch_custom_id"/>
|
||||
<field name="priority" widget="priority"/>
|
||||
<field name="complaints_reason"/>
|
||||
<field name="message"/>
|
||||
<field name="complaints_category_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="family_complaints_action">
|
||||
<field name="name">Family Complaints</field>
|
||||
<field name="res_model">family.complaints</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">Create the Family Complaints
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue