Odoo:服务器操作在“activity_user_type”列中返回空值违反了非空约束

我正在创建一个简单的服务器操作,它只打印一个简单的测试,但是当我运行代码时,我收到以下错误


odoo.tools.convert.ParseError: "null value in column "activity_user_type" violates not-null constraint

DETAIL:  Failing row contains (617, Confirm, ir.actions.server, null, 552, action, 1, 2020-10-24 02:50:49.149867, 1, 2020-10-24 02:50:49.149867, ir_actions_server, code, 5, 552, null, action = model.print_test(), null, null, null, null, null, null, null, null, null, null, null).

" while parsing /home/odoo/odoo12/project1/bearings_module/views/shortfall.xml:52, near

代码


<record id="model_custom_shortfall_action_confirm" model="ir.actions.server">

        <field name="name">Confirm</field>

        <field name="type">ir.actions.server</field>

        <field name="model_id" ref="bearings_module.model_custom_shortfall"/>

        <field name="binding_model_id" ref="bearings_module.model_custom_shortfall"/>

        <field name="state">code</field>

        <field name="code">action = model.print_test()</field>

</record>


def print_test(self):

        print("Test")


慕田峪7331174
浏览 131回答 1
1回答

qq_笑_17

根据需要添加“邮件”模块来源:https ://github.com/ruter/Odoo-Tutorial-Demo/issues/2#issuecomment-525574410
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python