Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
7512 Näkymät

Hi,

i created a mny to many:

'id_many' : fields.many2many('test.training.student','test_training_rel','truc_name','machin_name','bidule')

But how i can acces to modify the relation table test_training_rel ?

I try:

print self.pool.get('hr.employee')        ====> works !
print self.pool.get('test.training.rel')  ====> None  #   :'(
print self.pool.get('test_training_rel')  ====> None  #   :'(

In OpenERP v6

Avatar
Hylkää
Paras vastaus

Hi,

hr.employee is a model not table. To access the relation table and its content you need to execute sql query inside your function and map the fetched data accordingly.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
toukok. 16
3112
1
maalisk. 15
4072
0
maalisk. 15
5620
1
kesäk. 24
1533
1
helmik. 24
1961