Server IP : 127.0.0.2 / Your IP : 18.190.152.109 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/odoo/odoo/workflow/ |
Upload File : |
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.workflow.service import WorkflowService # The new API is in odoo.workflow.workflow_service # OLD API of the Workflow def clear_cache(cr, uid): WorkflowService.clear_cache(cr.dbname) def trg_write(uid, res_type, res_id, cr): """ Reevaluates the specified workflow instance. Thus if any condition for a transition have been changed in the backend, then running ``trg_write`` will move the workflow over that transition. :param res_type: the model name :param res_id: the model instance id the workflow belongs to :param cr: a database cursor """ return WorkflowService.new(cr, uid, res_type, res_id).write() def trg_trigger(uid, res_type, res_id, cr): """ Activate a trigger. If a workflow instance is waiting for a trigger from another model, then this trigger can be activated if its conditions are met. :param res_type: the model name :param res_id: the model instance id the workflow belongs to :param cr: a database cursor """ return WorkflowService.new(cr, uid, res_type, res_id).trigger() def trg_delete(uid, res_type, res_id, cr): """ Delete a workflow instance :param res_type: the model name :param res_id: the model instance id the workflow belongs to :param cr: a database cursor """ return WorkflowService.new(cr, uid, res_type, res_id).delete() def trg_create(uid, res_type, res_id, cr): """ Create a new workflow instance :param res_type: the model name :param res_id: the model instance id to own the created worfklow instance :param cr: a database cursor """ return WorkflowService.new(cr, uid, res_type, res_id).create() def trg_validate(uid, res_type, res_id, signal, cr): """ Fire a signal on a given workflow instance :param res_type: the model name :param res_id: the model instance id the workflow belongs to :signal: the signal name to be fired :param cr: a database cursor """ assert isinstance(signal, basestring) return WorkflowService.new(cr, uid, res_type, res_id).validate(signal) def trg_redirect(uid, res_type, res_id, new_rid, cr): """ Re-bind a workflow instance to another instance of the same model. Make all workitems which are waiting for a (subflow) workflow instance for the old resource point to the (first active) workflow instance for the new resource. :param res_type: the model name :param res_id: the model instance id the workflow belongs to :param new_rid: the model instance id to own the worfklow instance :param cr: a database cursor """ assert isinstance(new_rid, (long, int)) return WorkflowService.new(cr, uid, res_type, res_id).redirect(new_rid)