ERROR: null value in column "name" of relation "res_company" violates not-null constraint
1 # 创建res.company公司信息的时候,发现它执行了两次create()方法,并且第二次调用create,传了一个[{}]做为参数
2 # 原因是,你创建res.company的时候并没有指定哪个res.users用户去创建,没有指定就没办法获取一些特定值
3 # 之所以没有指定,是因为你是在处理http请求的时候去创建公司信息,而这个时候用户还没有登录
4 # 所以你可以这么做:
5 request.env['res.company'].sudo().with_user(1).create(values)
6 # with_user:指定用户id为1的账户去执行创建
# 报错信息:
ERROR shequ_demo odoo.sql_db: bad query: INSERT INTO "res_company" ("id", "create_uid", "create_date", "write_uid", "write_date", "account_check_printing_date_label", "account_check_printing_layout", "account_check_printing_margin_left", "account_check_printing_margin_right", "account_check_printing_margin_top", "account_dashboard_onboarding_state", "account_invoice_onboarding_state", "account_onboarding_create_invoice_state", "account_onboarding_invoice_layout_state", "account_onboarding_sale_tax_state", "account_opening_date", "account_setup_bank_data_state", "account_setup_bill_state", "account_setup_coa_state", "account_setup_fy_data_state", "base_onboarding_company_state", "currency_id", "expects_chart_of_accounts", "fiscalyear_last_day", "fiscalyear_last_month", "font", "invoice_is_email", "invoice_is_print", "paperformat_id", "payment_acquirer_onboarding_state", "portal_confirmation_sign", "quotation_validity_days", "sale_onboarding_order_confirmation_state", "sale_onboarding_sample_quotation_state", "sale_quotation_onboarding_state", "sc_shipyard_id_bit", "sc_type", "sc_type_bit", "sequence", "tax_calculation_rounding_method", "tempshow") VALUES (nextval('res_company_id_seq'), NULL, (now() at time zone 'UTC'), NULL, (now() at time zone 'UTC'), true, 'disabled', 0.25, 0.25, 0.25, 'not_done', 'not_done', 'not_done', 'not_done', 'not_done', '2022-01-01', 'not_done', 'not_done', 'not_done', 'not_done', 'not_done', NULL, true, 31, '12', 'Lato', true, true, 1, 'not_done', true, 30, 'not_done', 'not_done', 'not_done', false, 'normal', false, 10, 'round_per_line', '') RETURNING id
ERROR: null value in column "name" of relation "res_company" violates not-null constraint
DETAIL: Failing row contains (26, null, null, null, 10, 2022-05-10 03:21:18.168334, null, null, null, null, null, null, null, 1, null, not_done, Lato, null, null, null, null, 2022-05-10 03:21:18.168334, normal, f, null, f, null, null, null, null, null, , null, null, null, null, null, null, null, null, null, 31, 12, null, null, null, null, t, null, null, null, null, null, null, null, null, null, round_per_line, null, null, null, null, null, null, null, null, null, null, null, t, t, null, 2022-01-01, not_done, not_done, not_done, not_done, not_done, not_done, not_done, not_done, null, not_done, null, null, null, null, null, null, not_done, null, t, null, 30, not_done, not_done, not_done, null, null, disabled, t, null, 0.25, 0.25, 0.25).
ERROR: null value in column "name" of relation "res_company" violates not-null constraint的更多相关文章
- [MySQL-1] mysql error 1101 blob/text column can't have a default value
在MySQL Query Browser上创建一个含有TEXT类型的字段,创建不成功,报错:mysql error 1101 blob/text column can't have a default ...
- 一个坑:java.sql.ResultSet.getInt==》the column value; if the value is SQL NULL, the value returned is 0
Retrieves the value of the designated column in the current row of this ResultSet object as a String ...
- POSTGRESQL中ERROR: recursive query "t" column 2 has type character varying(150) in non-recursive term but type character varying overall
最近在做项目的时候有个需求是需要查到当前登录的用户下辖所有区域的数据,并将查询出来的部门信息以如下格式展示 最高人民法院>江苏省高级人民法院>南通市中级人民法院最高人民法院>江苏省高 ...
- org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'alarmGroup' from result set. Cause: java.sql.SQLException: Error
异常展示: org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'alarmGroup ...
- MySQL5.7更改密码时出现ERROR 1054 (42S22): Unknown column 'password' in 'field list'
转自:http://blog.csdn.net/u010603691/article/details/50379282 新安装的MySQL5.7,登录时提示密码错误,安装的时候并没有更改密码,后来通过 ...
- Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止
1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "< ...
- Error Code: 1054. Unknown column 'age' in 'user'
1.错误描述 10:28:20 alter table user modify age int(3) after sex Error Code: 1054. Unknown column 'age' ...
- MySQL 报错ERROR 1054 (42S22): Unknown column 'plugin' in 'mysql.user'
MySQL 我们在创建用户的时候,可能会遇到以下报错: ERROR 1054 (42S22): Unknown column 'plugin' in 'mysql.user' 说明mysq.user ...
- mysql 5.7 ERROR 1054(42S22) Unknown column 'password' in ‘field list’ 报错
mysql 忘记密码 报错?ERROR 1054(42S22) Unknown column 'password' in ‘field list’原因:5.7版本下的mysql数据库下已经没有pass ...
随机推荐
- 110_Power Pivot特殊结算日期及财年日期
博客:www.jiaopengzi.com 焦棚子的文章目录 请点击下载附件 1.背景 前几天看到群里有朋友在搞特殊结算日期,主要不是按照正常日期里的整月,按照比如:上月21号至本月20号作为结算周期 ...
- python文件操作拓展与认识函数
目录 文件内光标的移动(了解即可) 前言 控制光标移动seek()方法 文件的修改 函数 语法结构 简单的使用 作业 答案 文件内光标的移动(了解即可) 前言 在文件的内置方法中,read()方法是可 ...
- Es6语法+v-on参数相关+vue虚拟dom
Es6的语法 Es5:if和for 都没有块级作用域,函数function有作用域. Es6:加入let使得if和for有作用域 .建议: 在Es6中优先使用const,只有需要改变某一个标识符的时候 ...
- WPF|快速添加新手引导功能(支持MVVM)
阅读导航 前言 案例一 案例二 案例三(本文介绍的方式) 如何使用? 控件如何开发的? 总结 1. 前言 案例一 站长分享过 眾尋 大佬的一篇 WPF 简易新手引导 一文,新手引导的效果挺不错的,如下 ...
- 高通(QCOM)sensor bring up
高通7150平台 1.添加驱动文件 2.添加编译 3.配置json文件 4.高通默认配置 5.部分sensor外挂电源 6.遇到的问题 1.添加驱动文件 路径:adsp_proc/ssc/sensor ...
- Similarity calculation
推荐算法入门(相似度计算方法大全) 一.协同过滤算法简介 在推荐系统的众多方法之中,基于用户的协同过滤是诞最早的,原理也比较简单.基于协同过滤的推荐算法被广泛的运用在推荐系统中,比如影视推荐.猜你喜欢 ...
- MySQL并行复制(MTS)原理(完整版)
目录 MySQL 5.6并行复制架构 MySQL 5.7并行复制原理 Master 组提交(group commit) 支持并行复制的GTID slave LOGICAL_CLOCK(由order c ...
- 华为云Stack首席架构师:打造“称手”的数字化工具,答好政企IT数字化转型这道必选题
摘要:数字化转型是一号位工程,数字化的工具本身就是企业的核心竞争力. 本文分享自华为云社区<华为云Stack首席架构师:打造"称手"的数字化工具,答好政企IT数字化转型这道必 ...
- House of apple 一种新的glibc中IO攻击方法
目录 House of apple 一种新的glibc中IO攻击方法 前言 利用条件 利用原理 利用思路 思路一:修改tcache线程变量 思路二:修改mp_结构体 思路三:修改pointer_gua ...
- [WUSTCTF2020]朴实无华-1
1.打开连接只有如下界面: 2.用bp抓包分析包内数据,未发现有用的信息: 3.进行目录扫描,获得robots.txt文件并进行访问: 4.访问/fAke_f1agggg.ph ...