Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7240 Vizualizări

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)  

 

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

Thanks for ypur reply @Niyas

Related Posts Răspunsuri Vizualizări Activitate
1
iul. 19
4511
1
sept. 18
2785
1
mar. 15
5245
2
dec. 21
6832
1
nov. 20
2582