Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3996 มุมมอง

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