Odoo Help

Welcome!

This community 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.

0

_auto & _sql predefined fields

By
omprakash
on 5/21/13, 2:07 PM 1,140 views

Hai Friends ,

I have question regards OpenERP Object Attributes / Predefined Fields  -  [ _auto & _sql ] .
  1. From the technical document i have idea , but still not clear . Can anyone please explain the fields properties ?

    And once again thanks for everyone , such support for newbie .

Thanks & Regards

OMPRAKASH.A

1

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 5/22/13, 2:36 AM

_sql: SQL code executed upon creation of the object (only if _auto is True). It means this code gets executed after the table is created.


_auto: Determines whether a corresponding PostgreSQL table must be generated automatically from the object. Setting _auto to False can be useful in case of OpenERP objects generated from PostgreSQL views. See the “Reporting From PostgreSQL Views” section for more details.

For example in sale.order class if you are defining _auto=False, sale_order table will not be created in PostgreSQL database.

_auto=False option mostly used to generated PostgreSQL views. You can see example of _auto here and here

Reference: Predefined Fields

Hi , Sudhir Arya thanks for immediate reply .. I like to know is there any existing example (module ) to understand about _sql & _auto ... OMPRAKASH.A

omprakash
on 5/22/13, 3:06 AM

_sql: SQL code to create the table/view for this object (if _auto is False) – can be replaced by SQL execution in the init() method. (Reference: Technical Memento )

Vasiliy Birukov
on 5/22/13, 5:34 AM

Hi , Sudhir Arya .. Thanks for your reply ..Surely i will make use of it ....

omprakash
on 5/22/13, 1:39 PM

Hi wowas , Thanks for your reply ...

omprakash
on 5/22/13, 1:40 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/21/13, 2:07 PM
Seen: 1140 times
Last updated: 3/16/15, 8:10 AM