It is currently Tue May 22, 2012 11:37 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Unique Id in object based on psql view
PostPosted: Fri Jul 01, 2011 11:44 am 
Offline

Joined: Thu Feb 19, 2009 3:42 pm
Posts: 57
Location: Bordeaux France
Not sure to be in the right topic...

I created an object based on a pgsql view :
Code:
def init(self, cr):
        cr.execute("""
            create or replace  view my_object ...


As the result of the query doesn't have unique id inside, I create a pgsql sequence (my_object_id_seq) and use someting like this :

Code:
SELECT  cast (nextval('my_object_id_seq') as integer) as id,

The cast is used to get id as integer because sequences are bigint by default.

The view works fine in PgAdmin and no error when upgrading my module but when I open the view of my object in OpenErp, the view is empty, means no records are shown (fields name are visible and ok)


I also tried to concatenate existing fields in the query to make the id but it does not work either.

Any idea?

Thanx

_________________
Laurent OLIVIER
SO Conseil
http://www.soconseil.com


Top
 Profile  
 
 Post subject: Re: Unique Id in object based on psql view
PostPosted: Thu Aug 04, 2011 2:04 pm 
Offline

Joined: Fri Apr 30, 2010 10:35 am
Posts: 90
Hello,

i'm stuck with exact the same Problem, have you found any Solution?

Thanks!


Top
 Profile  
 
 Post subject: Re: Unique Id in object based on psql view
PostPosted: Fri Aug 05, 2011 7:28 am 
Offline

Joined: Thu Feb 19, 2009 3:42 pm
Posts: 57
Location: Bordeaux France
Hello

no solution found :(
I gave up... for the moment

_________________
Laurent OLIVIER
SO Conseil
http://www.soconseil.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP