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

Hello Community,

When I am importing xlsx sheet than getting 'RecursionError: maximum recursion depth exceeded' error. I am using odoo v13. My aim is that when 'log_status' changed to 'Confirmed' state then one assigned method should be called. for this, I am using a write method for calling this method. My python code is below:

    @api.model
def write(self, vals):
record = super(Transaction_log, self).write(vals)
if 'log_status' in vals and vals.get('log_status') == 'Confirmed':
self.action_confirm()
return record


def action_confirm(self):
self.write({'log_status': 'Confirmed'})
self.action_performed.create({'log_status': 'Confirmed', 'trans_log': self.id,
'performed_by': self.env.user.id, 'performed_time': datetime.now()})
return True

Thanks in advance.

อวตาร
ละทิ้ง

change this if 'log_status' in vals and vals.get('log_status') == 'Confirmed':

self.action_confirm()

this will make in RecursionError

Related Posts ตอบกลับ มุมมอง กิจกรรม
Add New Operation Type in Warehouse แก้ไขแล้ว
2
ธ.ค. 24
4406
1
พ.ย. 24
3186
2
เม.ย. 23
18202
1
มี.ค. 23
2449
4
ส.ค. 24
24286