Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to use a npm package in odoo so that I can use that in odoo widget. I have seen that odoo web add on somehow uses underscore js and query. But I am not able to use npm package in odoo.

I have tried to load it by creating package.json file inside the addon folder but it is not working. Please Help!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
359 views
Welcome To Ask or Share your Answers For Others

1 Answer

The common pattern is to put all dependencies directly copied in the static/src/lib/ folder of the addon, and enable them in a templates/assets.xml file. Using npm would be theoretically nice, but it is probably going to give you more problems than benefits, and you will need to do all the plumbing yourself manually. Check https://github.com/OCA/web/issues/842 for more background on the matter.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...