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

I have created a cron job for auto lead assignment which works perfectly well when it is "Run Manually" but gives an error when it triggers automatically after sometime. I have done some research on this but couldn't find anything useful. I'm a bit confused with this behavior. Does anyone have any idea about this? Any help will be appreciated.
Error  which it gives on Auto Trigger is this:


ValueError: : "object unbound" while evaluating
'model.auto_lead_assignment()' 

Ảnh đại diện
Huỷ bỏ

you can write records.auto_lead_assignment() or You can search all records and then call method:
all_records = env['object.name'].search([])
all_records.auto_lead_assignment()

Tác giả

@Patil its still giving the same error:
File "/home/hamza/custom/programming/envoirnments/odoo/odoo13/env/new_city/lib/python3.7/site-packages/werkzeug/local.py", line 135, in _lookup
raise RuntimeError('object unbound')
ValueError: <class 'RuntimeError'>: "object unbound" while evaluating
"all_records = env['lead.record'].search([('status', '=', 'new')])\n\nall_records.auto_lead_assignment()"

Câu trả lời hay nhất


Auto calling Methods: In this methods get run automatically after the selected time period,
Run Manually: If the method has skipped some values to set on automatic run, so we can use run manually to set that value.

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

you did not get my point i know this basic difference my point is when i run manually it works and when system triggers it at specific time it throws above error

you can write records.auto_lead_assignment() or You can search all records and then call method:
all_records = env['object.name'].search([])
all_records.auto_lead_assignment()

Câu trả lời hay nhất

Hi! Did you manage to resolve this? I have the same problem but in a custom cron.

Manually does perfectly but auto is like a lottery

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 21
2604
1
thg 1 21
3792
1
thg 5 24
2888
2
thg 8 24
1403
0
thg 1 25
1254