update database bug when the connector is installed [OpenERP bug; workaround exists]

Bug #484843 reported by Raphaël Valyi - http://www.akretion.com
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
Critical
Unassigned

Bug Description

Hello,

currently, it looks like if the connector is installed, then after you restart the server with option --update=all,

you might be unable to login anymore and wil have the following stack trace:

[2009-11-18 12:43:36,901] INFO:init:updating modules list
[2009-11-18 12:43:46,569] INFO:init:module base: loading objects
[2009-11-18 12:43:46,680] INFO:init:module base_setup: loading objects
[2009-11-18 12:43:46,681] INFO:init:module base_setup: registering objects
[2009-11-18 12:43:46,681] INFO:init:module base_setup: creating or updating database tables
[2009-11-18 12:43:46,682] INFO:init:module process: loading objects
[2009-11-18 12:43:46,682] INFO:init:module process: registering objects
[2009-11-18 12:43:46,691] INFO:init:module process: creating or updating database tables
[2009-11-18 12:43:46,916] INFO:init:module base_external_referentials: loading objects
[2009-11-18 12:43:46,916] INFO:init:module base_external_referentials: registering objects
/home/rvalyi/DEV/openerp5.0/addons/base_external_referentials/base_external_referentials.py:24: DeprecationWarning: the sets module is deprecated
  from sets import Set
[2009-11-18 12:43:46,930] INFO:init:module base_external_referentials: creating or updating database tables
[2009-11-18 12:43:47,236] INFO:init:module product: loading objects
[2009-11-18 12:43:47,237] INFO:init:module product: registering objects
[2009-11-18 12:43:47,328] INFO:init:module product: creating or updating database tables
Traceback (most recent call last):
  File "./openerp-server.py", line 111, in <module>
    pooler.get_db_and_pool(db, update_module=tools.config['init'] or tools.config['update'])
  File "/home/rvalyi/DEV/openerp5.0/server/bin/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/home/rvalyi/DEV/openerp5.0/server/bin/addons/__init__.py", line 728, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/home/rvalyi/DEV/openerp5.0/server/bin/addons/__init__.py", line 581, in load_module_graph
    init_module_objects(cr, package.name, modules)
  File "/home/rvalyi/DEV/openerp5.0/server/bin/addons/__init__.py", line 366, in init_module_objects
    result = obj._auto_init(cr, {'module': module_name})
  File "/home/rvalyi/DEV/openerp5.0/server/bin/osv/orm.py", line 1915, in _auto_init
    ref = self.pool.get(f._obj)._table
AttributeError: 'NoneType' object has no attribute '_table'

We are still investigating on this but that's an important bug.

Changed in magentoerpconnect:
importance: Undecided → Critical
Changed in magentoerpconnect:
status: New → Confirmed
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello, still is still a very important one for us.
One remark, Sharoon Thomas we started a salesforce connector using the base_externatl_referentials framework didn't have such issue, so it's rather likely it comes from things we do in the magentoerpconnect module itself.

Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

This bug is now

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

workaround to restore the database:
update ir_module_module set state='installed' where state='to upgrade';

However this doesn't fix the bug and won't run the updates. We are still investigating, but it looks like it's an OpenERP server layer bug with custom relational fields.

See this bug:
https://bugs.launchpad.net/openobject-server/+bug/493657

Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

In fact, this bug is more general than the connector and affects the server:
see https://bugs.launchpad.net/openobject-server/+bug/493657

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

OK, while Tiny may or not fix the bug,
here is a pig workaround if you need to upgrade the server (and especially the product module):

1 ) Before doing the update, execute that SQL statement:
UPDATE ir_model_fields SET model='pickaboo' WHERE model='product.product' AND name ilike 'x_magerp%';

2) now restart the server in update mode:
--update=product (or all) --database=your_database_name

3) Once it's done, execute that new SQL statement:
UPDATE ir_model_fields SET model='product.product' WHERE model='pickaboo' AND name ilike 'x_magerp%';

4) restart the server again, in normal mode (eg not update). You are done dude! you can now use your server normally, it has been upgraded correctly.

Revision history for this message
Salvador Sierra (salvador-sierra) wrote :

Hi,

thanks for you prompt reply. We installed from scratch and updated the connector to the latest version (revision 266).

We are still getting the original error when we try to import the categories.

Best regards

summary: - possible update database bug when the connector is installed
+ update database bug when the connector is installed [OpenERP bug;
+ workaround exists]
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Guys,

since OpenERP 5.0.7 is including Tiny's patch, I'm closing this bug.

Changed in magentoerpconnect:
status: Confirmed → Fix Released
Revision history for this message
jordg (gbj) wrote :

AttributeError: 'NoneType' object has no attribute '_table'

This error is manifest when you create a module and do not define the specific depends in __openerp__.py
eg:
"depends" : ["base", "account", "sale" "report_webkit"],
More than likely you have something missing in the depends list.
I had several modules which did this and were fixed by correcting the depends on trunk (6.1)
Maybe the error message could be clearer though

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.