I'm trying to add an unique numbering in Odoo's POS order without depending in the backend. I want this number to add 1 only when the order is confirmed. I inherited the PaymentScreenWidget's validate_order button and tried to add the export to JSON function as appreciated in the following code:
```
screens.PaymentScreenWidget.include({
validate_order: function (force_validation) {
let order = this.pos.get_order();
let next_number = order.next_number
next_number += 1
export_as_JSON: function f() {
var json = _super_order_model.export_as_JSON(this, arguments);
json.next_number = next_number
}
console.log('number is ' + next_number);
this._super(force_validation)
}
})
```
But I get errors, Is this the correct way to do this? how should I call the export to JSON function with the validate_order button?