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

Hi Community,

See my code

def write(self, vals):

        for i in self:

            if (i.amount_receivable < i.credit_limit): 

                raise UserError("Your Receivable Amount is Less")

            else:

                print("\n \n \n Amount is Greater Than")

        return super(ResPartner1, self).write(vals)  

 

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Just removing the iteration of the self over the for loop and see whether it make any difference.

Sample:

def write(self, vals):
res = super(EventEvent, self).write(vals)
if vals.get('organizer_id'):
self.message_subscribe([vals['organizer_id']])
return res


Thanks

Awatar
Odrzuć
Autor

Thanks for ypur reply @Niyas

Powiązane posty Odpowiedzi Widoki Czynność
1
lip 19
4458
1
wrz 18
2746
1
mar 15
5200
2
gru 21
6796
1
lis 20
2539