Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
11387 Widoki

I had a many2one field which shows value while i change partner_id.But the problem is that those partner who has no the value also shows the previous value assigned in many2one field.Those partner who has no the value must show the many2one field empty .How can i resolve it.. 

Here is my code:

obj = self.pool.get('bank.internal.transfer')
id1 = obj.search(cr, uid, [('partner_id','=',name)])
for i in obj.browse(cr, uid, id1, context=context):
    bank_id_= i.id
    if bank_id_:
        res['bank_id']=bank_id_
    else:
        res['bank_id']=False

 

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Hi..its ok now...

Awatar
Odrzuć

how can u explain ur code and functionality

Autor

Its nothing i had repositioned the 'res['bank_id']=False' to the outside of loop... obj = self.pool.get('bank.internal.transfer') id1 = obj.search(cr, uid, [('partner_id','=',name)]) res['bank_id']=False for i in obj.browse(cr, uid, id1, context=context): bank_id_= i.id if bank_id_: res['bank_id']=bank_id_

Najlepsza odpowiedź

many2one_field = False

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 25
5958
1
gru 24
1492
1
lis 22
16051
3
sie 22
13102
2
sie 22
4544