Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1803 Tampilan

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

Avatar
Buang
Penulis

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

Jawaban Terbai

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

Avatar
Buang
Penulis

Thanks u

Post Terkait Replies Tampilan Aktivitas
1
Mei 24
2763
1
Nov 22
5114
2
Jul 22
3826
2
Mei 18
9990
2
Jul 17
6965