Odoo

对象定义的属性

Oddo 的对象定义的一般形式如下:

class name_of_the_object(osv.osv):
_name = 'xxx'
......
name_of_the_object()
#Sample:class qingjd(osv.osv):
_name = 'qingjia.qingjd'
_description = '请假单'
_columns = {
'shenqr': fields.many2one('hr.employee', '申请人', required=True),
}


qingjd()

对象定义的完整属性如下:

必须属性:

  • _name
  • _columns *

可选属性:

  • _table
  • _description
  • _defaults
  • _order
  • _rec_name
  • _auto
  • _constraints
  • _sql_constraints
  • _inherit
  • _inherits