2017-02-08 5 views
1

私はV9で動作するバージョン9のモジュールを持っています。私はそれをV10にインストールしてエラーを取得しようとしています。セキュリティグループを作成するときにエラーが発生します。私はまた、メンテナツールV10への移行から次のことを試みました。以下はOdoo 9モジュールから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)しかし、私は理由が分かりません。

はまだ元のエラーが消えていたが、今V9からモジュールを移行する

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) 

答えて

2

OCAのガイドを取得しているsales_team.group_sale_salesman_all_leads

を変更した後、ライン147

date_order = fields.Date.context_today(self)) 

上で停止を更新

〜v10は、ほとんどの場合、 baseという接頭辞が付いていたセキュリティグループが、base.group_hr_userなどのように移動/モジュール化されていることや、あなたのケースで見たように、base.group_sale_salesman_all_leadsなどが挙げられます。

layby_security.xmlsales_team.group_sale_salesman_all_leadsにご参照base.group_sale_salesman_all_leadsを変更、あなたの最初の問題を解決するために:date_orderは、あなたのクラスに追加されている分野である場合、代わりにこれを行う、あなたの第二の問題については

<?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 = fields.Date(default=fields.Date.context_today) 

実際には新しいフィールドの代わりに変数を宣言している場合、構文はOKと表示され、Odoo 10はまだfields.Date.context_today()を使用しています。

look it up on githubとすることができます。


EDIT:(質問を更新しました後)

あなた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> 
+0

元の質問を更新しました。 ir.model.access.csvを処理できませんでした。まだdate_order = fields.Date.context_today(self)で停止しています) – user2379186

+0

私は答えを更新しました!それが役に立ったら教えてください。 –

+0

ParseError:/ home/jason/git/customaddons/layby_order /をパーズしているときに、ValueError( 'システム内に外部IDが見つかりませんでした:%s'%xmlid) ParseError: "システム内に外部IDが見つかりません:layby_order.model_layby_order" security/layby_security.xml:5、 – user2379186