Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3997 Переглядів

Every time I make an invoice I generate a custom sequence code in account.invoice. I can see it in the POS orders, and it's being generated properly, but I can't make it display the code inside the POS or the Receipt screen. I read you could insert it extending models.js and then calling it from the .xml but I can't make it work. After many many tries this is what I got:


My models.js is the following:


odoo.define('pos.models', function(require) {
  "use strict";
  var models = require('pos.order');
  models.load_models({
    model:  'pos.order',
    fields: ['my_field'],
    domain: function(self){ return [['state','=','opened']; },
    loaded: function(self,pos_my_field){
      self.pos_my_field = pos_my_field[0];
    },
  });
});

and in the XML I've tried calling it with:
<t t-esc="widget.pos.my_field" />
<t t-esc="widget.my_field" />
<t t-esc="my_field" />
and plenty of other variations but you get the point.
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
бер. 25
958
3
трав. 23
2746
0
лип. 22
1240
3
лип. 20
5509
2
черв. 20
5996