コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7730 ビュー

IntegrityError: null value in column "name" violates not-null constraint

アバター
破棄

Where? When? Why? If you write some information it will be cool!!!

最善の回答

I know this is late for your question, but on odoo 15 i just met exactly this issue, and If you or some one else meet this issue, here is how you can deal with it:

If you met this issue when coding with wizard (popup), you can try this:

This issue is because you missing "name" column, to solve this, you need to set value for "name" column.

In below example, i've try to set value for "name" column by onchange function, and it's worked for me, the issue is gone.

But you can try other way to set value for "name" column. Best Wishes.

# declare "your_column" column so we can use it to call onchange, without this, onchange function won't be called
your_column = fields.Binary(string="Your Column")

@api.onchange('your_column')
def your_column_onchange(self):
for wizard in self:
wizard.name = False
# set "name" to this wizard model, to prevent this issue:
# null value in column "name" violates not-null constraint
if wizard.your_column:
wizard.name = wizard.your_column
アバター
破棄
最善の回答

Please read this:

IntegrityError: null value in column "name" violates not-null constraint

Please also search the forum before asking questions.

アバター
破棄