diff options
Diffstat (limited to 'addons/pos_discount/static/src/js/models.js')
| -rw-r--r-- | addons/pos_discount/static/src/js/models.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/pos_discount/static/src/js/models.js b/addons/pos_discount/static/src/js/models.js new file mode 100644 index 00000000..c54c7c93 --- /dev/null +++ b/addons/pos_discount/static/src/js/models.js @@ -0,0 +1,21 @@ +odoo.define('pos_discount.models', function (require) { + "use strict"; + + var models = require('point_of_sale.models'); + + var existing_models = models.PosModel.prototype.models; + var product_index = _.findIndex(existing_models, function (model) { + return model.model === "product.product"; + }); + var product_model = existing_models[product_index]; + + models.load_models([{ + model: product_model.model, + fields: product_model.fields, + order: product_model.order, + domain: function(self) {return [['id', '=', self.config.discount_product_id[0]]];}, + context: product_model.context, + loaded: product_model.loaded, + }]); + +}); |
