Hello Guys,
i´ve trying to add a custom field to 'res.partner' inside the models.js file but i´ve used the code bellow to odoo 9 and it still don´t work...somebody please help
odoo.define('pos_info_recibo.models_extend', function(require){
var models = require('point_of_sale.models')
var _super_posmodel = models.PosModel.prototype;
models.PosModel = models.PosModel.extend({
initialize: function (session, attributes) {
// Add field to model
var partner_model = _.find(this.models, function(model){
return model.model === 'res.partner';
});
partner_model.fields.push('membership_code');
// run Super
return _super_posmodel.initialize.call(this, session, attributes)
},
});
});
Many Thanks, Pat!
It worked.Com os melhores Cumprimentos,
Eder Machado
Telefone: +244923681051 | +244913748338
e-mail: eder.lourenco.machado@gmail.com
Profissão: Programador & Analista de Software
WYSIWYG: What You See Is What You Get...
2017-12-26 12:47 GMT+01:00 Parth Patel (pat) <pat@odoo.com>: