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


Hi,

when I depend on another module I would expect my own module POS javascript to be loaded after the javascript from the module I depend on. This would cause my javascript to be called first, which is what I want if I want to override core functions


Here is from __manifest__.py

'depends': [
'pos_restaurant',
'other_module',
],


Here's the source when loading pos:

<script type="text/javascript" src="/my_module/static/src/js/pos/pos.js"></script>
<script type="text/javascript" src="/other_module/static/src/js/pos.js"></script>

I would expect the other way around?


Both use this to inject javascript

<template id="assets_pos" inherit_id="pos_restaurant.assets">
<xpath expr="." position="inside">


Basically what I want to achieve is that my override of a core function is called before the other module. Instead I see its the other way around :/


Can someone with some deep understanding of POS loading order please enlighten me? Thank you :)


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

Well, I had to dig long and deep to find this...

<template id="assets_pos" inherit_id="pos_restaurant.assets" priority="20">

The clue here is to set priority="x" which is not at all intuitive

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أغسطس 25
657
1
يوليو 25
904
3
يوليو 25
3034
3
مايو 25
1629
1
يوليو 25
1114