コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
32641 ビュー

Hi,

When I'm creating new warehouse, getting an error

File "/home/apagen/workspace/odoo/openerp/models.py", line 4191, in _create

cr.execute('update '+self._table+' set parent_left=%s,parent_right=%s where id=%s', (pleft+1, pleft+2, id_new))

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I need help asap.

アバター
破棄
最善の回答

Hi,

Does your db contain demo data? I think your db might be corrupted. Can you check with a fresh db? The "pleft" is not supposed to be empty, but due to some reason (eg: corrupted db) it is becoming null.

You can try to fix by using OCA shell addon  and run the following:

1. Install the addon

2. Run odoo by command: 

python odoo.py shell -d <dbname>

3. In the interactive shell run the following statements:

self.env['stock.warehouse']._parent_store_compute()       //This should return True
self.env.cr.commit()

アバター
破棄
最善の回答

The following code works for me in Odoo v11.0:

self.env['stock.location']._parent_store_compute()
self.env.cr.commit()

アバター
破棄
最善の回答

It worked for me too in v11...
Thanks @dlsuarez

アバター
破棄
著作者 最善の回答

I have resolved this issue after waste lot of time. I found two fields that was blank in stock.location i.e. parent_left and parent_right. Value of both field matter on the all operations related to inventory. Now My existing database working fine after set the values of these fields.

アバター
破棄
最善の回答

This is for someone arriving here from search engines. I faced this error while importing data. This happened because I had the product id field mapped to Product instead of Product/External ID. So if you got this error while importing data, check whether the id fields are mapped properly.

アバター
破棄
関連投稿 返信 ビュー 活動
1
5月 25
924
3
3月 25
1176
1
5月 24
2242
2
12月 22
14266
5
4月 20
4853