Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

how to Load custom models & fields in POS in odoo16

形象
odoo
形象
丢弃
1 答案
0
形象
odoo
最佳答案

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

形象
丢弃