py文件的代码..
class some_model(osv.osv):
_name = 'some.model'
def Method_of_Function(self, cr, uid, ids, fld_name, arg, context=None):
#Logic
return value
_columns = {
"functional_filed":fields.function(Method_of_Function,
method=True,type='int',string='Label', store=True),
}
some_model()
Run Code Online (Sandbox Code Playgroud)
并在xml文件中记录标签看起来像......
<record model="ir.ui.view" id="object_name_form_view">
<field name="name">objectname.form</field>
<field name="model">some.model</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="form_string">
<field name="functional_filed" />
</form>
</field>
</record>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3893 次 |
| 最近记录: |