-->建立模型model
class MinimalModel(models.Model):
_name='test.model'
The most important attribute is _name which is required and defines the name forthe model in the Odoo system。
Model Fields(模型字段):
Fields are used to define what the model can store and where. Fields aredefined as attributes on the model class:
例:name=field.Char(requird=True)
注意:5个保留字段:
- the unique identifier for a record in its model
- creation date of the record
- user who created the record
- last modification date of the record
- user who last modified the record
id
(
Id
)
create_date
(
Datetime
)
create_uid
(
Many2one
)
write_date
(
Datetime
)
write_uid
(
Many2one
)