Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

DBFilter www or domain

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
domaindb_filterdomain_filterdomainsdbfilter
2 Respuestas
9737 Vistas
Avatar
Christian de Lamboy

Dear all, up to now I use the dbfilter as subdomainfilter and it works grea (odoo.domain.com, odoo2.domain.com)

Now I want to use it as the main domain (domain.com, www.domain.com)

for doing this I changed the databasename from odoo to domain-com and changed the d to h in

/etc/odoo-server.conf
/odoo-server/odoo/tools/config.py

and it functions to the limit that entering domain.com goes directly to the database, but entering www.domain.com goes to the database admin.

To my limited knowledge the code in http.py should equalize the www.domain to domain, or am I wrong?

def db_filter(dbs, httprequest=None):
    httprequest = httprequest or request.httprequest
    h = httprequest.environ.get('HTTP_HOST', '').split(':')[0]
    d, _, r = h.partition('.')
    if d == "www" and r:
        d = r.partition('.')[0]
    r = odoo.tools.config['dbfilter'].replace('%h', h).replace('%d', d)
    dbs = [i for i in dbs if re.match(r, i)]
    return dbs


in the apache VH I have the following setup

<VirtualHost *:80>
        ProxyPreserveHost On
        ServerName domain.com
        ServerAlias www.domain.com
 <Directory /var/www/html> #HERE I TRIED TO INSTALL A .HTACCESS FROM WWW TO DOMAIN, BUT WITHOUT EFFECT TO ODOO
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Order allow,deny
     allow from all
 </Directory>
        ProxyRequests Off

ProxyPass / http://localhost:8069/
        ProxyPassReverse / http://localhost:8069/

ProxyVia On
        ErrorLog /var/log/apache2/error.log
        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

<VirtualHost *:443>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://domain.com:8069/
ProxyPassReverse / http://domain.com:8069/
SSLEngine on
SSLProxyEngine on
SSLCertificateFile **/fullchain.pem
SSLCertificateKeyFile **/privkey.pem
Include **/options-ssl-apache.conf
</VirtualHost>


Like I wrote I have tried to include a htaccess rewrite but it has no effect.

Any ideias what I have missed?

Thank you!

0
Avatar
Descartar
Christian de Lamboy
Autor

just to add this, as I cant edit my post. I tried it with 2 virtual hosts, one domain one www.domain and both with permant redirect to domain:

Redirect permanent / https://domain.com/

but does not work out

Christian de Lamboy
Autor

Thanks Ermin, the answer was so easy. Just change the name of the database to domain, not domain-com and leave everthing to d, and it works.

Ermin Trevisan

As I said :-)

Avatar
Ermin Trevisan
Mejor respuesta

There are 2 regex filter expressions available:

- %h does address the full hostname (www.domain.com -> www-domain-com, odoo.domain.com -> odoo-domain-com)

- %d does address the subdomain only, except of the www subdomain, which gets stripped off.

So with %d www.domain.com gets domain, but odoo.domain.com gets odoo

1
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
use dbfilter to allow both domain and subdomain
domain domain_filter subdomains dbfilter
Avatar
Avatar
1
ene 21
8232
how to filter odoo db if i use the domain only ?
data domain_filter domains dbfilter
Avatar
1
feb 20
4116
how to set multiple conditions in search method in odoo9
domain search domain_filter domains
Avatar
Avatar
1
dic 16
18113
(ODOO 10 How To) Compute domain / Dynamic Domain / set a domain based on a function or a field Resuelto
domain domain_filter compute domains dymanic_fields
Avatar
Avatar
Avatar
2
sept 21
23656
Many2one Domain (Filter by user security groups)
security domain many2one domain_filter domains
Avatar
0
ago 16
4971
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now