I wrote a custom module in Odoo and now I would like to import some field values from the custom module into the POS widget.
Suppose I have a field named 'discount' in a module 'customer.discount'.
How do I load the field values from the custom module into the widget for the POS? This is the .js code I have so far. Any pointers? Remark: This is for the new Odoo API (V9).
odoo.define('pos_product_available.PosModel', function(require){
"use strict";
var models = require('point_of_sale.models');
var _super_posmodel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function (session, attributes) {
var partner_model = _.find(this.models, function(model){ return model.model === 'product.product'; });
partner_model.fields.push('qty_available');
var customer_model = _.find(this.models, function(model){return
this.models.push({
model: 'customer.discount',
fields: ['discount_price','percentage'],
})
}),
return _super_posmodel.initialize.call(this, session, attributes);
},
})
})