odoo-8 Add CSS and Javascript files to Odoo module Option 2: [FRONTEND] Add CSS and Javascript files to use in a public website


Note: you should use this way if you've installed a "website" module and you have a public website available.

  • Add following record in 'your_file.xml':

            <template id="assets_frontend" name="your_module_name assets" inherit_id="website.assets_frontend">  
                <xpath expr="link[last()]" position="after">  
                    <link rel='stylesheet' href="/your_module_name/static/src/css/your_file.css"/>  
                <xpath expr="script[last()]" position="after">  
                    <script type="text/javascript" src="/your_module_name/static/src/js/your_file.js"></script>