تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5153 أدوات العرض

I have been studying the theme tutorial and tried the examples. I have not been able to get the example about the "Java Options" to work. I followed the example exactly. I run the website in firefox. The debugger of firefox showes the following error:

"ReferenceError: openerp is not defined"


The java script code used looks as follows:

(function() {

'use strict';

var website = openerp.website;

website.openerp_website = {};

website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({

on_focus: function() {

alert("On focus!");

}

})

})();


The debugger points to the following line of the above function:

"var website = openerp.website;"


The template definition in the assets file looks as follows:

<template id="my_js" name="My Js" inherit_id="website.assets_editor">

 <xpath expr="script[last()]" position="after">

<script type="text/javascript" src="/theme_shipcenter/static/src/js/tutorial_editor.js" />

</xpath>

</template>



The examples are taken from the page

http://www.odoo.com/documentation/9.0/howtos/themes.html#snippet-options

I run the server and the browser on a Ubuntu 14.04 system.

Is there a mistake in the sample code or is there something missing?



الصورة الرمزية
إهمال
أفضل إجابة

So... There is no one from Odoo who doesn't know why they documentation do not work? It was the issue in 2016, it was the issue in documentation for V11 and there is the same problem today with V12. Seriously Odoo, you can't write proper documentation? In the very beginning of it [V12] there is also a problem which need to be solved by searching the internet. Bravo!

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 24
7185
2
يوليو 23
11345
1
مارس 22
4332
0
مارس 21
2357
Odoo Server error تم الحل
2
مارس 21
4587