Commit 4935a933 by Arturo Jasso Origel

cambio en los permisos, se cambiaron los metodos, para poder cambiar la manera…

cambio en los permisos, se cambiaron los metodos, para poder cambiar la manera en la que e muestran los registros en la tabla y en el conteo, se agregaron campos de empresa,y erp user y 911 user, se eliminaron los logger y se agregaron campos a las vistas
parent 9728e484
......@@ -50,7 +50,8 @@ class HelpdeskTicket(models.Model):
module_impact = fields.Char("¿Tu solicitud, impacta de algún modo a algún otro Módulo?")
system_id = fields.Many2one('erp.system','Sistema')
team_admin_id = fields.Many2one('res.users',string="Administrador del equipo",related='team_id.team_admin_id')
comp_morsa = fields.Selection(related="partner_id.user_ids.comp_morsa",string='Empresa')
def _get_color(self):
in_progress_stage = self.env.ref('sh_all_in_one_helpdesk.in_progress_stage').id
......@@ -331,7 +332,7 @@ class HelpdeskTicket(models.Model):
if 'description' in vals and vals["description"] != "" and self.description != False and vals['description'] != '<p><br></p>':
min_description = int(self.env['ir.config_parameter'].sudo().get_param('helpdesk_morsa.description_min_lenght'))
description = self.get_description_len(vals["description"])
_logger.info(description)
if description-11 < min_description:
raise ValidationError (_("Favor de agregar al menos "+str(min_description)+" caracteres a la descripción"))
return super(HelpdeskTicket, self).write(vals)
......
......@@ -5,9 +5,20 @@ class ResUsers(models.Model):
_inherit = 'res.users'
warehouse_id = fields.Many2one('warehouse.helpdesk','Sucursal')
warehouse_ids = fields.Many2many(
string='Sucursales Permitidas',
comodel_name='warehouse.helpdesk',
relation='warehouse_helpdesk_res_users_rel'
)
#warehouse_ids = fields.Many2many(
# string='Sucursales Permitidas',
# comodel_name='warehouse.helpdesk',
# relation='warehouse_helpdesk_res_users_rel'
# )
name = fields.Char('Name',store=True)
comp_morsa = fields.Selection([
('gmm','Grupo Morsa de México'),
('energy','Energy Parts'),
('tracto','Tracto Unión'),
('refago','RefaGO'),
],'Empresa')
is_erp_user = fields.Boolean('Es usuario de ERP')
is_911_user = fields.Boolean('Es usuario de 911')
#partner_id = fields.Many2one('res.partner',required=False, )
......@@ -19,7 +19,7 @@
<field name="name">Helpdesk Administrador del equipo</field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_team" />
<field name="global" eval="True" />
<field name="domain_force">['|',('team_admin_id','=',user.id),('team_admin_id','=',False)]</field>
<field name="domain_force">['|','|',('team_admin_id','=',user.id),('team_admin_id','=',False)]</field>
<field name="groups" eval="[(4, ref('helpdesk_morsa.ticket_team_admin'))]" />
</record>
......@@ -28,9 +28,19 @@
<field name="name">Helpdesk Ticket Team Admin</field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_ticket" />
<field name="global" eval="True" />
<field name="domain_force">['|',('team_admin_id','=',user.id),('team_admin_id','=',False)]</field>
<field name="domain_force">['|','|',('team_admin_id','=',user.id),('team_admin_id','=',False),('team_id.team_members','in',[user.id])]</field>
<field name="groups" eval="[(4, ref('helpdesk_morsa.ticket_team_admin'))]" />
</record>
<record model="ir.rule" id="helpdesk_ticket_team_captain">
<field name="name">Helpdesk Ticket Captain View</field>
<field name="model_id" ref="sh_all_in_one_helpdesk.model_helpdesk_ticket" />
<field name="global" eval="True" />
<field name="domain_force">[('team_id.team_members','in',[user.id])]</field>
<field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_team_leader'))]" />
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -20,11 +20,11 @@
<field name="erp_type" widget="radio" attrs="{'invisible':[('is_erp', '=', False)]}" options="{'horizontal': true}"/>
<field name="erp_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="warehouse_id" attrs="{'invisible':[('is_erp', '=', False)]}"/>
<field name="module_route" attrs="{'invisible':[('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="process_text" attrs="{'invisible':[('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="required_validation" attrs="{'invisible':[('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="common_scenery" attrs="{'invisible':[('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="module_impact" attrs="{'invisible':[('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="module_route" attrs="{'invisible':['|',('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="process_text" attrs="{'invisible':['|',('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="required_validation" attrs="{'invisible':['|',('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="common_scenery" attrs="{'invisible':['|',('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="module_impact" attrs="{'invisible':['|', ('is_erp', '=', False),('erp_type','in',['mejora','reporte'])]}"/>
<field name="incidence_type" attrs="{'invisible':[('is_emergency', '=', False)]}"/>
</xpath>
<xpath expr="//header" position="replace">
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="res_users_inherit_morsa">
<field name="name">res.users.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="sh_all_in_one_helpdesk.sh_res_users_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sh_portal_user_access']" position="after">
<field name="warehouse_id" required="1"/>
<field name="warehouse_ids" widget="many2many_tags" required="1"/>
<field name="warehouse_id"/>
<field name="comp_morsa" required="1"/>
<field name="is_erp_user"/>
<field name="is_911_user"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="res_users_inherit_partner">
<field name="name">res.users.form.inherit.partner</field>
<field name="model">res.users</field>
<field name="priority" eval="20"/>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="replace">
<field name="partner_id" required="0" readonly="1"/>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -26,14 +26,17 @@
<a t-if="asistencia" t-attf-href="/my/erp?{{ keep_query() }}">Asistencia ERP</a>
<t t-else="">Asistencia ERP</t>
</li>
<li t-if="asistencia" class="breadcrumb-item active">
<t t-esc="asistencia.name" t-if="asistencia.name" />
<t t-else=""><em>Asistencia ERP</em></t>
</li>
<li t-if="page_name == 'ti' or ti" t-attf-class="breadcrumb-item #{'active ' if not ti else ''}">
<a t-if="ti" t-attf-href="/my/911?{{ keep_query() }}">TI 911</a>
<t t-else="">TI 911</t>
</li>
<li t-if="ti" class="breadcrumb-item active">
<t t-esc="ti.name" t-if="ti.name" />
<t t-else=""><em>TI 911</em></t>
......
......@@ -15,23 +15,26 @@
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/support.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/support_back.svg'"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">Mejora o Asistencia ERP</t>
<t t-set="url" t-value="'/my/erp'" />
<t t-set="count" t-value="erp_count" />
<t t-set="desc" t-value="'Soporte o Mejoras Odoo'"/>
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/erp.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/erp_back.svg'"/>
<t t-if="request.env.user.is_erp_user">
<t t-call="portal.portal_docs_entry" >
<t t-set="title">Mejora o Asistencia ERP</t>
<t t-set="url" t-value="'/my/erp'" />
<t t-set="count" t-value="erp_count" />
<t t-set="desc" t-value="'Soporte o Mejoras Odoo'"/>
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/erp.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/erp_back.svg'"/>
</t>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">TI 911</t>
<t t-set="url" t-value="'/my/911'" />
<t t-set="count" t-value="ti_count" />
<t t-set="desc" t-value="'Emergerncias'"/>
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/emergency.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/emergency_back.svg'"/>
<t t-if="request.env.user.is_911_user">
<t t-call="portal.portal_docs_entry">
<t t-set="title">TI 911</t>
<t t-set="url" t-value="'/my/911'" />
<t t-set="count" t-value="ti_count" />
<t t-set="desc" t-value="'Emergerncias'"/>
<t t-set="avatar" t-value="'/helpdesk_morsa/static/src/img/emergency.svg'"/>
<t t-set="background" t-value="'/helpdesk_morsa/static/src/img/emergency_back.svg'"/>
</t>
</t>
</div>
</div>
<div class="oe_structure" id="oe_structure_portal_my_ti_2"/>
......
......@@ -37,15 +37,13 @@
<field name="name">Helpdesk Ticket Team Leader</field>
<field name="model_id" ref="model_helpdesk_ticket" />
<field name="global" eval="True" />
<field name="domain_force">['|','|','|','&amp;',('team_head','=',user.id),('team_head','=',False),('user_id','=',user.id),('sh_user_ids','in',[user.id]),('team_id.team_head','=',user.id)]</field>
<!-- <field name="domain_force">['|','|','|','|','|',('team_head','=',user.id),('team_head','=',False),('user_id','=',user.id),('user_id','=',False),('sh_user_ids','in',[user.id]),('sh_user_ids','=',False)]</field> -->
<field name="domain_force">['|','|','|','&amp;',('team_head','=',user.id),('team_head','=',False),('user_id','=',user.id),('team_id.team_members','in',[user.id]),('team_id.team_head','=',user.id)]</field>
<field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_team_leader'))]" />
</record>
<record model="ir.rule" id="helpdesk_ticket_assigned_user_rule">
<field name="name">Helpdesk Ticket Assigned User</field>
<field name="model_id" ref="model_helpdesk_ticket" />
<field name="global" eval="True" />
<!-- <field name="domain_force">['|','|',('user_id','=',user.id),('user_id','=',False),('sh_user_ids','in',[user.id])]</field> -->
<field name="domain_force">['&amp;',('team_id.team_members','in',[user.id]),'|',('sh_user_ids','in',[user.id]),('user_id','=',user.id)]</field>
<field name="groups" eval="[(4, ref('sh_all_in_one_helpdesk.helpdesk_group_user'))]" />
</record>
......
......@@ -9,6 +9,7 @@
<div id="js_ticket_count_div">
<div>
<div class="row">
<t t-if="data_dict">
<t t-foreach="data_dict.keys()" t-as="value">
<t t-set="list_ids" t-value="data_dict[value][0][0]" />
......@@ -75,6 +76,7 @@
<div id="js_ticket_tbl_div">
<div>
<div class="row" style="margin: 0;">
<t t-if="ticket_data_dic">
<div class="modal fade whatsapp_modal" tabindex="-1" role="dialog" aria-labelledby="whatsappModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
......@@ -131,6 +133,7 @@
</div>
</div>
</div>
<t t-foreach="ticket_data_dic.keys()" t-as="ticket">
<div class="col-md-12" style="margin-bottom: 20px; box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); padding-left: 0 !important; padding-right: 0 !important;">
<h3 style="padding: 10px; margin-top: 7px; margin-bottom: 7px;">
......
......@@ -21,3 +21,4 @@
#############################################################################
from .hooks import test_pre_init_hook, test_post_init_hook
from . import wizard
from . import models
......@@ -38,6 +38,7 @@
'views/theme.xml',
'views/assets.xml',
'data/theme_data.xml',
'views/res_users.xml',
],
'assets': {
'web.assets_backend': {
......
from . import res_user
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class ResUsersVista(models.Model):
_inherit = 'res.users'
only_all_app = fields.Boolean('Ver apps')
\ No newline at end of file
......@@ -55,18 +55,24 @@
</div>
<h6 class="sidebar_head">MENU</h6>
<ul class="sidebar_menu">
<t t-foreach="menuService.getApps()" t-as="app">
<li data-toggle="tooltip" data-placement="right" t-att-title="app.name">
<a role="menuitem"
t-attf-href="#menu_id={{app.id}}"
class="nav-link">
<img class="sidebar_img"
t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
<span class="sidebar_app_name">
<t t-esc="app.name"/>
</span>
</a>
</li>
<li data-toggle="tooltip" data-placement="right" t-att-title="app.name">
<a role="menuitem"
t-attf-href="#menu_id={{app.id}}"
class="nav-link"
>
<img class="sidebar_img"
t-attf-src="data:image/png;base64,{{app.webIconData}}"/>
<span class="sidebar_app_name">
<t t-esc="app.name"/>
</span>
</a>
</li>
</t>
</ul>
</div>
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="res_users_inherit_only_app">
<field name="name">res.users.form.inherit.partner</field>
<field name="model">res.users</field>
<field name="priority" eval="20"/>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="only_all_app"/>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment