Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7324 Lượt xem

Hello all,
In the res.partner model, I have found this boolean field :

employee = fields.Boolean(help="Check this box if this contact is an Employee.")


I don't find any place where this field is used programmatically. All my partner has this value at False in the database, even if they have a user or an employee associated with.

Is this field employee used somewhere in Python? What is his utility? When does his value change?

Thanks


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Pascal,

I guess there is no use of this field. It is just for information purpose.

If partner's user is related to any employee then having this field checked makes sense.

Ảnh đại diện
Huỷ bỏ
Tác giả

I agree with you. This field should be checked when the partner's user is related to any employee. But do you confirm that this it not the case actually? I think that I have to rewrite this field to achieve this. Do you agree?

Câu trả lời hay nhất

The use of that field is just to filter Partners by that field in an action/menu just like there is filters for Customers and Suppliers, You could check their use in the addons/base/res/res_partner_view.xml

<record id="action_partner_employee_form" model="ir.actions.act_window">
  <field name="name">Employees</field>
  <field name="type">ir.actions.act_window</field>
  <field name="res_model">res.partner</field>
  <field name="view_type">form</field>
  <field name="domain">[('employee','=',1)]</field>
  <field name="context">{'default_customer':0, 'default_supplier':0 , 'default_employee':1}</field>
  <field name="filter" eval="True"/>
</record>

But I don't see that the action is used anywere

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 21
5783
1
thg 11 16
10554
1
thg 3 15
6050
3
thg 12 18
5377
3
thg 1 17
3484