Skip to Content
Menu
This question has been flagged
2 Replies
2549 Views

Dear all, Concerning Model attributes, it was mentioned as following in “Odoo 10 Development Essentials - Daniel Reis”:

_table is the name of the database table supporting the model. Usually, it is left to be calculated automatically, and is the model name with the dots replaced by underscores. But it's possible to set to indicate a specific table name.

Does it mean that Odoo also support short table name, like: pur_line,sale_line, ect? If it is "yes", how the short table name will affect the related .py and .xml file for a new model?

Any advice will be highly appreciated, thanks! Henry

Avatar
Discard

_name = 'todo.task'

it's convert into database as todo_task

it's default behave of _table

all over in odoo you use self.env['todo.task'] to access this model.

and in database it's todo_task

if you do

_name = 'todo.task'

_table = 'etc'

then you use in odoo todo.task and in database table created etc

Author Best Answer

@Usman Farzand  Well noted, thanks a lot!

Avatar
Discard
Related Posts Replies Views Activity
2
Aug 24
3519
3
Apr 24
1469
0
Jun 19
3292
0
Mar 15
4082