Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7182 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
write method in odoo 12 แก้ไขแล้ว
1
ก.ค. 19
4459
1
ก.ย. 18
2748
1
มี.ค. 15
5200
update draft Invoice line unit price แก้ไขแล้ว
2
ธ.ค. 21
6796
[v13] Help overriding _display_address แก้ไขแล้ว
1
พ.ย. 20
2540