Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1924 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
3058
1
Nov 22
5547
2
Jul 22
4143
2
Mei 18
10280
2
Jul 17
7398