Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata

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.
Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
mar 25
959
3
mag 23
2747
0
lug 22
1244
3
lug 20
5511
2
giu 20
5997