如何在Odoo中获取ID字段值 [英] How to Get the ID field value in Odoo

查看:842
本文介绍了如何在Odoo中获取ID字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Odoo 8的新手,在获取对象的ID值方面遇到一些困难,例如hr.employee的ID字段值,您能在这件事上给我一些示例吗

I'm new in Odoo 8 and have some difficulties getting the ID value of a object for example the ID field value of hr.employee, can you give me some sample in this matter

推荐答案

请阅读 v8的官方文档.0 ,它将为您提供清晰的主意.

Please read the Official Doc for v8.0 , it will give you clear idea.

请注意,如果您使用的是New API,则只需直接创建model_object并使用model_obj.id进行获取

For note, if your are using New API then you just directly create model_object and fetch using model_obj.id

根据您的示例

HrEmployee = self.env['hr.employee']
employee_id = HrEmployee.id

这篇关于如何在Odoo中获取ID字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