Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Arturo Jasso Origel
/
helpdesk
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
431e2cfa
authored
Mar 06, 2023
by
Arturo Jasso Origel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se agregaron cambios y permisos
parent
d665d15f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
helpdesk_morsa/models/helpdesk_ticket.py
+13
-11
No files found.
helpdesk_morsa/models/helpdesk_ticket.py
View file @
431e2cfa
...
...
@@ -320,17 +320,19 @@ class HelpdeskTicket(models.Model):
})
def
write
(
self
,
vals
):
if
"stage_id"
in
vals
:
if
self
.
description
==
'<p><br></p>'
or
self
.
description
==
False
:
raise
ValidationError
(
_
(
"Para cambiar de etapa, es necesario agregar una descripción"
))
if
'description'
in
vals
and
(
vals
[
"description"
]
!=
""
or
self
.
description
!=
False
)
and
vals
[
'description'
]
!=
'<p><br></p>'
and
(
self
.
is_support
==
True
or
self
.
is_erp
==
True
or
self
.
is_emergency
==
True
):
min_description
=
int
(
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'helpdesk_morsa.description_min_lenght'
))
description
=
self
.
get_description_len
(
vals
[
"description"
])
if
len
(
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
)
if
self
.
is_support
==
True
or
self
.
is_erp
==
True
or
self
.
is_emergency
==
True
:
if
"stage_id"
in
vals
:
if
self
.
description
==
'<p><br></p>'
or
self
.
description
==
False
:
raise
ValidationError
(
_
(
"Para cambiar de etapa, es necesario agregar una descripción"
))
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
)
else
:
return
super
(
HelpdeskTicket
,
self
)
.
write
(
vals
)
def
action_approve
(
self
):
if
self
.
description
==
'<p><br></p>'
or
self
.
description
==
False
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment