Odoo Help

1
5 Answers
0
indraneel
4/11/15, 2:23 AM

This is how we solved the problem: 

Lets say there are two modules  sale_order, my_sale_order. Suppose my_sale_order extends the functionality of the sale_order.

And in my_sale_order you want to change the column type of a field in sale_order, lets say, change the type of column order_date from date to datetime. Now, instead of changing the type of order_date to datetime in my_sale_order, what you can do is add a new column called order_datetime  whose type is datetime in my_sale_order  and change all the references in UI markup(and any other references required for proper functioning) from order_date to order_datetime. You can also keep the order_date and order_datetime in sync in your code.

The rationale behind not going with the db restore method suggested by Tim is because that's not a permanent solution and it requires periodic intervention by the support staff to fix this issue, when it reappears.

2
tim diamond
9/24/14, 2:03 PM

Ok community.  I have found a work around that i DO NOT consider a viable option for the long run.  But to help anyone in need:

This problem occurs due to the fact that over the course of time, enough add/drop sequences in postgres will cause the system to hit the hard limit of 1600 columns.  (EVEN IF WHEN VIEWED IN POSTGRES, YOU ONLY SEE MINIMAL COLUMNS).  When you drop a column, it is taken out of the table, but the reference to that column lives on, and stays consuming the 1600 column limit.

My temporary solution:

pg_dump -t table_name_with_issue --inserts -f file_name_for_sql_output.sql database_name

Now you have the sql to recreate the problematic table in file_name_for_sql_output.sql

Enter into psql terminal:  psql -d database_name
Drop the problematic table: drop table table_name_with_issue cascade;
Exit psql:  ctrl+d
Restore the table from the generated .sql:  psql -f file_name_for_sql_output.sql database_name
 

And with that, you should have a re-created table that has a reset column limit.

This problem is pretty much unsolvable without an experienced database administrator, and because of that, I consider this a bug in Odoo.

Maybe someone else has a better workaround?

 

 

 

 

 

2 Comments
indraneel
9/24/14, 2:16 PM

This is how we solved the problem: - make sure the column types are same in both the modules - when ever you want to change a column type, add a new column in the sub module to suit your needs. (we added a new column of type datetime and left the original date column in sale_order intact) - use this newly added column everywhere in your views

tim diamond
9/24/14, 2:48 PM

Could you elaborate on this a little more? I don't really understand the mentality behind this?

Ask a Question
Writer
Keep Informed
3 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now