Odoo Help

0

How to inherit external script in web backend

By
Silviaa
on 1/31/18, 7:25 AM 675 views

I need the table with  Fixed Columns so am including script files from below link

\https://datatables.net/extensions/fixedcolumns/examples/initialisation/left_right_columns.html

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

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

<script type="text/javascript" src="/purchase_requisition/static/src/js/dataTables.fixedColumns.js"></script>

<script type="text/javascript" src="/purchase_requisition/static/src/js/jquery.dataTables.js"></script>

<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css" />

<link rel="stylesheet" href="https://cdn.datatables.net/fixedcolumns/3.2.4/css/fixedColumns.dataTables.css" />

</xpath>

</template>

Getting below error:

web.assets_backend.js:2824 Could not get content for jquery-1.12.4.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2824

web.assets_backend.js:2827 Could not get content for /js/jquery.dataTables.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2827

web.assets_backend.js:2830 Could not get content for /fixedcolumns/3.2.4/js/dataTables.fixedColumns.js defined in bundle 'web.assets_backend'.

(anonymous) @ web.assets_backend.js:2830

web.assets_backend.js:2795 Uncaught TypeError: $(...).DataTable is not a function

Please help me to resolve this error

0
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Qoura:
    

            https://www.quora.com/profile/Hilar-Ak-1



Hilar AK
On 2/1/18, 1:11 AM

you dont need to include the jquery lib, and also cdn will not accepted I think.

So download the lib and include it under your custom addon and give the path within the script tag.

<script type="text/javascript" src="/purchase_requisition/static/src/js/dataTables.fixedColumns.js"></script>

<script type="text/javascript" src="/purchase_requisition/static/src/js/jquery.dataTables.js"></script> Cant get function from this file

Silviaa
on 2/4/18, 11:19 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/31/18, 7:25 AM
Seen: 675 times
Last updated: 2/1/18, 1:11 AM