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

I've got a snippet working ok. It allows me to drop it in to the page. The snippet imports another page (or template) in to that page. It will be used for standard information for manufactures etc.

The problem is once it is dropped in, it creates the content from the current template, and inserts it as static data.

So if I ever change the original template, the pages using it will not reflect the changes.

I believe I can do this with Javascript. But so far I've not been able to find out how. The docs talk about JS for the snippet options but nothing beyond that.

Could someone please give a simple example of what is needed to drop a snippet in with a placeholder for the content, a javascript file to put content in that placeholder, and explain how it all connects together?

ps. Odoo 11 CE.

Thanks


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

https://www.youtube.com/watch?v=mA4WECek70w&ab_channel=Odoo

الصورة الرمزية
إهمال

This is an excellent video from Odoo which addresses the basic steps to build a dynamic snippet (incl. Javascript)

أفضل إجابة

Check the blog module , recent news snippets.

It gets data from the database with javascript.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 23
4268
1
ديسمبر 19
4633
0
يونيو 25
278
1
يونيو 25
578
1
يونيو 25
562