Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
7417 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor

Thanks for ypur reply @Niyas

Related Posts Odpovědi Zobrazení Aktivita
1
čvc 19
4652
1
zář 18
2947
1
bře 15
5400
2
pro 21
7026
1
lis 20
2693