تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7152 أدوات العرض

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)  

 

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
الكاتب

Thanks for ypur reply @Niyas

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 19
4442
1
سبتمبر 18
2727
1
مارس 15
5187
2
ديسمبر 21
6773
1
نوفمبر 20
2528