我有一个适用于 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
之后,如果我安装,我会收到 Parse 错误 External ID not found。我在想我得到这个的原因是因为安装在第 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)