콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4671 화면

Hi, im new to odoo kindly help me thanks.

my scenario:

I have created a working module name 'shipping info' in the odoo, 

class SI(orm.Model):

_name: 'SI'

_column: {

'Shipaddr':fields.char('Shipping Address',size(100)),

}

I have also create a database and table in postgresql, i also install pgAdmin3 so it will be easy for me to monitor records in the database because it has gui. 

databasename is 'sirecord'

table name is 'sirecordtable'

table consists of fields 'address' which has datatype of char which has size of(100)

im wondering (is it possible?) how can i transfer the input data in the shipping info in odoo to my postgresql database

for example i put record of 'my address123' into the field in my module and then i save it, how will the postgresql catch this. thanks.

 

아바타
취소
베스트 답변

Lakay, there are a couple of ways to achieve what you required.  One way is to create sirecordtable within the OpenERP and update it there when SI model is created.  Second is to use database trigger.

아바타
취소
작성자

Hi john doe, thank you but can you more further elaborate that?

Lakay, you can read about PostgreSQL's Trigger from this link: http://www.postgresql.org/docs/9.2/static/plpgsql-trigger.html. As for creation sirecordtable within OpenERP, you just need create a new model. If you already have that table, you can only do this if all the fields are compatible with OpenERP's fields. In the existing table, add a column called id (must be named such) which is a serial column which will became the Primary Key. Then create a .py file that hold the class for this model and list out all fields in _columns. To prevent OpenERP to create the same table, set the _auto = False. If the table is in another database, you can use PostgreSQL's dblink (http://www.postgresql.org/docs/9.2/static/dblink.html)

관련 게시물 답글 화면 활동
0
12월 21
2313
2
2월 19
9480
14
12월 17
100972
0
9월 17
2500
0
3월 15
3420