Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

How to override CSS on the point of sale?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
v8poscssoverrideodoo
2 Besvarelser
16230 Visninger
Avatar
Pascal Tremblay

Hello all,

 

If I change the CSS code in this file : /home/odoo/addons/point_of_sale/static/src/css/pos.css

I automatically see my changes on the POS.

 

But if I make this changes in my custom module css : /home/odoo/addons/report_lapagept/static/src/css/pos_as.css

impossible to override the original CSS. I never see the changes. Only if they are in the original pos.css.

 

I have tried 2 ways to import my pos_as.css file in my custom module :

  • I put it in my __openerp__.py            

'css': [
        'static/src/css/pos_as.css',
    ],

  • I also tried with a xml file (like usually), but I'm not sure of my declaration

        <template id="assets_pos_as" name="Assets POS - AS" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" href="/report_lapagept/static/src/css/pos_as.css"/>
            </xpath>
        </template>

 

So, what is the best way TO OVERRIDE the original CSS in the point of sale of Odoo v8?

Thanks all

0
Avatar
Kassér
Avatar
Pascal Tremblay
Forfatter Bedste svar

Did not find better (shorter) way until today.

In /home/odoo-test/odoo-test/addons/pos_lapagept/__openerp__.py :

{
 
    'depends' : ['point_of_sale',],
    "data" : [
                'lapagept_templates.xml',
              ],
}
 

In /home/odoo-test/odoo-test/addons/pos_lapagept/lapagept_templates.xml :

<?xml version="1.0" encoding="utf-8"?>

<openerp>
    <data>
<template id="index_as" name="POS Index - AS">&lt;!DOCTYPE html&gt;
<html>
    <head>
        <title>Odoo POS - AS</title>

        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta http-equiv="content-type" content="text/html, charset=utf-8" />

        <meta name="viewport" content=" width=1024, user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes"/>
        <meta name="mobile-web-app-capable" content="yes"/>

        <link rel="shortcut icon"    sizes="196x196" href="/point_of_sale/static/src/img/touch-icon-196.png"/>
        <link rel="shortcut icon"    sizes="128x128" href="/point_of_sale/static/src/img/touch-icon-128.png"/>
        <link rel="apple-touch-icon"                 href="/point_of_sale/static/src/img/touch-icon-iphone.png"/>
        <link rel="apple-touch-icon" sizes="76x76"   href="/point_of_sale/static/src/img/touch-icon-ipad.png"/>
        <link rel="apple-touch-icon" sizes="120x120" href="/point_of_sale/static/src/img/touch-icon-iphone-retina.png"/>
        <link rel="apple-touch-icon" sizes="152x152" href="/point_of_sale/static/src/img/touch-icon-ipad-retina.png"/>

        <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" />
        <link rel="stylesheet" href="/point_of_sale/static/src/fonts/font-awesome-4.0.3/css/font-awesome.min.css" />
        <link rel="stylesheet" href="/point_of_sale/static/src/css/pos.css" id="pos-stylesheet"/>
        <link rel="stylesheet" href="/pos_lapagept/static/src/css/pos_as.css"/>
        <link rel="stylesheet" href="/point_of_sale/static/src/css/keyboard.css" />

        <t t-call-assets="web.assets_common" t-css="false" />
        <t t-call-assets="web.assets_backend" t-css="false" />

        <script type="text/javascript" id="loading-script">
            $(function() {
            var s = new openerp.init(<t t-raw='modules' />);
                <t t-raw='init' />
            });
        </script>

    </head>
    <body>
        <div class='openerp openerp_webclient_container'>
            <table class='oe_webclient'>
                <tr>
                    <td class='oe_application' />
                </tr>
            </table>
        </div>
    </body>
