Odoo Help

3

1
3 Answers
0
juan Peru
9/7/17, 5:55 PM

To add new field in POS modules necessary in models.js override PosModel in the parent models which we take from “point_of_sale.models”. For example:

var models = require('point_of_sale.models');
var _super_posmodel = models.PosModel.prototype;

models.PosModel = models.PosModel.extend({
    initialize: function (session, attributes) {
        // New code
        var partner_model = _.find(this.models, function(model){
            return model.model === 'product.product';
        });
        partner_model.fields.push('qty_available');

        // Inheritance
        return _super_posmodel.initialize.call(this, session, attributes);
    },
});


Ref: http://odoo-development.readthedocs.io/en/latest/dev/pos/add_field.html

0
Mark DC United States
8/25/17, 6:22 PM

I am also facing this exact same problem. Have you found anything? I've tried many different ways but so far I haven't struck gold.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now