warning update module warning

Bug #421524 reported by Alberto Garcia (Factor Libre)
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

If you try to update from version 5.0.0 to last version you have:

[2009-08-30 17:40:09,770] WARNING:orm:column 'purchase_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:09,774] WARNING:orm:column 'sale_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:09,799] WARNING:orm:column 'invoice_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:09,824] WARNING:orm:column 'picking_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:10,380] WARNING:orm:column 'purchase_line_warn' in table 'product_product' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:10,390] WARNING:orm:column 'sale_line_warn' in table 'product_product' has changed type (DB = bool, def = selection) but unable to migrate this change !

[2009-08-30 17:40:11,222] WARNING:orm:column 'purchase_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:11,224] WARNING:orm:column 'sale_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:11,234] WARNING:orm:column 'invoice_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !
[2009-08-30 17:40:11,246] WARNING:orm:column 'picking_warn' in table 'res_partner' has changed type (DB = bool, def = selection) but unable to migrate this change !

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Alberto,

This may happen when DB already had records for tables with Bool values.

Does it display selection boxes after update?

Thanks.

Changed in openobject-addons:
status: New → Confirmed
Revision history for this message
Alberto Garcia (Factor Libre) (agarcia-flibre) wrote :

after this, you have a dropbox for select. I view in products.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi,
Would you please try and run the utility?

This warning comes - is confirmed, but it does not break any behaviour.

Changed in openobject-addons:
status: Confirmed → Invalid
Revision history for this message
Alberto Garcia (Factor Libre) (agarcia-flibre) wrote :

Hi Jay,

After this, If you try ,for example, to create a partner you have this error:

Environment Information :
System : Linux-2.6.22.19-0.4-default-i686-with-SuSE-10.3-i586
OS Name : posix
LSB Version: core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32:desktop-3.1-ia32:desktop-3.1-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description: openSUSE 10.3 (i586)
Release: 10.3
Codename: n/a
Operating System Release : 2.6.22.19-0.4-default
Operating System Version : #1 SMP 2009-08-14 02:09:16 +0200
Operating System Architecture : 32bit
Operating System Locale : es_ES.UTF8
Python Version : 2.5.1
OpenERP-Client Version : 5.0.5-bzr
Last revision No. & ID : 983 <email address hidden>
Traceback (most recent call last):
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/home/agl00014/src/openerp/server-5.0/bin/service/web_services.py", line 583, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/osv/osv.py", line 118, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/osv/osv.py", line 110, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/agl00014/proyectos/openerp/openerp-stable-5/server-5.0/bin/osv/orm.py", line 2647, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/home/agl00014/src/openerp/server-5.0/bin/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/home/agl00014/src/openerp/server-5.0/bin/sql_db.py", line 120, in execute
    res = self._obj.execute(query, params)
DataError: la sintaxis de entrada no es válida para tipo boolean: «no-message»

Changed in openobject-addons:
status: Invalid → New
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Alberto,

This is a problem due to type of the fields have been changes from char to boolean.

It can not be taken into a general case, it will be taken into consideration in migration script.

For your own purpose, you will need to change the values by a DB query.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Sorry,
 its from bool to char.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

You may follow this approach for your own sake of simplicity.

1. ALTER TABLE table_name RENAME COLUMN bool_column TO temp_col
2. ALTER TABLE table_name ADD COLUMN bool_column varchar(50)
3. UPDATE table_name SET bool_column=temp_col::varchar(50)
4. ALTER TABLE table_name DROP COLUMN temp_col CASCADE.

Thanks.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Hayssam (hayssam-hoballah) wrote :

Sorry for digging up this old thread, but I'm myself affected by this issue after an upgrade from 5.0.6 to 5.0.15.

We solved the issue for partners following the directions listed here, but then we still have this issue for products. We have the Library module active and here is the error we get:

Invalid input syntax for type boolean: "no-message"

Environment Information :
System : Windows-XP-5.1.2600-SP3
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : fr_FR.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.15
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "netsvc.pyo", line 299, in dispatch
  File "netsvc.pyo", line 77, in __call__
  File "service\web_services.pyo", line 577, in execute
  File "osv\osv.pyo", line 58, in wrapper
  File "osv\osv.pyo", line 119, in execute
  File "osv\osv.pyo", line 111, in execute_cr
  File "C:\Program Files\OpenERP Server\addons\library\product.py", line 282, in onchange_ean
  File "C:\Program Files\OpenERP Server\addons\library\product.py", line 170, in create
  File "osv\orm.pyo", line 2873, in create
  File "sql_db.pyo", line 78, in wrapper
  File "sql_db.pyo", line 123, in execute
