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
e65217a8
authored
Apr 09, 2023
by
Arturo Jasso Origel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se arreglo un bug al momento de intentar darle acceso al usuario de portal de mantenimiento
parent
74ee5e96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
helpdesk_maintenance/models/res_users.py
+13
-1
No files found.
helpdesk_maintenance/models/res_users.py
View file @
e65217a8
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
UserError
,
ValidationError
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
class
ResUsersInherit
(
models
.
Model
):
_inherit
=
'res.users'
...
...
@@ -32,7 +38,13 @@ class ResUsersInherit(models.Model):
def
no_create_user_maintenance
(
self
):
if
self
.
is_maintenance
==
True
:
users
=
self
.
search
([(
'warehouse_id'
,
'='
,
self
.
warehouse
.
id
),(
'is_maintenance'
,
'='
,
True
),(
'maintenance_position'
,
'='
,
self
.
maintenance_position
)])
users
=
self
.
search
([
(
'warehouse_id'
,
'='
,
self
.
warehouse_id
.
id
),
(
'is_maintenance'
,
'='
,
True
),
(
'maintenance_position'
,
'='
,
self
.
maintenance_position
),
(
'id'
,
'!='
,
self
.
id
)
])
_logger
.
info
(
users
)
if
len
(
users
)
==
0
:
return
True
else
:
...
...
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