跳至內容
選單
此問題已被標幟
1 回覆
3546 瀏覽次數

Hi,

I have a one2many field in the model hr.department:

member_team_ids = fields.One2many('hr.employee', 'hr_department_team', string="Members")

and the inverse relation in the model hr.employee:

hr_department_team = fields.Many2one('hr.department', string="Team Work")

the one2many field has a widget many2many in the view:

<field name="member_team_ids" widget="many2many" nolabel="1"/>


The problem is when Im goint to save the model, it only save 1 or 2 elements.

What do you think the problem is?

 


頭像
捨棄
最佳答案

For a many2many widget to work you need to use a many2many field in the python, not a One2many field

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
9月 25
1485
0
8月 25
2871
4
7月 25
24450
2
1月 23
5139
0
7月 22
4077