Odoo 8.0 new API 之model 装饰

model装饰器的作用是返回一个集合列表

 

应用举例:

定义columns

langs = fields.Selection(string="Lang",selection="_get_lang") 

方法定义:

@api.model
def _get_lang(self):
    langs = self.env[res.lang].search([])
    return [(lang.code,lang.name) for lang in langs]

 

Odoo 8.0 new API 之model 装饰,布布扣,bubuko.com

Odoo 8.0 new API 之model 装饰

上一篇:How to install SharePoint 2013 on Windows Server 2012 R2


下一篇:Substrate Tutorials:Add the Contracts Pallet to a runtime