Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1787 มุมมอง

 bien = fields.Many2one('product.template', string="Bien", domain="['&',('nom_projet_ids', '=', nom_projet_ids), ('etat_depend_etat', '=', 'dispo')]")

อวตาร
ละทิ้ง
ผู้เขียน

bien = fields.Many2one('product.template', string="Bien", domain="['&',('nom_projet_ids', '=', nom_projet_ids), ('etat_depend_etat', '=', 'dispo')]")

คำตอบที่ดีที่สุด

Hi,

Please try to use the domain by passing the xml files, in order to apply the domain in action. domain would be the key of action and the value would list of tuples.

try this method,

@api.onchange('bien')
def bien_product(self):
​context = dict(self._context)
​write your codes
​return {'domain': {'bien': [['&',('nom_projet_ids', '=', nom_projet_ids), ('etat_depend_etat', '=', 'dispo')]}}

bien = fields.Many2one('product.template', string="Bien")

Regards

อวตาร
ละทิ้ง
ผู้เขียน

Thanks u

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 24
2762
1
พ.ย. 22
5110
2
ก.ค. 22
3826
Search domain : multiple condition แก้ไขแล้ว
2
พ.ค. 18
9989
2
ก.ค. 17
6962