[ORM] psycopg2.ProgrammingError: cannot change number of columns in view
This bug report was converted into a question: question #109991: [ORM] psycopg2.ProgrammingError: cannot change number of columns in view.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
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...
Correction:
When I said:
_rec_name = 'ai_nro_ctrl'
Correct is:
_rec_name = 'field1'