Hello. I am trying to add a new field in the current order and asing the value on click button in the pos screen, the button work fine, but not save the value in the python field
this is my field in python =
class PosOrder(models.Model):
_inherit = 'pos.order'
cita_id = fields.Many2one('citas.model')
And this in the javascript =
var models = require('point_of_sale.models');var _super_Order = models.Order.prototype;models.Order = models.Order.extend({
export_as_JSON: function () {
var json = _super_Order.export_as_JSON.apply(this, arguments);
if (this.cita_id){
json.cita_id = this.cita_id;
}
return json
}
})in the button_click i add the cita_id integerbutton_click: function(){this.cita_id = 77 // for example
}
but it does not work, it does not save the value in the python field
Please suggest any solution.
Vishnu Vanneri's answer worked for me. Thank you both for your answers. regards!!!
P.S. This is my first question!
sorry, I do not have karma to select the answer.