Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to override CSS on the point of sale?

Odebírat

Get notified when there's activity on this post

This question has been flagged
v8poscssoverrideodoo
2 Odpovědi
16234 Zobrazení
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
Zrušit
Avatar
Pascal Tremblay
Autor Nejlepší odpověď

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
Zrušit
Avatar
Tintuk Tomin
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Override javascript method from web
javascript css override website odoo
Avatar
Avatar
1
kvě 23
3364
How can i see pos OrderChangeReceipt report without printer odoo15
pos odoo
Avatar
0
zář 24
2167
Sending kitchen orders
pos odoo
Avatar
Avatar
1
srp 24
10449
Why I can't see my Take Away , Delivery and Dine-in in my POS?
pos odoo
Avatar
0
zář 23
2037
certification NF525
pos odoo
Avatar
0
bře 23
8719
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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