Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Comunitats Energètiques
Odoo CE
Commits
53a45fc6
Commit
53a45fc6
authored
2 years ago
by
Daniil Digtyar Vasilieva
Browse files
Options
Downloads
Patches
Plain Diff
Removed slugify and authentification
parent
f0ca32f9
No related branches found
No related tags found
1 merge request
!86
Fix partners company
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_communities/__manifest__.py
+0
-3
0 additions, 3 deletions
energy_communities/__manifest__.py
energy_communities/models/res_company.py
+5
-5
5 additions, 5 deletions
energy_communities/models/res_company.py
with
5 additions
and
8 deletions
energy_communities/__manifest__.py
+
0
−
3
View file @
53a45fc6
...
...
@@ -2,15 +2,12 @@
'
name
'
:
"
Comunitats Energètiques customizations
"
,
'
version
'
:
'
12.0.0.0.15
'
,
'
depends
'
:
[
'
base_rest_base_structure
'
,
'
l10n_es_cooperator
'
,
'
auth_keycloak
'
,
'
contacts
'
,
'
base_rest
'
,
'
base_user_role
'
,
'
auth_api_key
'
,
'
crm
'
,
'
community_maps
'
,
],
'
author
'
:
"
Coopdevs Treball SCCL & Som Energia SCCL
"
,
'
website
'
:
'
https://somenergia.coop
'
,
...
...
This diff is collapsed.
Click to expand it.
energy_communities/models/res_company.py
+
5
−
5
View file @
53a45fc6
...
...
@@ -4,9 +4,7 @@ from odoo import api, models, fields, _
from
datetime
import
datetime
import
re
from
odoo.exceptions
import
UserError
from
odoo.addons.auth_signup.controllers.main
import
AuthSignupHome
as
Home
from
odoo.addons.auth_oauth.controllers.main
import
OAuthLogin
as
OAL
from
slugify
import
slugify
class
ResCompany
(
models
.
Model
):
_inherit
=
'
res.company
'
...
...
@@ -69,8 +67,10 @@ class ResCompany(models.Model):
# check for name
if
vals
.
get
(
'
name
'
,
False
)
and
vals
.
get
(
'
name
'
):
sanit_name
=
slugify
(
vals
[
'
name
'
])
if
sanit_name
in
[
slugify
(
c
.
name
)
for
c
in
self
.
search
([])
if
c
.
name
]:
#sanit_name = slugify(vals['name'])
sanit_name
=
vals
[
'
name
'
]
#if sanit_name in [slugify(c.name) for c in self.search([]) if c.name]:
if
sanit_name
in
[
c
.
name
for
c
in
self
.
search
([])
if
c
.
name
]:
raise
UserError
(
_
(
"
Unable to create new company because there is an allready existing company with this NAME: {}
"
).
format
(
vals
[
'
name
'
]))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment