I'm changing odoo 10 module to odoo 11.I'm facing problem for missing dependency web.DataModel. How can I convert the following code to odoo 11 version?
var temp = {
'partner_id': client['id'],
'coupon_pos': cp.code,
};
new Model('partner.coupon.pos').call('update_history',
['',temp]).done(function (result) {
// alert("result")
var applied = self.pos.applied_coupon;
var already_used = false;
for (var j in applied) {
if (applied[j]['partner_id'][0] == client['id'] &&
applied[j]['coupon_pos'] == order.coupon_status['code']) {
applied[j]['number_pos'] += 1;
already_used = true;
break;
}
}
if (!already_used) {
var temp = {
'partner_id': [client['id'], client['name']],
'number_pos': 1,
'coupon_pos': order.coupon_status['code']
};
self.pos.applied_coupon.push(temp);
}
});
self.gui.close_popup();