Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7175 Lượt xem

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)  

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks for ypur reply @Niyas

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 19
4458
1
thg 9 18
2742
1
thg 3 15
5200
2
thg 12 21
6796
1
thg 11 20
2539