Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
7335 Visualizzazioni

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)  

 

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Autore

Thanks for ypur reply @Niyas

Post correlati Risposte Visualizzazioni Attività
1
lug 19
4585
1
set 18
2895
1
mar 15
5364
2
dic 21
6932
1
nov 20
2644