Trigger Odoo's Scheduled Action During Specific Hours (e.g. everyday every 1AM to 6AM)
up vote
0
down vote
favorite
I want to have Scheduled Action that executes one after another from 1AM to 6AM everyday.
How can I achieve this?
Since the only menus I have are "Execute Every" and "Next Execution Date" I do not know how can I mention the specific hours range. I am using Odoo 11.
odoo odoo-11
add a comment |
up vote
0
down vote
favorite
I want to have Scheduled Action that executes one after another from 1AM to 6AM everyday.
How can I achieve this?
Since the only menus I have are "Execute Every" and "Next Execution Date" I do not know how can I mention the specific hours range. I am using Odoo 11.
odoo odoo-11
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to have Scheduled Action that executes one after another from 1AM to 6AM everyday.
How can I achieve this?
Since the only menus I have are "Execute Every" and "Next Execution Date" I do not know how can I mention the specific hours range. I am using Odoo 11.
odoo odoo-11
I want to have Scheduled Action that executes one after another from 1AM to 6AM everyday.
How can I achieve this?
Since the only menus I have are "Execute Every" and "Next Execution Date" I do not know how can I mention the specific hours range. I am using Odoo 11.
odoo odoo-11
odoo odoo-11
asked Nov 7 at 18:25
notalentgeek
544619
544619
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39
add a comment |
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You can use a wrapper action which is scheduled to run more frequently.
def action_function():
# you will need to store a value (is_running: True|False) in the database, maybe in ir.config_parameter
if current_hour not in (1, 2, 3, 4, 5):
return None
elif is_running:
return None
else:
# Mark that the action is in process, have to commit to the database
is_running = True
self.env.cr.commit()
# Then call your actual action function
do_some_real_thing()
# Mark that the action is done
is_running = False
Basically, the wrapper action of below steps repeats frequently like every 10 minutes.
- Check the time, if not between 1am and 6am, do nothing;
- Check if the action is already running, if yes, do nothing;
- Else, mark that the action as in process, and do the actual thing,
once done, mark the action as finished.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You can use a wrapper action which is scheduled to run more frequently.
def action_function():
# you will need to store a value (is_running: True|False) in the database, maybe in ir.config_parameter
if current_hour not in (1, 2, 3, 4, 5):
return None
elif is_running:
return None
else:
# Mark that the action is in process, have to commit to the database
is_running = True
self.env.cr.commit()
# Then call your actual action function
do_some_real_thing()
# Mark that the action is done
is_running = False
Basically, the wrapper action of below steps repeats frequently like every 10 minutes.
- Check the time, if not between 1am and 6am, do nothing;
- Check if the action is already running, if yes, do nothing;
- Else, mark that the action as in process, and do the actual thing,
once done, mark the action as finished.
add a comment |
up vote
0
down vote
You can use a wrapper action which is scheduled to run more frequently.
def action_function():
# you will need to store a value (is_running: True|False) in the database, maybe in ir.config_parameter
if current_hour not in (1, 2, 3, 4, 5):
return None
elif is_running:
return None
else:
# Mark that the action is in process, have to commit to the database
is_running = True
self.env.cr.commit()
# Then call your actual action function
do_some_real_thing()
# Mark that the action is done
is_running = False
Basically, the wrapper action of below steps repeats frequently like every 10 minutes.
- Check the time, if not between 1am and 6am, do nothing;
- Check if the action is already running, if yes, do nothing;
- Else, mark that the action as in process, and do the actual thing,
once done, mark the action as finished.
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use a wrapper action which is scheduled to run more frequently.
def action_function():
# you will need to store a value (is_running: True|False) in the database, maybe in ir.config_parameter
if current_hour not in (1, 2, 3, 4, 5):
return None
elif is_running:
return None
else:
# Mark that the action is in process, have to commit to the database
is_running = True
self.env.cr.commit()
# Then call your actual action function
do_some_real_thing()
# Mark that the action is done
is_running = False
Basically, the wrapper action of below steps repeats frequently like every 10 minutes.
- Check the time, if not between 1am and 6am, do nothing;
- Check if the action is already running, if yes, do nothing;
- Else, mark that the action as in process, and do the actual thing,
once done, mark the action as finished.
You can use a wrapper action which is scheduled to run more frequently.
def action_function():
# you will need to store a value (is_running: True|False) in the database, maybe in ir.config_parameter
if current_hour not in (1, 2, 3, 4, 5):
return None
elif is_running:
return None
else:
# Mark that the action is in process, have to commit to the database
is_running = True
self.env.cr.commit()
# Then call your actual action function
do_some_real_thing()
# Mark that the action is done
is_running = False
Basically, the wrapper action of below steps repeats frequently like every 10 minutes.
- Check the time, if not between 1am and 6am, do nothing;
- Check if the action is already running, if yes, do nothing;
- Else, mark that the action as in process, and do the actual thing,
once done, mark the action as finished.
answered Nov 20 at 20:32
mingtwo_h9
462
462
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53195565%2ftrigger-odoos-scheduled-action-during-specific-hours-e-g-everyday-every-1am-t%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have multiple actions or one action which should be repeated every x min from 1AM to 6AM?
– CZoellner
Nov 8 at 15:09
One action that is executed from 1AM to 6AM. If the action finishes at 2AM it executed again.
– notalentgeek
Nov 12 at 14:57
That's not possible with Odoo Vanilla. So you need a customization for it. I didn't find a custom module, but i only looked into the OCA repositories.
– CZoellner
Nov 12 at 17:39