私はOdooでカスタムモジュールを作成しましたが、カスタムモジュールからPOSウィジェットにいくつかのフィールド値をインポートしたいと思います。カスタムモジュールからOdoo(V9)POSモジュールにフィールドをインポート
モジュール 'customer.discount'に 'discount'という名前のフィールドがあるとします。
カスタムモジュールの項目値をPOSのウィジェットにロードするにはどうすればよいですか? これはこれまで私が持っていた.jsコードです。すべてのポインタ?備考:これは新しい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);
},
})
})