Поле добавления POS в проблеме pos.configPython

Программы на Python
Anonymous
Поле добавления POS в проблеме pos.config

Сообщение Anonymous »

Когда я пытаюсь добавить собственное добавленное поле strict_create_customer в pos.config и наследовать _loader_params_pos_config для добавления поля в pos.session в odoo 16, возникает эта ошибка
Изображение

мой код Python:
class PosConfigInherit(models.Model):
_inherit = 'pos.config'
restrict_create_customer = fields.Boolean(help="Show employee login screen")

class ConfigSettingsInherit(models.TransientModel):
_inherit = 'res.config.settings'
pos_module_restrict_create = fields.Boolean(related='pos_config_id.restrict_create_customer', readonly=False)

class PosSession(models.Model):
_inherit = 'pos.session'

def _loader_params_pos_config(self):
result = super()._loader_params_pos_config()
result['search_params']['fields'].append('restrict_create_customer')
return result


Подробнее здесь: https://stackoverflow.com/questions/786 ... nfig-issue

Вернуться в «Python»