[ORM] psycopg2.ProgrammingError: cannot change number of columns in view
When you try to modified a postgres view an error appear in the moment you update the module:
Traceback (most recent call last):
File "./openerp-
pooler.
File "/home/
addons.
File "/home/
r = load_module_
File "/home/
init_
File "/home/
obj.init(cr)
File "/home/
""")
File "/home/
return f(self, *args, **kwargs)
File "/home/
res = self._obj.
psycopg2.
For Exampl:
I defined a Class:
class some_sql_
_name = "some.sql.view"
_description = "View on SQL"
_auto = False
_rec_name = 'ai_nro_ctrl'
_columns = {
}
def init(self, cr):
'''
Create or replace view some_sql_view
'''
create or replace view fiscal_
FORM
)
""")
some_sql_view()
It works fine i have a view with 2 Fields....
Then I try add an extra field called field3
I add 2 lines......
class some_sql_
_name = "some.sql.view"
_description = "View on SQL"
_auto = False
_rec_name = 'ai_nro_ctrl'
_columns = {
}
def init(self, cr):
'''
Create or replace view some_sql_view
'''
create or replace view fiscal_
FORM
)
""")
some_sql_view()
In this moment when i apply:
./openerp-server.py -u module -d dbname
This error appear...
I need in tis case conect to postgres and delete mannually the view some_sql_view and try again and it works......
Thanks...
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Nhomar - Vauxoo
- Solved:
- Last query:
- Last reply:
This question was originally filed as bug #576779.