Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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.

Awatar
Odrzuć

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

self.action_confirm()

this will make in RecursionError

Powiązane posty Odpowiedzi Widoki Czynność
2
gru 24
4375
1
lis 24
3139
2
kwi 23
18124
1
mar 23
2412
4
sie 24
24240