安装自定义科目表模块时出现数据库错误
Database error while installing custom chart of account module
我在尝试为默认情况下没有的国家/地区创建科目表模块时遇到数据库错误。模块安装正确。配置的所有税收似乎都很好,会计科目表反映了我 account.acount.template.csv
文件中的内容。但是,通过我的终端日志,我可以看到在加载上述 csv 文件时,出现了这个错误
2021-03-16 18:32:27,054 68271 INFO testing odoo.modules.loading: loading l10n_foo/data/account.account.template.csv
ERROR testing odoo.sql_db: bad query:
INSERT INTO ir_model_data (module, name, model, res_id, noupdate)
VALUES ('l10n_foo', '10210011', 'account.account.template', 3, false),
('l10n_foo', '10210012', 'account.account.template', 4, false),
.
.
.
('l10n_foo', '10210018', 'account.account.template', 10, false)
ON CONFLICT (module, name)
DO UPDATE SET (model, res_id, write_date) =
(EXCLUDED.model, EXCLUDED.res_id, now() at time zone 'UTC')
ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command
have duplicate constrained values.
2021-03-16 18:27:21,500 68271 ERROR testing odoo.addons.base.models.ir_model: Failed to insert ir_model_data
('l10n_foo', '1002010', 'account.account.template', 3, False)
('l10n_foo', '1002011', 'account.account.template', 4, False)
...
什么可能导致此错误?
您的 account.acount.template.csv 文件中有重复行,
所以请检查并删除任何一行。
谢谢
我在尝试为默认情况下没有的国家/地区创建科目表模块时遇到数据库错误。模块安装正确。配置的所有税收似乎都很好,会计科目表反映了我 account.acount.template.csv
文件中的内容。但是,通过我的终端日志,我可以看到在加载上述 csv 文件时,出现了这个错误
2021-03-16 18:32:27,054 68271 INFO testing odoo.modules.loading: loading l10n_foo/data/account.account.template.csv
ERROR testing odoo.sql_db: bad query:
INSERT INTO ir_model_data (module, name, model, res_id, noupdate)
VALUES ('l10n_foo', '10210011', 'account.account.template', 3, false),
('l10n_foo', '10210012', 'account.account.template', 4, false),
.
.
.
('l10n_foo', '10210018', 'account.account.template', 10, false)
ON CONFLICT (module, name)
DO UPDATE SET (model, res_id, write_date) =
(EXCLUDED.model, EXCLUDED.res_id, now() at time zone 'UTC')
ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command
have duplicate constrained values.
2021-03-16 18:27:21,500 68271 ERROR testing odoo.addons.base.models.ir_model: Failed to insert ir_model_data
('l10n_foo', '1002010', 'account.account.template', 3, False)
('l10n_foo', '1002011', 'account.account.template', 4, False)
...
什么可能导致此错误?
您的 account.acount.template.csv 文件中有重复行,
所以请检查并删除任何一行。
谢谢