Skip to content
Snippets Groups Projects
Commit 53a45fc6 authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me:
Browse files

Removed slugify and authentification

parent f0ca32f9
No related branches found
No related tags found
1 merge request!86Fix partners company
......@@ -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',
......
......@@ -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']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment