- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个可以在 V9 中运行的版本 9 模块。我试图将其安装在 V10 中并收到错误。创建安全组时出现此错误。我还尝试从维护者工具迁移到 V10。
> Replace openerp imports to odoo.
>
> Rename __openerp__.py to __manifest__.py
>
> Replace select = True by index = TrueReplace string selectors in XML by name (if possible) or other attribute selector or even another
> equivalent path/reference. For example, change <group string="x"
> position="after"> by <group name="x" position="after">Remove <data>
> and </data> in xml files if noupdate="0"
>
> Replace the <openerp>/</openerp> tags in xml files by <odoo>/</odoo>.
>
> Don't use @api.one with @api.onchange or it will crash.
>
> ...
错误如下
File "/home/jason/git/odoo10/odoo/addons/base/ir/ir_model.py", line 1028, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
ParseError: "<type 'exceptions.ValueError'>: "External ID not found in the system: base.group_sale_salesman_all_leads" while evaluating
"[(4,ref('base.group_user')), (4,ref('account.group_account_invoice')), (4,ref('stock.group_stock_user')), (4,ref('base.group_sale_salesman_all_leads'))]"" while parsing /home/jason/git/customaddons/layby_order/security/layby_security.xml:5, near
<record id="group_layby_user" model="res.groups">
<field name="name">Layby User</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="comment">This is applicable for Layby User.</field>
<field name="implied_ids" eval="[(4,ref('base.group_user')), (4,ref('account.group_account_invoice')), (4,ref('stock.group_stock_user')), (4,ref('base.group_sale_salesman_all_leads'))]"/>
</record>
layby_security.xml
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="group_layby_user" model="res.groups">
<field name="name">Layby User</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="comment">This is applicable for Layby User.</field>
<field name="implied_ids" eval="[(4,ref('base.group_user')),
(4,ref('account.group_account_invoice')),
(4,ref('stock.group_stock_user')),
(4,ref('base.group_sale_salesman_all_leads'))]"/>
</record>
</data>
</openerp>
ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_layby_order,layby.order,model_layby_order,group_layby_user,1,1,1,0
access_layby_order_line,layby.order.line,model_layby_order_line,group_layby_user,1,1,1,1
如果我停止服务器并再次启动它,然后尝试安装,我得到的第一个错误是
File "/home/jason/git/customaddons/layby_order/layby.py", line 147
date_order = fields.Date.context_today(self)
SyntaxError: invalid syntax
之后,如果我安装,我会收到解析错误“外部 ID 未找到”。我想我得到这个的原因是因为安装在第 147 行停止 date_order = fields.Date.context_today(self)
但我不知道为什么。
已更新
仍然停在147号线
date_order = fields.Date.context_today(self))
更改为 sales_team.group_sale_salesman_all_leads
原来的错误消失了,但现在得到了
raise Exception(_('Module loading %s failed: file %s could not be processed:\n %s') % (module, fname, warning_msg))
Exception: Module loading layby_order failed: file layby_order/security/ir.model.access.csv could not be processed:
No matching record found for external id 'model_layby_order' in field 'Object'
Missing required value for the field 'Object' (model_id)
No matching record found for external id 'model_layby_order_line' in field 'Object'
Missing required value for the field 'Object' (model_id)
最佳答案
OCA 的将模块从 v9 迁移到 v10 的指南基本上足够了,只是它没有提到以前以 base
为前缀的几个安全组。已被移动/模块化到各自的模块,例如 base.group_hr_user
正如您在案例中所看到的,base.group_sale_salesman_all_leads
.
要解决您的第一个问题,请更改您的引用号 base.group_sale_salesman_all_leads
至sales_team.group_sale_salesman_all_leads
在layby_security.xml
:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="group_layby_user" model="res.groups">
<field name="name">Layby User</field>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="comment">This is applicable for Layby User</field>
<field name="implied_ids" eval="[(4,ref('base.group_user')),
(4,ref('account.group_account_invoice')),
(4,ref('stock.group_stock_user')),
(4,ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
</data>
</openerp>
对于您的第二期,如果 date_order
是您要添加到类中的字段,请执行以下操作:
date_order = fields.Date(default=fields.Date.context_today)
否则,如果您实际上声明的是变量而不是新字段,则您的语法看起来没问题,并且 Odoo 10 仍在使用 fields.Date.context_today()
.
您可以look it up on github .
<小时/>编辑:(问题更新后)
该错误可能是因为您在 res.groups
中缺少模型声明。记录。
您可以尝试添加 <field name="model_id" ref="model_layby_order"/>
在layby_security.xml 中?
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="group_layby_user" model="res.groups">
<field name="name">Layby User</field>
<field name="model_id" ref="model_layby_order"/>
<field name="category_id" ref="base.module_category_sales_management"/>
<field name="comment">This is applicable for Layby User</field>
<field name="implied_ids" eval="[(4,ref('base.group_user')),
(4,ref('account.group_account_invoice')),
(4,ref('stock.group_stock_user')),
(4,ref('sales_team.group_sale_salesman_all_leads'))]"/>
</record>
</data>
</openerp>
关于python - Odoo 9 模块至 V10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42124597/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 6年前关闭。 Improve this qu
我想,如果我单击按钮,删除数据并返回 TreeView 。我可以使用 unlink 方法删除数据。但我不能重定向到 TreeView 。我该怎么做? 这是我的代码: def action_de
我最近安装了 Odoo 9.0。但是,我需要一个仅适用于 Odoo 8.0 的模块。 我想知道是否可以对此模块进行微小的更改以使其兼容 Odoo 9.0?新模块只是一个日历,仅使用 Web 界面:Li
嗨,我很难确定人类的权限Odoo10 的资源模块涉及休假管理工作流程。 我在休假类型中激活了双重验证。假设我有一个部门,拥有以下员工: Manager01 (Manager of the Depart
我正在尝试将 odoo 安装从 8.0 升级到 9.0。到目前为止,我所做的如下: 从生产系统备份 odoo 数据库 在我当前的系统中安装了备份数据库作为测试 复制了我系统文件夹中的 odoo 文件夹
如何在 odoo 8.0 (OpenERP) 上删除“Powered by Odoo”? 最佳答案 首先转到您的 Odoo Web 模块并打开以下文件。 addons => web => views
我开发了一个同时支持 odoo 10 和 odoo 11 的应用程序,我想在一个部署下部署这个应用程序。意思是如果我访问我的 odoo 应用程序,我应该看到一个应用程序而不是两个应用程序,当我从下拉列
我已经按照教程安装了 odoo+postgres当我尝试在我的 linux 终端中运行 ./odoo-bin 命令时,我得到了这个错误: 2019-09-15 08:48:30,765 5126 ER
我按照教程在 Odoo 8 中创建了一个模块。我在用户中激活了技术功能,然后更新了模块列表,但它没有出现在列表中。 我该怎么办? 最佳答案 跟踪以下内容: checkout __init__.py,
我需要将“Powered by Odoo”页脚中的“Powered”更改为“Made”, 所以我的 Odoo(以前的 OpenERP)版本 8.0-aab3d9f 的页脚将是“Made by Odoo
默认情况下,当我在 odoo 中创建新数据库时,表是在公共(public)模式中创建的。有没有办法更改此配置以及 odoo 创建和使用另一个定义的方案? 最佳答案 没有办法做到这一点,odoo 默认使
我正在尝试使用与 Django 相同的功能: 在 Odoo 中,我有: 如果“c.id = cat_id”,我需要附加“active”类 它是如何在 Odoo 中完成的? 我正在使用:
我已经发送了一些电子邮件营销事件,在“群发邮件”中,我有“电子邮件”按钮的详细信息。当我点击它时,我有“邮件 ID(技术)”、“消息 ID”、“已发送”等列。但是我看不到我发送的电子邮件。 我怎么能看
在 Odoo 中创建发票时,我想过滤“客户”的可用合作伙伴选择。具体来说,我想将合作伙伴联系记录限制为“发票地址”类型的记录,即 res_partner 上的域。的 [('type','=','inv
我是 ODOO 新手,正在寻找捕获 的方法考勤模块中的地理位置 ODOO 的。需要同时记录入住和退房地点 最佳答案 检查此模块,它捕获地理位置:https://odoo-community.org/s
Odoo 中的 Product Master 需要两个不同的表是什么? product.product 和 product.template 有何不同? 最佳答案 由于产品变体,Odoo 有两种产品模
在V11企业版中,部分机型有存档功能,但公司没有。如果我有多家公司,但有一家公司已经停业,我如何禁用或存档该公司,使其不会出现在所有模块中,甚至管理员也无法将其分配给任何用户?似乎一旦创建了公司,即使
是否有一种简单的方法将 OpenERP (oodo) 中的新自定义字段(在客户记录或订单项目中)与外部链接(即描述或 iframe)关联起来,以便它可以链接到不同的系统? 创建记录时,是否有一种简单的
我在odoo社区版中更改了我的公司数据,但它从未反射(reflect)出来,即使我在浏览器缓存中进行了更改。请帮忙enter image description here ODoo 最佳答案 你有两个
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 6 年前。 Improve th
我是一名优秀的程序员,十分优秀!