跳至内容
菜单
此问题已终结
1 回复
2052 查看

hello

i add one object button . i add two field first is partner_id(many2one) and second is sale_ids(many2many) .

now i want this flow 


first i select re.partner and i click on my button so in sale_ids field automatic give me the all sale order in this field 


thank you in advamce


形象
丢弃
最佳答案
you can call following method to update sale_ids(m2m) from the button:

def update_m2m(self):
for rec in self:
rec.sale_ids = [(6,0,self.search([('id','!=',rec.id),('partner_id', '=', rec.partner_id.id)]).ids)]

Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
    

形象
丢弃
相关帖文 回复 查看 活动
0
9月 22
1823
0
2月 23
157
3
8月 22
9188
1
7月 22
5237
0
7月 22
2214