</html>
</template>
<template id="index_pt" name="POS Index - PT">&lt;!DOCTYPE html&gt;
<html>
    <head>
        <title>Odoo POS - PT</title>

        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta http-equiv="content-type" content="text/html, charset=utf-8" />

        <meta name="viewport" content=" width=1024, user-scalable=no"/>
        <meta name="apple-mobile-web-app-capable" content="yes"/>
        <meta name="mobile-web-app-capable" content="yes"/>

        <link rel="shortcut icon"    sizes="196x196" href="/point_of_sale/static/src/img/touch-icon-196.png"/>
        <link rel="shortcut icon"    sizes="128x128" href="/point_of_sale/static/src/img/touch-icon-128.png"/>
        <link rel="apple-touch-icon"                 href="/point_of_sale/static/src/img/touch-icon-iphone.png"/>
        <link rel="apple-touch-icon" sizes="76x76"   href="/point_of_sale/static/src/img/touch-icon-ipad.png"/>
        <link rel="apple-touch-icon" sizes="120x120" href="/point_of_sale/static/src/img/touch-icon-iphone-retina.png"/>
        <link rel="apple-touch-icon" sizes="152x152" href="/point_of_sale/static/src/img/touch-icon-ipad-retina.png"/>

        <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
        <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" />
        <link rel="stylesheet" href="/point_of_sale/static/src/fonts/font-awesome-4.0.3/css/font-awesome.min.css" />
        <link rel="stylesheet" href="/point_of_sale/static/src/css/pos.css" id="pos-stylesheet"/>
        <link rel="stylesheet" href="/pos_lapagept/static/src/css/pos_pt.css"/>
        <link rel="stylesheet" href="/point_of_sale/static/src/css/keyboard.css" />

        <t t-call-assets="web.assets_common" t-css="false" />
        <t t-call-assets="web.assets_backend" t-css="false" />

        <script type="text/javascript" id="loading-script">
            $(function() {
            var s = new openerp.init(<t t-raw='modules' />);
                <t t-raw='init' />
            });
        </script>

    </head>
    <body>
        <div class='openerp openerp_webclient_container'>
            <table class='oe_webclient'>
                <tr>
                    <td class='oe_application' />
                </tr>
            </table>
        </div>
    </body>
</html>
</template>


    </data>
</openerp>

All the CSS in the file /home/odoo-test/odoo-test/addons/pos_lapagept/static/src/css/pos_as.css will override the CSS in the original pos.css file. It works very well.

But now, somebody here could say to me why it's written « Odoo » rather than « Odoo POS - AS » when I inspect the code. See below image. ??????

 

 

0
Avatar
Kassér
Avatar
Tintuk Tomin
Bedste svar

You need to update the path of css file in three places.


1.`inherit_id="web.assets_backend"`

2.`inherit_id="web.assets_frontend"`

3.`inherit_id="point_of_sale.assets"`


In the templates which inherites the above templates.

The code is shown below.



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

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

                <link rel="stylesheet" href="/pos_update/static/src/css/mypos.css"/>

            </xpath>

        </template>


        <template id="assets_frontend" name="sub_menu assets front" inherit_id="web.assets_frontend">

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

                <link rel="stylesheet" href="/pos_update/static/src/css/mypos.css"/>

            </xpath>

        </template>


    <data>

        <template id="assets" inherit_id="point_of_sale.assets">

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

                <link rel="stylesheet" href="/pos_update/static/src/css/mypos.css"/>

                <script type="text/javascript" src="/pos_update/static/src/js/cancel.js"></script>


            </xpath>

        </template>

    </data>



You also need to ensure that if you want to modify an existing template then the stylesheet name must not be changed. 


If you want to create a stylesheet for your template the you only need to set the path of stylesheet in only one place, ie in the main template file in which you are setting the path of js file.


    <template id="assets" inherit_id="point_of_sale.assets">

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

                    <link rel="stylesheet" href="/pos_update/static/src/css/mypos.css"/>

                    <script type="text/javascript" src="/pos_update/static/src/js/cancel.js"></script>

    

                </xpath>

            </template>



1
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Override javascript method from web
javascript css override website odoo
Avatar
Avatar
1
maj 23
3361
How can i see pos OrderChangeReceipt report without printer odoo15
pos odoo
Avatar
0
sep. 24
2166
Sending kitchen orders
pos odoo
Avatar
Avatar
1
aug. 24
10447
Why I can't see my Take Away , Delivery and Dine-in in my POS?
pos odoo
Avatar
0
sep. 23
2035
certification NF525
pos odoo
Avatar
0
mar. 23
8712
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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