cambios y adecuaciones para la implemantación condiferentes modulos como de…

cambios y adecuaciones para la implemantación condiferentes modulos como de mantenimiento y futuro rh
parent 1804d8fb
from . import controllers
from . import models
\ No newline at end of file
# -*- coding: utf-8 -*-
{
"name":"Mantenimiento Morsa",
"author":"Arturo Jasso",
"website":"",
"support":"arturo.jasso@morsa.com.mx",
"category":"Discuss",
"license":"OPL-1",
"summary":"Actualizaciones y adecuaciones para el área de mantenimineto",
"description":"""Actualización para requerimientos de morsa """,
"version":"15.0.34",
"depends": [
"base",
"portal_design_helpdesk",
"sh_all_in_one_helpdesk",
"vista_backend_theme",
"hide_odoo",
"helpdesk_morsa",
],
"data": [
'data/helpdesk_team.xml',
'data/maintenance_type.xml',
'views/portal_my.xml',
'views/portal_maintenance.xml',
],
'assets': {
'web.assets_frontend': [
'/helpdesk_maintenance/static/src/scss/portal.scss',
'/helpdesk_maintenance/static/src/js/portal.js',
],
},
"application":False,
"auto_install":False,
"installable":True,
}
from . import portal
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="maintenance" model="helpdesk.team">
<field name="name">Mantenimiento</field>
<field name="short_name">MAN</field>
<field name="team_head" ref="base.user_admin"/>
<field name="sh_resource_calendar_id" ref="resource.resource_calendar_std"/>
</record>
</data>
</odoo>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="air_conditioning" model="maintenance.type">
<field name="name">Aire acondicionado</field>
</record>
<record id="brickwork" model="maintenance.type">
<field name="name">Aire acondicionado</field>
</record>
<record id="electricity" model="maintenance.type">
<field name="name">Electricidad (contactos, generadores, transformadores, tableros)</field>
</record>
<record id="plumbing_outside" model="maintenance.type">
<field name="name">Fontaneria (cisternas, tinacos, aljibes, fosas)</field>
</record>
<record id="smithy" model="maintenance.type">
<field name="name">Herreria</field>
</record>
<record id="lightning" model="maintenance.type">
<field name="name">Iluminación (lamparas de oficinas, almacen, racks, exteriores)</field>
</record>
<record id="plumbing_inside" model="maintenance.type">
<field name="name">Plomeria (baños y comedor)</field>
</record>
<record id="emergency" model="maintenance.type">
<field name="name">Urgencia (comprometa la seguridad física o patrimonial</field>
</record>
</data>
</odoo>
\ No newline at end of file
from . import helpdesk_ticket
from . import maintenance_type
\ No newline at end of file
from odoo import models, fields, api, _, SUPERUSER_ID
import random
from datetime import datetime, timedelta
from odoo.tools import email_re, email_escape_char, email_split
from odoo.exceptions import UserError,ValidationError
from odoo.tools import email_re
import uuid
import pytz
import logging
_logger = logging.getLogger(__name__)
class HelpdeskTicket(models.Model):
_inherit = 'helpdesk.ticket'
maintenance_type_id = fields.Many2one('maintenance.type',string="Tipo mantenimiento")
date_fail = fields.Date('Fecha de falla')
severity_type = fields.Selection([
('1','Leve'),
('2','Medio'),
('3','Grave'),
])
fail_type = fields.Selection([
('fail','Falla'),('warranty','Garantía')
],string="Tipo de falla")
def _compute_access_url(self):
super(HelpdeskTicket, self)._compute_access_url()
for ticket in self:
if ticket.team_id.id == self.env.ref('helpdesk_maintenance.maintenance').id:
ticket.access_url = '/my/manteniminetos/%s' % (ticket.id)
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class MaintenanceType(models.Model):
_name = 'maintenance.type'
_rec_name = 'name'
name = fields.Char('Nombre')
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="520px"
height="520px" viewBox="0 0 520 520" style="enable-background:new 0 0 520 520;" xml:space="preserve">
<g id="_x36_49_x2C__Maintenance_x2C__Support_x2C__Technical_x2C__Fix">
<g>
<circle style="fill:#BCE4FF;" cx="452.5" cy="75.29" r="30"/>
<path style="fill:#BCE4FF;" d="M62.5,375.29c13.81,0,25,11.19,25,25s-11.19,25-25,25s-25-11.19-25-25S48.69,375.29,62.5,375.29z"
/>
<path style="fill:#33383F;" d="M317.23,100.75c0,19.3-9.121,36.46-23.28,47.43c-3.601,2.8-7.53,5.19-11.72,7.11v39.09v29.36v2.74
V338.1c-8.041,3.86-17.03,6.03-26.5,6.03c-8.31,0-16.24-1.67-23.5-4.66V225.1v-31.59v-38.22c-4.13-1.9-8.01-4.25-11.57-7
c-14.25-10.95-23.43-28.17-23.43-47.54c0-26.12,16.7-48.34,40-56.57v56.57h40V44.18C300.529,52.41,317.23,74.63,317.23,100.75z"/>
<path style="fill:#5CBEFF;" d="M347.5,282.39c0,50.42-41.311,91.74-91.74,91.74c-50.63,0-91.94-41.32-91.94-91.74
c0-42.5,29.12-78.43,68.41-88.879v31.59c-22.5,9.29-38.41,31.48-38.41,57.26c0,25.67,15.91,47.83,38.41,57.109
c7.26,2.99,15.19,4.66,23.5,4.66c9.47,0,18.459-2.17,26.5-6.03c22.5-9.279,38.41-31.439,38.41-57.109
c0-25.78-15.91-47.97-38.41-57.25v-29.36C319.87,205.82,347.5,240.99,347.5,282.39z"/>
<path style="fill:#3256C1;" d="M255.76,374.13c50.43,0,91.74-41.32,91.74-91.74c0-41.399-27.63-76.57-65.27-88.01v-39.09
c4.189-1.92,8.119-4.31,11.72-7.11c13.89,3.76,26.88,9.51,38.729,17.08l47.61-30.22l25.989,26l-30.139,47.6
c8.529,13.48,14.869,28.43,18.439,44.51l54.92,12.27v36.8l-54.92,12.271c-3.57,16.08-9.91,31.03-18.439,44.51l30.139,47.61
L380.29,432.6l-47.61-30.14c-13.4,8.53-28.43,14.87-44.51,18.44l-12.27,54.92h-36.8l-12.27-54.92
c-16.08-3.57-31.03-9.91-44.51-18.44l-47.61,30.14l-25.99-25.989L138.86,359c-8.53-13.4-14.87-28.43-18.44-44.51L65.5,302.22
v-36.8l54.92-12.27c3.57-16.081,9.91-31.03,18.44-44.51l-30.14-47.6l25.99-26l47.61,30.22c11.74-7.5,24.59-13.21,38.34-16.97
c3.56,2.75,7.44,5.1,11.57,7v38.22c-39.29,10.45-68.41,46.38-68.41,88.879C163.82,332.81,205.13,374.13,255.76,374.13z"/>
<path d="M457.061,365.58c3.979,1.13,6.289,5.29,5.149,9.27c-1.14,3.98-5.29,6.29-9.271,5.15c-3.979-1.14-6.289-5.29-5.149-9.27
C448.92,366.75,453.08,364.44,457.061,365.58z"/>
<path d="M442.061,165.58c3.979,1.14,6.289,5.29,5.149,9.27c-1.13,3.98-5.29,6.29-9.271,5.15c-3.979-1.13-6.289-5.29-5.149-9.27
S438.08,164.44,442.061,165.58z"/>
<path d="M372.061,55.58c3.979,1.14,6.289,5.29,5.149,9.27c-1.13,3.98-5.29,6.29-9.271,5.15c-3.979-1.13-6.289-5.29-5.149-9.27
S368.08,54.44,372.061,55.58z"/>
<path d="M337.061,440.58c3.979,1.14,6.289,5.29,5.149,9.27c-1.14,3.98-5.29,6.29-9.271,5.15c-3.979-1.13-6.289-5.29-5.149-9.27
C328.92,441.75,333.08,439.44,337.061,440.58z"/>
<path d="M162.06,445.58c3.98,1.13,6.29,5.29,5.15,9.27c-1.14,3.98-5.29,6.29-9.27,5.15s-6.29-5.29-5.15-9.27
C153.92,446.75,158.08,444.44,162.06,445.58z"/>
<path d="M152.06,40.58c3.98,1.14,6.29,5.29,5.15,9.27c-1.13,3.98-5.29,6.29-9.27,5.15c-3.98-1.13-6.29-5.29-5.15-9.27
S148.08,39.44,152.06,40.58z"/>
<circle cx="65.29" cy="213.23" r="7.498"/>
<path d="M57.06,80.58c3.98,1.14,6.29,5.29,5.15,9.27c-1.13,3.98-5.29,6.29-9.27,5.15c-3.98-1.13-6.29-5.29-5.15-9.27
S53.08,79.44,57.06,80.58z"/>
<path d="M255.76,379.13c-53.453,0-96.94-43.397-96.94-96.74c0-43.881,29.659-82.417,72.125-93.711
c2.669-0.708,5.408,0.878,6.117,3.547c0.71,2.668-0.878,5.407-3.547,6.117c-38.092,10.131-64.695,44.693-64.695,84.047
c0,47.829,39.001,86.74,86.94,86.74c47.828,0,86.74-38.911,86.74-86.74c0-37.957-25.382-72.18-61.725-83.226
c-2.642-0.803-4.133-3.596-3.329-6.238c0.803-2.642,3.597-4.132,6.237-3.33c19.44,5.908,36.945,18.176,49.289,34.543
c12.775,16.939,19.527,37.083,19.527,58.25C352.5,335.732,309.103,379.13,255.76,379.13z"/>
<path d="M232.228,344.471c-0.635,0-1.281-0.121-1.904-0.379c-25.213-10.397-41.504-34.629-41.504-61.731
c0-27.183,16.291-51.472,41.502-61.882c2.553-1.053,5.476,0.162,6.53,2.713c1.054,2.552-0.161,5.476-2.713,6.53
c-21.455,8.858-35.318,29.521-35.318,52.639c0,23.037,13.863,43.639,35.316,52.487c2.553,1.053,3.769,3.976,2.716,6.528
C236.057,343.305,234.193,344.471,232.228,344.471z"/>
<path d="M282.232,343.101c-1.965,0-3.829-1.165-4.625-3.095c-1.053-2.553,0.164-5.476,2.717-6.528
c21.453-8.848,35.316-29.45,35.316-52.487c0-23.122-13.863-43.779-35.316-52.628c-2.553-1.053-3.77-3.976-2.717-6.528
c1.053-2.553,3.976-3.769,6.529-2.716c25.213,10.398,41.504,34.685,41.504,61.872c0,27.103-16.291,51.334-41.504,61.731
C283.513,342.979,282.867,343.101,282.232,343.101z"/>
<path d="M275.9,480.82h-36.8c-2.341,0-4.369-1.625-4.88-3.91l-11.585-51.856c-14.129-3.469-27.652-9.074-40.283-16.696
l-44.968,28.467c-1.975,1.253-4.556,0.966-6.21-0.689l-25.99-25.989c-1.654-1.653-1.94-4.233-0.689-6.21l28.462-44.961
c-7.6-12.538-13.204-26.063-16.692-40.289L64.41,307.1c-2.285-0.511-3.91-2.538-3.91-4.88v-36.8c0-2.342,1.625-4.369,3.91-4.88
l51.856-11.585c3.469-14.128,9.074-27.651,16.696-40.283l-28.467-44.958c-1.251-1.976-0.965-4.556,0.688-6.209l25.99-26
c1.656-1.658,4.238-1.941,6.216-0.687l44.955,28.535c11.461-6.965,23.892-12.303,36.997-15.887
c2.665-0.73,5.414,0.841,6.142,3.504c0.729,2.664-0.84,5.414-3.504,6.142c-13.175,3.603-25.613,9.107-36.967,16.361
c-1.637,1.047-3.731,1.05-5.372,0.008l-44.227-28.073l-20.329,20.337l28,44.22c1.034,1.633,1.034,3.715,0,5.349
c-8.438,13.334-14.421,27.775-17.784,42.92c-0.42,1.894-1.898,3.373-3.791,3.796L70.5,269.426v28.788l51.01,11.396
c1.893,0.423,3.371,1.902,3.791,3.796c3.389,15.266,9.37,29.702,17.776,42.909c1.041,1.634,1.043,3.722,0.007,5.359l-28,44.229
l20.331,20.33l44.229-27.999c1.633-1.033,3.715-1.034,5.348-0.001c13.334,8.438,27.774,14.422,42.92,17.785
c1.893,0.42,3.373,1.897,3.796,3.791l11.396,51.01h28.787l11.396-51.01c0.423-1.894,1.903-3.371,3.796-3.791
c15.267-3.39,29.703-9.371,42.909-17.777c1.634-1.04,3.724-1.043,5.359-0.007l44.229,27.999l20.331-20.33l-27.999-44.229
c-1.034-1.633-1.034-3.716-0.001-5.349c8.438-13.334,14.421-27.774,17.784-42.92c0.42-1.894,1.897-3.373,3.791-3.796l51.01-11.396
v-28.788l-51.01-11.396c-1.893-0.423-3.371-1.902-3.791-3.796c-3.363-15.145-9.346-29.586-17.784-42.92
c-1.034-1.633-1.033-3.716,0.001-5.349l27.999-44.22l-20.329-20.337l-44.227,28.073c-1.64,1.042-3.734,1.039-5.371-0.008
c-11.461-7.321-24.025-12.862-37.345-16.467c-2.665-0.721-4.241-3.467-3.52-6.133c0.722-2.665,3.47-4.24,6.133-3.52
c13.257,3.588,25.822,8.965,37.398,16l44.955-28.535c1.979-1.256,4.56-0.97,6.216,0.687l25.99,26
c1.653,1.654,1.939,4.233,0.688,6.209l-28.467,44.958c7.623,12.632,13.228,26.154,16.697,40.283l51.855,11.585
c2.285,0.511,3.91,2.538,3.91,4.88v36.8c0,2.342-1.625,4.369-3.91,4.88l-51.855,11.586c-3.471,14.129-9.075,27.651-16.697,40.282
l28.467,44.968c1.252,1.977,0.965,4.557-0.688,6.21l-25.989,25.989c-1.656,1.655-4.234,1.941-6.211,0.689l-44.961-28.463
c-12.537,7.601-26.063,13.204-40.289,16.693l-11.586,51.855C280.27,479.195,278.241,480.82,275.9,480.82z"/>
<path d="M62.5,430.29c-16.542,0-30-13.458-30-30s13.458-30,30-30s30,13.458,30,30S79.042,430.29,62.5,430.29z M62.5,380.29
c-11.028,0-20,8.972-20,20s8.972,20,20,20s20-8.972,20-20S73.528,380.29,62.5,380.29z"/>
<path d="M452.5,110.29c-19.299,0-35-15.701-35-35s15.701-35,35-35s35,15.701,35,35S471.799,110.29,452.5,110.29z M452.5,50.29
c-13.785,0-25,11.215-25,25s11.215,25,25,25s25-11.215,25-25S466.285,50.29,452.5,50.29z"/>
<path d="M255.73,349.13c-8.742,0-17.289-1.694-25.404-5.037c-1.873-0.771-3.096-2.597-3.096-4.623V158.405
c-3.389-1.769-6.616-3.832-9.626-6.158c-16.122-12.389-25.374-31.161-25.374-51.497c0-27.5,17.415-52.129,43.334-61.284
c1.531-0.542,3.228-0.305,4.553,0.632c1.325,0.937,2.113,2.459,2.113,4.082v51.57h30V44.18c0-1.623,0.787-3.145,2.112-4.082
c1.324-0.938,3.021-1.173,4.553-0.632c25.919,9.155,43.335,33.784,43.335,61.284c0,20.238-9.191,38.966-25.219,51.383
c-3.057,2.377-6.338,4.482-9.781,6.276V338.1c0,1.923-1.104,3.675-2.836,4.508C275.379,346.936,265.735,349.13,255.73,349.13z
M237.23,336.02c5.965,2.065,12.173,3.11,18.5,3.11c7.455,0,14.672-1.435,21.5-4.269V155.29c0-1.955,1.139-3.731,2.916-4.545
c3.814-1.748,7.426-3.938,10.734-6.511c13.57-10.514,21.35-26.361,21.35-43.483c0-20.826-11.801-39.704-30-48.993v48.993
c0,2.761-2.239,5-5,5h-40c-2.761,0-5-2.239-5-5V51.757c-18.2,9.289-30,28.167-30,48.993c0,17.205,7.828,33.087,21.477,43.575
c3.274,2.529,6.842,4.688,10.613,6.422c1.773,0.816,2.91,2.59,2.91,4.542V336.02z"/>
</g>
</g>
<g id="Layer_1">
</g>
</svg>
$(document).ready(function(e) {
$("#form_id").submit(function (e){
var ticket_type = $("#tck_type").val();
if (ticket_type == "mantenimiento"){
var req = required_maintenance()
if(req['portal_contact_name'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Nombre");
}
if(req['portal_email'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Correo");
}
if(req['portal_phone'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Teléfono");
}
if(req['portal_main_type'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Tipo de mantenimiento");
}
if(req['portal_date_fail'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Fecha de Falla");
}
if(req['portal_severity'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Tipo de Gravedad");
}
if(req['portal_description'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Descripción");
}
if(req['portal_fail_type'] == ""){
e.preventDefault();
show_error("Es necesario llenar el campo de Tipo de Falla");
}
if(req['portal_file'] == 0){
e.preventDefault();
show_error("Es necesario agregar los archivos de evidencia|");
}
}
});
function required_maintenance(){
return {
'partner_id': $("#partner_id").val(),
'portal_contact_name': $("#portal_contact_name").val(),
'portal_email': $("#portal_email").val(),
'portal_phone': $("#portal_phone").val(),
'portal_main_type': $("#portal_main_type").val(),
'portal_date_fail': validate_Date($("#portal_date_fail").val()),
'portal_severity': $("#portal_severity").val(),
'portal_description': $("#portal_description").val(),
'portal_fail_type': $("#portal_fail_type").val(),
'portal_file': document.getElementById('portal_file').files.length
}
}
function show_error(message){
return swal({
title:"Error",
text: message,
icon: "error",
buttons: "Ok",
})
}
function validate_Date(date){
let dateformat = /^(0?[1-9]|[1-2][0-9]|3[01])[\/](0?[1-9]|1[0-2])/;
if (date.match(dateformat)){
let ListofDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
dt = date.split("/");
day = parseInt(dt[0])
month = parseInt(dt[1])
year = parseInt(dt[2])
if (month > 0 && month <= ListofDays.length){
if( day > 0 && day <= ListofDays[month-1]){
return date
}else{
return "";
}
}else{
return "";
}
}else{
return "";
}
}
});
\ No newline at end of file
.mr5{
margin-right: 5px;
}
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_home_maintenance" name="Portal My Home : IT" inherit_id="portal.portal_my_home" priority="101">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Mantenimiento</t>
<t t-set="url" t-value="'/my/mantenimiento'" />
<t t-set="background" t-value="'/helpdesk_maintenance/static/src/img/mantenimiento.svg'"/>
</t>
</xpath>
</template>
<template id="portal_my_home_menu_ticket" name="Portal layout : ticket menu entries" inherit_id="portal.portal_breadcrumbs" priority="60">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'maintenance' or maintenance" t-attf-class="breadcrumb-item #{'active ' if not soporte else ''}">
<a t-if="maintenance" t-attf-href="/my/soporte?{{ keep_query() }}">Soporte Mantenimiento</a>
<t t-else="">Mantenimiento</t>
</li>
<li t-if="maintenance" class="breadcrumb-item active">
<t t-esc="maintenance.name" t-if="maintenance.name" />
<t t-else=""><em>Mantenimiento</em></t>
</li>
</xpath>
</template>
<template id="portal_my_maintenance" name="Mantenimiento">
<t t-call="portal.portal_layout">
<t t-set="my_details" t-value="True"/>
<div class="o_portal_my_home">
<div class="oe_structure" id="oe_structure_portal_my_ti_1"/>
<h3>Solicitud de Mantenimiento</h3>
<div id="portal_cards" class="o_portal_docs row">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Mantenimiento</t>
<t t-set="url" t-value="'/my/mantenimientos'" />
<t t-set="count" t-value="maintenance_count" />
<t t-set="desc" t-value="'Levanta tu nuevo ticket de mantenimiento'"/>
<t t-set="avatar" t-value="'/helpdesk_maintenance/static/src/img/matenimiento_icon.svg'"/>
<t t-set="background" t-value="'/helpdesk_maintenance/static/src/img/mantenimineto_back.svg'"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">Emergencias</t>
<t t-set="url" t-value="'/my/erp'" />
<t t-set="count" t-value="erp_count" />
<t t-set="desc" t-value="'Soporte y 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>
</div>
</div>
<div class="oe_structure" id="oe_structure_portal_my_ti_2"/>
</t>
</template>
</odoo>
\ No newline at end of file
......@@ -18,6 +18,7 @@
],
"data": [
'security/ir.model.access.csv',
'data/region.xml',
'data/helpdesk_team.xml',
'data/helpdesk_stage.xml',
'data/sla_policies.xml',
......
......@@ -25,17 +25,12 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
return {}
@http.route('/my/ti',type='http',auth="user",website=True)
def prepare_portal_ti(self,**kw):
values = self._prepare_home_portal_values()
return request.render("helpdesk_morsa.portal_my_ti",values)
@http.route('/selected-partner-data',type="http",auth="public",csrf=False)
def selected_partner_data(self, **kw):
dic = {}
......@@ -51,13 +46,6 @@ class PortalHelpdeskMorsa(PortalHelpdesk):
return json.dumps(dic)
@http.route(['/unvaluated/tickets'],type='http',auth="none",website=True,csrf=False)
def verify_unvaluated_tikets(self,**kw):
......
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<record id="region_northwest" model="region.helpdesk">
<field name="name">Noroeste</field>
</record>
<record id="region_west" model="region.helpdesk">
<field name="name">Occidente</field>
</record>
<record id="region_southeast" model="region.helpdesk">
<field name="name">Sureste</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -3,60 +3,79 @@
<data noupdate="1">
<record id="wh_zapopan" model="warehouse.helpdesk">
<field name="name">ZAPOPAN</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_culiacan" model="warehouse.helpdesk">
<field name="name">CULIACAN</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_mochis" model="warehouse.helpdesk">
<field name="name">MOCHIS</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_mazatlan" model="warehouse.helpdesk">
<field name="name">MAZATLAN</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_merida" model="warehouse.helpdesk">
<field name="name">MERIDA</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_la_paz" model="warehouse.helpdesk">
<field name="name">LA PAZ</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_cancun" model="warehouse.helpdesk">
<field name="name">CANCUN</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_tepic" model="warehouse.helpdesk">
<field name="name">TEPIC</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_villahermosa" model="warehouse.helpdesk">
<field name="name">VILLAHERMOSA</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_durango" model="warehouse.helpdesk">
<field name="name">DURANGO</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_guadalajara" model="warehouse.helpdesk">
<field name="name">GUADALAJARA</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_campeche" model="warehouse.helpdesk">
<field name="name">CAMPECHE</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_veracruz" model="warehouse.helpdesk">
<field name="name">VERACRUZ</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_hermosillo" model="warehouse.helpdesk">
<field name="name">HERMOSILLO</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_obregon" model="warehouse.helpdesk">
<field name="name">OBREGON</field>
<field name="region_id" ref="helpdesk_morsa.region_northwest"/>
</record>
<record id="wh_queretaro" model="warehouse.helpdesk">
<field name="name">QUERETARO</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_oaxaca" model="warehouse.helpdesk">
<field name="name">OAXACA</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
<record id="wh_torreon" model="warehouse.helpdesk">
<field name="name">TORREON</field>
<field name="region_id" ref="helpdesk_morsa.region_west"/>
</record>
<record id="wh_tuxtla" model="warehouse.helpdesk">
<field name="name">TUXTLA</field>
<field name="region_id" ref="helpdesk_morsa.region_southeast"/>
</record>
</data>
</odoo>
\ No newline at end of file
from . import ticket_reason
from . import warehouse_helpdesk
from . import erp_module
from . import region_helpdesk
from . import res_users
from . import helpdesk_team
from . import helpdesk_ticket
from . import helpdesk_settings
from . import helpdesk_sla
......@@ -6,5 +6,5 @@ class ErpModules(models.Model):
_rec_name = "name"
name = fields.Char(string="Nombre")
\ No newline at end of file
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class RegionHelpdesk(models.Model):
_name = 'region.helpdesk'
_rec_name = 'name'
name = fields.Char('Nombre')
\ No newline at end of file
......@@ -6,5 +6,5 @@ class WarehouseHelpdesk(models.Model):
_rec_name = "name"
name = fields.Char('Nombre')
region_id = fields.Many2one('region.helpdesk','Región')
\ No newline at end of file
......@@ -8,3 +8,5 @@ hlp_warehouse_helpdesk,warehouse.helpdesk.admin,model_warehouse_helpdesk,sh_all_
user_ticket_reason,ticket.reason.user,model_ticket_reason,base.group_user,,1,0,0,0
hlp_ticket_reason,ticket.reason.admin,model_ticket_reason,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
user_region_helpdesk,region.helpdesk.user,model_region_helpdesk,base.group_user,,1,0,0,0
hlp_region_helpdesk,region.helpdesk.admin,model_region_helpdesk,sh_all_in_one_helpdesk.helpdesk_group_manager,1,1,1,1
\ No newline at end of file
......@@ -41,10 +41,7 @@ $(document).ready(function(e) {
var ticket_type = $("#tck_type").val();
if(ticket_type == 'soporte'){
var rqued = required_support();
console.log(rqued);
ajax_unvalued_tickets(rqued);
console.log('Sin valorar');
console.log(unvaluated);
if (rqued['portal_contact_name'] == ""){
e.preventDefault();
swal({
......
......@@ -7,6 +7,7 @@
<field name="arch" type="xml">
<tree editable="top">
<field name="name"/>
<field name="region_id"/>
</tree>
</field>
</record>
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="portal_my_home_IT" name="Portal My Home : IT" inherit_id="portal.portal_my_home" priority="100">
<template id="portal_my_home_it" name="Portal My Home : IT" inherit_id="portal.portal_my_home" priority="100">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Tecnologías de la información</t>
......@@ -13,8 +11,6 @@
</xpath>
</template>
<template id="portal_my_home_menu_ticket" name="Portal layout : ticket menu entries" inherit_id="portal.portal_breadcrumbs" priority="60">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'soporte' or soporte" t-attf-class="breadcrumb-item #{'active ' if not soporte else ''}">
......
......@@ -6,7 +6,7 @@
<div class="o_portal_my_home">
<div class="oe_structure" id="oe_structure_portal_my_ti_1"/>
<h3>Mesa de Ayuda</h3>
<div class="o_portal_docs row">
<div id="portal_cards" class="o_portal_docs row" >
<t t-call="portal.portal_docs_entry">
<t t-set="title">Soporte Técnico</t>
<t t-set="url" t-value="'/my/soporte'" />
......@@ -16,7 +16,7 @@
<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">Asistencia ERP / Odoo</t>
<t t-set="title">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 y Mejoras Odoo'"/>
......
......@@ -4,14 +4,11 @@
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True" />
<t t-call="portal.portal_searchbar">
<t t-set="title">Soporte Técnico</t>
</t>
<input type="hidden" name="mdl_shw" id="mdl_shw" t-att-value="created"/>
<div id="createticketModal" class="modal fade" role="dialog">
<div class="modal-dialog">
......
......@@ -28,6 +28,7 @@
'assets': {
'web.assets_frontend': [
'/portal_design_helpdesk/static/src/scss/portal.scss',
'/portal_design_helpdesk/static/src/js/portal.js',
],
},
"application":False,
......
$(document).ready(function(e) {
var card = document.getElementById('portal_cards');
var cards = card.children;
if(cards.length == 1){
card.appendChild(newdiv1);
for (var i = 0; i <= cards.length; i++){
cards[i].classList.remove("col-lg-4");
cards[i+1].classList.add("col-lg-6");
}
}
if(cards.length == 2){
for (var i = 0; i <= cards.length; i++){
cards[i].classList.remove("col-lg-4");
cards[i].classList.add("col-lg-6");
}
}
});
/*var card = $('#portal_cards').children('div')
var cards = card.length;
if(cards == 1){
card.each(function (){
var element = $(this)
element.removeClass('col-lg-4');
element.addClass('col-lg-6');
element.addClass('o_center_object');
})
}else if(cards == 2){
card.each(function (){
var element = $(this)
element.removeClass('col-lg-4');
element.addClass('col-lg-6');
})
}*/
......@@ -56,7 +56,6 @@
}
/* Card Styles */
$deeppurple500: #673ab7;
$grey500: #9e9e9e;
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_layout_inherit" name="portal inherit" inherit_id="portal.portal_layout">
<xpath expr="//div[@id='o_my_sidebar']" position="replace">
<xpath expr="//div[@id='o_my_sidebar']" position="replace"></xpath>
<xpath expr="//div[@t-attf-class='col-12 col-md col-lg-6']" position="after">
<div class="col-sm-12 col-md-12 col-lg-1"/>
</xpath>
<xpath expr="//div[@t-attf-class='col-12 col-md col-lg-6']" position="before">
<div class="col-sm-12 col-md-12 col-lg-1"/>
</xpath>
<xpath expr="//div[@t-attf-class='col-12 col-md col-lg-6']" position="attributes">
<attribute name="t-attf-class">col-12 col-md-12 col-lg-12 col-xl-12 col-sm-12</attribute>
<attribute name="t-attf-class">col-lg-10 col-md-12 col-sm-12</attribute>
</xpath>
</template>
......@@ -20,83 +29,75 @@
<xpath expr="//h3" position="replace">
<h2>BIENVENIDO</h2>
</xpath>
<xpath expr="//div[@class='o_portal_docs list-group']" position="attributes">
<attribute name="class">o_portal_docs row</attribute>
<attribute name="id">portal_cards</attribute>
</xpath>
</template>
<template id="remove_invoices" name="remove invoices" inherit_id="account.portal_my_home_invoice">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace">
<div></div>
</xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="remove_sale_orders" name="remove sale orders" inherit_id="sale.portal_my_home_sale">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace">
<div></div>
</xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace">
<div></div>
</xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="remove_purchase_orders" name="remove purchase orders" inherit_id="purchase.portal_my_home_purchase">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace">
<div></div>
</xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace">
<div></div>
</xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="remove_proyects" name="remove proyects" inherit_id="project.portal_my_home">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"><div></div></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"><div></div></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="template_id" name="template_name" inherit_id="sh_all_in_one_helpdesk.portal_my_home_ticket">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"><div></div></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="remove_timesheet" name="remove timesheet" inherit_id="hr_timesheet.portal_my_home_timesheet">
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"><div></div></xpath>
<xpath expr="//t[@t-call='portal.portal_docs_entry']" position="replace"></xpath>
</template>
<template id="change_portal_layout" name="portal update docs" inherit_id="portal.portal_docs_entry">
<xpath expr="//a" position="replace">
<div class="col-sm-12 col-md-6 col-lg-4 mb-5">
<div class="card-body card-body-custom" style="background-color:white !important;">
<header class="card__primary-title">
<t t-if="avatar">
<figure class="image image--avatar">
<img t-att-src="avatar"/>
</figure>
</t>
<div class="item item--two-lines">
<h5 t-att-title="title"><t t-esc="title"/></h5>
<div class="card">
<div t-if="url" class="card-body card-body-custom" style="background-color:white !important;">
<header class="card__primary-title">
<t t-if="avatar">
<figure class="image image--avatar">
<img t-att-src="avatar"/>
</figure>
</t>
<div class="item item--two-lines">
<h5 t-att-title="title"><t t-esc="title"/></h5>
</div>
</header>
<t t-if="background">
<figure class="image">
<img t-att-src="background"/>
</figure>
</t>
<t t-if="desc">
<span class="card__supporting-text"><t t-esc="desc"/></span>
</t>
<footer class="card__actions">
<a class="btn btn-primary" t-att-href="url">Ver mis tickets</a>
</footer>
</div>
</header>
<t t-if="background">
<figure class="image">
<img t-att-src="background"/>
</figure>
</t>
<t t-if="desc">
<span class="card__supporting-text"><t t-esc="desc"/></span>
</t>
<footer class="card__actions">
<a class="btn btn-primary" t-att-href="url">Ver mis tickets</a>
</footer>
</div>
</div>
</xpath>
</template>
......
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