-->

How to Get the ID field value in Odoo [duplicate]

2019-03-04 04:06发布

问题:

This question already has an answer here:

  • How do I get the value from a form field using Odoo? 1 answer

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

回答1:

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

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

As on your example

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