DataError: invalid input syntax for type boolean: "no-message"

Any guidance would be very much appreciated as we are really stuck at this point.

Thanks!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Hayssam,

You will need to follow the logic for all the columns which got changed from type bool to varchar.

Hope this helps.

Revision history for this message
Hayssam (hayssam-hoballah) wrote :

Hello Jay,

Thanks for your fast reply!

I sure understand the logic, but I haven't actually figured out which are all the columns that got changed from type varchar to bool...

I already changed it for the columns purchase_warn, sale_warn, invoice_warn and picking_warn in table res_partner. But I don't know which other columns (in table product for what it seems) to edit back to varchar.

Is there a way to list all those columns that were affected during the upgrade?

Thanks again!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Hayssam,

There are only these 4 fields which have changed the type in newer version.

You may get an idea from the source code of warning/warning.py file.

You should make sure whether you really got them changed for your "Desired" DB or not.

If you still get the problem, tracing more in terms of querying will help.

Thanks.

Revision history for this message
Hayssam (hayssam-hoballah) wrote : Re: [Bug 421524] Re: warning update module warning

Thanks again Jay for your fast answer.

Actually I changed it on a test database and then the production one.

What do you mean by "tracing more in terms of querying"?

Thanks.

On Tue, Feb 22, 2011 at 18:29, Jay Vora (OpenERP) <email address hidden> wrote:

> Hello Hayssam,
>
> There are only these 4 fields which have changed the type in newer
> version.
>
> You may get an idea from the source code of warning/warning.py file.
>
> You should make sure whether you really got them changed for your
> "Desired" DB or not.
>
> If you still get the problem, tracing more in terms of querying will
> help.
>
> Thanks.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/421524
>
> Title:
> warning update module warning
>
> Status in OpenERP Modules (addons):
> Invalid
>
> Bug description:
> If you try to update from version 5.0.0 to last version you have:
>
> [2009-08-30 17:40:09,770] WARNING:orm:column 'purchase_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:09,774] WARNING:orm:column 'sale_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:09,799] WARNING:orm:column 'invoice_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:09,824] WARNING:orm:column 'picking_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:10,380] WARNING:orm:column 'purchase_line_warn' in table
> 'product_product' has changed type (DB = bool, def = selection) but unable
> to migrate this change !
> [2009-08-30 17:40:10,390] WARNING:orm:column 'sale_line_warn' in table
> 'product_product' has changed type (DB = bool, def = selection) but unable
> to migrate this change !
>
> [2009-08-30 17:40:11,222] WARNING:orm:column 'purchase_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:11,224] WARNING:orm:column 'sale_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:11,234] WARNING:orm:column 'invoice_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
> [2009-08-30 17:40:11,246] WARNING:orm:column 'picking_warn' in table
> 'res_partner' has changed type (DB = bool, def = selection) but unable to
> migrate this change !
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-addons/+bug/421524/+subscribe
>

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Hayssam,

By that term, I meant if you can do some debugging and tracing the query parser and check which query is throwing this error.

By debugging,we can know the culprit here.

Thanks.

Revision history for this message
Hayssam (hayssam-hoballah) wrote :

Thanks for all the infos Jay. I'll try to see what can be done tomorrow and
will definitely keep everyone updated.

Cheers!

Revision history for this message
Hayssam (hayssam-hoballah) wrote :

Hello Jay,

Last news, the problem is solved and here was the trick:
Purchase_warn, sale_warn, invoice_warn and picking_warn in table res_partner
were not the only 4 fields to have changed type from varchar to boolean
during the upgrade. There were actually 2 more fields, namely
purchase_line_warn and sale_line_warn in the product_product table.
So in total, there were 6 fields affected during the upgrade! So I had to
follow the same basic process of changing the field types from boolean back
to varchar(50) for these 2 extra fields and the trick was done.
That's all there was to it.

I actually wonder if the reason of this extra field type change is due to
our use of the module product_variant. Any hint on that?

Thank you very much Jay for your guidance and hope that this info will help
someone else.

Cheers!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Hayssam,

As I said, you can get more hints from warning.py.

Its possible that your module has changed the datatype,otherwise things seem alright with official modules.

Thanks for your feedback and your keen interest with contribution.

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

Other bug subscribers

Remote bug watches

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