Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка 'This field was not expected.' при попытке сохранить значение кастомного поля сделки на завершенных этапах #116

Open
SelfMadeDev opened this issue Feb 19, 2024 · 1 comment

Comments

@SelfMadeDev
Copy link

В карточке сделки есть кастомное поле (флаг):

class Lead(_Lead):
    meeting_scheduled = custom_field.CheckboxCustomField("Встреча назначена")

Если сделка находится на одном из закрытых этапов ("Успешно реализовано" или "Закрыто и не реализовано"), тогда изменить его значение невозможно:

lead = Lead.objects.get(object_id=event.entity_id)
lead.meeting_scheduled = True
lead.save()

Вылезает следующая ошибка:
{'code': 'FieldNotExpected', 'path': 'custom_fields_values.16.values.0.enum_code', 'detail': 'This field was not expected.'}
Подскажите, пожалуйста, как обойти это ограничение?

@SelfMadeDev
Copy link
Author

Решение нашел здесь: #68 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant