odoo Model定义时的属性介绍

_auto = False # don't create any database backend 不创建任何数据库后端

_register = False # not visible in ORM registry 在ORM注册表中不可见,不实例化的类

_abstract = True # whether model is abstract 模型是否抽象,多个继承模型

_transient = False # whether model is transient 模型是否临时,用于临时数据,存储在数据库中经常自动清理

 

_name = None # the model name 模型名称

_description = None # the model's informal name 模型的描述信息

_custom = False # should be True for custom models only 应该只对自定义模型成立

 

_inherit = None # Python-inherited models ('model' or ['model']) python继承模型

_inherits = {} # inherited models {'parent_model': 'm2o_field'} 多个继承模型

_constraints = [] # Python constraints (old API) python方式约束(旧API)

 

_table = None # SQL table name used by model 模型使用的SQL表名

_sequence = None # SQL sequence to use for ID field 用于ID字段的SQL序列

_sql_constraints = [] # SQL constraints [(name, sql_def, message)] 数据库约束

 

_rec_name = None # field to use for labeling records 字段用于标记记录

_order = 'id' # default order for searching results 搜索结果的默认顺序

_parent_name = 'parent_id' # the many2one field used as parent field many2one字段用作父字段

_parent_store = False # set to True to compute parent_path field 设置为True以计算parent_path字段

_date_name = 'date' # field to use for default calendar view 用于默认日历视图的字段

_fold_name = 'fold' # field to determine folded groups in kanban views 字段确定看板视图中的折叠组

 

_needaction = False # whether the model supports "need actions" (see mail) 模型是否支持“需求操作”(见邮件)

_translate = True # False disables translations export for this model False禁用此模型的翻译导出

 

_depends = {} # dependencies of models backed up by sql views 由sql视图支持的模型的依赖性 # {model_name: field_names, ...}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值