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
    • eLearning
    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

Change css/less based on user language or preferences language Odoo 10

Suscribirse

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

Se marcó esta pregunta
alignmentstylesheetodoo
6175 Vistas
Avatar
Syed

Dears I am using Odoo 10. My requirement is bit different and I am not finding any such questions or answers on any forum. Actually I want to change the alignments of my text and icons based on user language or preferences selected language. I have created a custom module and I am able to use my custom styling. My xml file is as follows:


    <odoo>

      <data>

    

    <template id="assets_backend" name="project_extend assets" inherit_id="web.assets_backend">

    

    <xpath expr="." position="inside">

    

    <link rel="stylesheet" href="/project_extend/static/src/less/form_view_extra.less"/>

    

    </xpath>

    

    </template>

          

            <record id="project.edit_project" model="ir.ui.view">

                <field name="name">project.project.form</field>

                <field name="model">project.project</field>

                <field name="arch" type="xml">

                    

                    <form string="Project">

                    <sheet string="Project">

                        <field name="analytic_account_id" invisible="1" required="0"/>

                        <div class="oe_button_box" name="button_box" groups="base.group_user">

                            

                            

                            <button  class="oe_stat_button" name="attachment_tree_view" type="object" icon="fa-files-o">

                                

                                <field string="Documents" name="doc_count" widget="statinfo"/>

                                

                            </button>

                            

                            <button class="oe_stat_button" type="action" attrs="{'invisible':[('use_tasks','=', False)]}"

                                name="%(project.act_project_project_2_project_task_all)d" icon="fa-tasks">

                                <field string="Tasks" name="task_count" widget="statinfo" options="{'label_field': 'label_tasks'}"/>

                            </button>

                            

                            <button name="toggle_active" type="object"

                                    confirm="(Un)archiving a project automatically (un)archives its tasks and issues. Do you want to proceed?"

                                    class="oe_stat_button" icon="fa-archive">

                                <field name="active" widget="boolean_button"

                                    options='{"terminology": "archive"}'/>

                            </button>

                        </div>

                        <div class="oe_title">

                            <h1>

                                <field name="name" placeholder="Project Name"/>

                            </h1>

                            <div name="options_active" class="oe_edit_only">

                                <div>

                                    <field name="use_tasks" class="oe_inline"/>

                                    <label for="use_tasks" class="oe_inline" string="Tasks"/>

                                    <span attrs="{'invisible':[('use_tasks', '=', False)]}">as </span>

                                    <field name="label_tasks" class="oe_inline oe_input_align" attrs="{'invisible': [('use_tasks', '=', False)]}"/>

                                </div>

                            </div>

                        </div>

                        <notebook>

                            <page name="settings" string="Settings">

                                <group>

                                    <field name="user_id" string="Project Manager"

                                            attrs="{'readonly':[('active','=',False)]}"/>

                                    <field name="privacy_visibility" widget="radio"/>

                                    <field name="partner_id" string="Customer"/>

                                </group>

                                <group name="misc">

                                    <group string="Configuration" groups="base.group_no_one">

                                        <field name="sequence" groups="base.group_no_one"/>

                                    </group>

                                    <group string="Time Scheduling" groups="base.group_no_one">

                                        <field name="resource_calendar_id" groups="base.group_no_one"/>

                                    </group>

                                </group>

                            </page>

                            <page name="emails" string="Emails" attrs="{'invisible': [('alias_domain', '=', False)]}">

                                <group name="group_alias">

                                    <label for="alias_name" string="Email Alias"/>

                                    <div name="alias_def">

                                        <field name="alias_id" class="oe_read_only oe_inline"

                                                string="Email Alias" required="0"/>

                                        <div class="oe_edit_only oe_inline" name="edit_alias" style="display: inline;" >

                                            <field name="alias_name" class="oe_inline"/>@<field name="alias_domain" class="oe_inline" readonly="1"/>

                                        </div>

                                    </div>

                                    <label for="alias_model" string="Incoming Emails create" class="oe_edit_only"/>

                                    <field name="alias_model" class="oe_inline oe_edit_only" nolabel="1"/>

                                    <field name="alias_contact" class="oe_inline oe_edit_only"

                                            string="Accept Emails From"/>

                                </group>

                            </page>

                        </notebook>

                    </sheet>

                    <div class="oe_chatter">

                        <field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically track the events associated to tasks and issues of this project." groups="base.group_user"/>

                    </div>

                    </form>

                </field>

            </record>

    

            <record id="hr_timesheet.project_invoice_form" model="ir.ui.view">

                <field name="name">Inherit project form : Invoicing Data</field>

                <field name="model">project.project</field>

                <field name="inherit_id" ref="project.edit_project"/>

                <field name="priority">24</field>

                <field name="arch" type="xml">

                    <button name="toggle_active" position="before">

                        <button class="oe_stat_button" name="%(hr_timesheet.act_hr_timesheet_line_by_project)d" type="action" icon="fa-calendar" string="Timesheets" attrs="{'invisible': [('allow_timesheets', '=', False)]}" style="text-align:right"/>

                    </button>

                    <field name="user_id" position="after">

                        <field name="subtask_project_id" groups="base.group_no_one" attrs="{'invisible': [('allow_timesheets', '=', False)]}"/>

                    </field>

                    <xpath expr="//div[@name='options_active']" position="inside">

                        <div>

                            <field name="allow_timesheets" class="oe_inline" string="Allow timesheets"/>

                            <label for="allow_timesheets"/>

                        </div>

                    </xpath>

                </field>

            </record>

            

            

      </data>

    </odoo> 


As you can see in the beginning I am including stylesheet which is working perfectly. Now I want to compare the user/preferences language. If it is arabic language then stylesheet should be included else if user/preference language is english the the stylesheet should not be included so that the default alignment in odoo should come in effect. Any help is really appreciated.

0
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
ODOO : Howa to add css file to change the view xml
css stylesheet odoo
Avatar
Avatar
2
ago 16
9607
How do I go about this error? I am trying to uninstall a module
odoo
Avatar
0
nov 25
3355
How to import product variants with my own external id when using dynamic creation mode Resuelto
odoo
Avatar
Avatar
2
ago 25
3929
How to import Bulk Image in Product your local database not any cloud, odoo.sh Resuelto
odoo
Avatar
Avatar
1
jul 25
1931
Odoo sh - Connect As
odoo
Avatar
1
ago 25
1154
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