0
1 答案
0
最佳答案
Hi,
In Odoo 16, we can add our new model to the Point of sale by inheriting the _pos_ui_models_to_load method in the “pos.session” model.
def _pos_ui_models_to_load(self):
result = super()._pos_ui_models_to_load()
new_model = 'your.new.model’
result.append(new_model)
return result
Now for adding the new field, we can use the _loader_params method, it is written as _loader_params_ followed by your model name
def _loader_params_your_new_model(self):
return {
'search_params': {
'fields': ['new_field_1’, ‘new_field_2’'],
},
}
Regards