SlideShare a Scribd company logo
1 of 26
Workflow Functional Concept
OPENERP7
Contents
 What is workflow
 Workflow Goals
 Benefits of applying Workflow
 Defining Workflow
 Example holiday Request approval
 How to modify the workflow
 How to add approval workflow OpenERP 7
 How to hide a workflow button based on user in OpenERP7
The workflow system in OpenERP
 is a very powerful mechanism that can describe the evolution of documents
(model) in time.
Goals of Workflow Mechanism
 description of document evolution in time
 automatic trigger of actions if some conditions are met
 management of company roles and validation steps
 management of interactions between the different objects/modules
 graphical tool for visualization of document flows
Advantage of Workflow in OpenERP7
 Workflows are entirely customizable, they can be adapted to the flows and
trade logic of almost any company. The workflow system makes OpenERP very
flexible and allows it to easily support changing needs without having to
program new functionality.
Defining Workflow
 Define the States of your object
 The first step is to define the States your object can be in. We do this by adding
a 'state' field to our object, in the _columns collection
Example Hr.Holidays Model:
'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'),
('refuse', 'Refused'), ('validate1', 'dept_mang_apprv'), ('validate2', 'head_mang_apprv'),
('validate', 'Approvedff')], 'Status', readonly=True, track_visibility='onchange',
 Define the State-change Handling Methods
 Add additional methods to your object. These will be called by our workflow
buttons.
Defining Workflow
 Creating your Workflow XML file
File Path : serveraddonsmodule folder[module_name]_workflow.xml
Workflow Header Record
Activity Record
Do action
Activity Record
Do action
Transition Record:
condition must
executed to
transfer
These define the actions that must be executed
when the workflow reaches a particular state.
These define the possible transitions between
workflow states
Activity: These define the actions that must be executed when the
workflow reaches a particular state.
 “ Draft Activity “
<record model="workflow.activity" id="act_draft"> <!-- draft -->
<field name="wkf_id" ref="wkf_holidays" />
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
Activity Fields
 flow_start
Indicates if the node is a start node. When a new instance of a workflow is
created, a workitem is activated for each activity marked as a flow_start.
 flow_stop
Indicates if the node is an ending node. When all the active workitems for a
given instance come in the node marked by flow_stop, the workflow is
finished.
 kind
Possible values:
dummy: Do nothing (default).
function: Execute the function selected by an action field.
subflow: Execute a sub-workflow SUBFLOW_ID. The action method must return the ID of the
concerned resource by the subflow. If the action returns False, the workitem disappears.
 action
The action indicates the method to execute when a workitem comes into this activity.
The method must be defined in an object which belongs to this workflow
Transition: are the conditions which need to be satisfied to move from one activity to the next.
 The conditions are signals:
button pressed in the interface[view.xml file for module ] # create button of
type workflow
signals are evaluated before the expression. If a signal is false, the expression
will not be evaluated.
Transition Fields
act_from
Source activity. When this activity is over, the condition is tested to determine if we can start the ACT_TO
activity.
act_to
The destination activity.
condition
Expression to be satisfied if we want the transition done.
signal
When the operation of transition comes from a button pressed in the client form, signal tests the name of
the pressed button.
If signal is NULL, no button is necessary to validate this transition.
Group id
user to do this action must have privildge rules on this group , if not will displayed permission denied
Holidays Request Approval mechanism
 Manage employee leaves from the top menu "Human Resources".
Employees can create leave requests that are validated by their manager
and/or HR officers.
note and/or based on chosen holiday type on holiday request
 Once validated, they are visible in the employee's calendar.
 HR officers can define leave types and allocate leaves to employees and
employee categories
Customized Holidays Request Approval
mechanism
 Based on job employement hierarchy :
 How to add approval workflow OpenERP 7
 How to control number of approvals based on employee job id
department
manager
project
manager
project
manager
project
manager
developer1 developer2
Head Manager
Fit your Needs
draft
state='to submit'
(draft)
confirm
holidays_confirm()
state=‘confirm'
(to approve)
validate
holidays_validate()
state='approvedff'
(validate))
Validate_second
holidays_second_validate()
state='head_man_apprv'
(validate2)
First_validate
holidays_first_validate()
state='dept_man_apprv'
(validate1)
Approve
ValidateValidate2
Refuse
Holidays_refuse()
State=‘refuse’
EmpJobid=developer
Split mode = or
Join mode = Xor [default]
 “ Draft Activity “
<record model="workflow.activity" id="act_draft"> <!-- draft -->
<field name="wkf_id" ref="wkf_holidays" />
<field name="flow_start">True</field>
<field name="name">draft</field>
</record>
 “ Frist Validate activity ”
<record model="workflow.activity" id="act_validate1"> <!-- first_accepted -->
<field name="wkf_id" ref="wkf_holidays" />
<field name="name">first_validate</field>
<field name="kind">function</field>
<field name="action">holidays_first_validate()</field>
<field name="split_mode">OR</field>
</record>
 “Validate Activity ”
<record model="workflow.activity" id="act_validate"> <!-- accepted -->
<field name="wkf_id" ref="wkf_holidays" />
<field name="name">validate</field>
<field name="kind">function</field>
<field name="action">holidays_validate()</field>
</record>
Steps to modify hr.wkf.holidays
 Follow needs flow diagrams :
 To add another approval state :
Modify state field in _column partion in class hr.holidays in hr_holidays.py to
be:
'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm',
'To Approve'), ('refuse', 'Refused'), ('validate1', 'to dept_mang_apprv'),
('validate2', 'to head_mang_apprv'), ('validate', 'Approvedff')],'Status',
readonly=True, track_visibility='onchange',
 Add activity node In xml file for this state
<record model="workflow.activity" id="act_validate2">
<!-- second_accepted -->
<field name="wkf_id" ref="wkf_holidays" />
<field name="name">validate_second</field>
<field name="kind">function</field>
<field name="action">holidays_second_validate()</field>
<field name="split_mode">OR</field>
</record>
 Previuosly, define function holidays_second_validate() in hr_holidays.py file
def holidays_second_validate(self, cr, uid, ids, context=None):
self.check_holidays(cr, uid, ids, context=context)
obj_emp = self.pool.get('hr.employee')
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
manager = ids2 and ids2[0] or False
self.holidays_first_validate_notificate(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'state':'validate2', 'manager_id': manager})
 this node will be active based on transition defined:
<record model="workflow.transition" id="holiday_validate1_validate2">
<!-- 4. first_accepted -> second accepted (second_validate signal) --> <field
name="act_from" ref="act_validate1" />
<field name="act_to" ref="act_validate2" />
<field name="signal">second_validate</field>
<field name="condition">True</field>
<field name="group_id" ref="base.group_hr_user"/> </record>
OR this node will be active based on transition defined:
<record model="workflow.transition" id="holiday_confirm2validate2">
<!-- 2. submitted->dept_man_approval directlyif jobid==1[project manager]) -->
<field name="act_from" ref="act_confirm" />
<field name="act_to" ref="act_validate2" />
<field name="signal">validate</field>
<field name="condition">True</field>
<!--field name="condition">check_job_promag()</field-->
<field name="group_id" ref="base.group_hr_user"/>
</record>
 check_job_promag() is defined in object class in hr_holidays.py file and check
must return false or true to satisfy expression
def check_job_promag(self, cr, uid, ids, context=None):
#hol_ids=self.search(cr, uid,[('hol_job_id','=',1)])
for record in self.browse(cr, uid, hol_ids, context):
if record.hol_job_id==1:
return True
else:
return False
 Buttons of type workflow is defined in hr_holidays_view.xml
<button string="Validate" name="second_validate" states="validate1"
type="workflow" class="oe_highlight"/>
 To apply this workflow file on state change of module , must be called in
descriptor of module __openerp__.py file
Useful URLS regarding workflow
 https://doc.openerp.com/v6.1/developer/07_workflows.html/
 exception handling during workflow transitions:
https://answers.launchpad.net/openobject-server/+question/103295
 How to hide a workflow button based on user in openerp 7?
http://stackoverflow.com/questions/23568345/how-to-hide-a-workflow-button-based-on-user-in-
openerp-7
 How to add approval workflow OpenERP 7
http://stackoverflow.com/questions/16393415/how-to-add-approval-workflow-openerp-7?rq=1

More Related Content

What's hot

SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
John Jordan
 
FI & MM integration
FI & MM integrationFI & MM integration
FI & MM integration
sekhardatta
 
Kspi Execute Plan Price Calculation
Kspi Execute Plan Price CalculationKspi Execute Plan Price Calculation
Kspi Execute Plan Price Calculation
whocanbe1
 
Bank accounting-enduser-training-manual
Bank accounting-enduser-training-manualBank accounting-enduser-training-manual
Bank accounting-enduser-training-manual
roy_mithun
 
Parallel accounting in sap erp account approachversus ledger approachin new g...
Parallel accounting in sap erp account approachversus ledger approachin new g...Parallel accounting in sap erp account approachversus ledger approachin new g...
Parallel accounting in sap erp account approachversus ledger approachin new g...
Imran M Arab
 
SAP FICO GST Configurations .pdf
SAP FICO GST Configurations .pdfSAP FICO GST Configurations .pdf
SAP FICO GST Configurations .pdf
aNani7
 
mizing Fileds in FBL1N/FBL5N
mizing Fileds in FBL1N/FBL5Nmizing Fileds in FBL1N/FBL5N
mizing Fileds in FBL1N/FBL5N
Imran M Arab
 

What's hot (20)

New Asset Accounting in S4 HANA
New Asset Accounting in S4 HANANew Asset Accounting in S4 HANA
New Asset Accounting in S4 HANA
 
Validation and substitution -sap fi advance functions 2019
Validation and substitution -sap fi advance functions 2019Validation and substitution -sap fi advance functions 2019
Validation and substitution -sap fi advance functions 2019
 
SAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User GuideSAP FI AP: Configuration & End User Guide
SAP FI AP: Configuration & End User Guide
 
F.16 balance carry forward of gl accounts
F.16 balance carry forward of gl accountsF.16 balance carry forward of gl accounts
F.16 balance carry forward of gl accounts
 
SAP HANA and SAP Controlling – New Opportunities and New Challenges
SAP HANA and SAP Controlling – New Opportunities and New ChallengesSAP HANA and SAP Controlling – New Opportunities and New Challenges
SAP HANA and SAP Controlling – New Opportunities and New Challenges
 
SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
SAP Accounting powered by SAP HANA – Moving controlling and finance closer to...
 
FI & MM integration
FI & MM integrationFI & MM integration
FI & MM integration
 
Kspi Execute Plan Price Calculation
Kspi Execute Plan Price CalculationKspi Execute Plan Price Calculation
Kspi Execute Plan Price Calculation
 
Bank accounting-enduser-training-manual
Bank accounting-enduser-training-manualBank accounting-enduser-training-manual
Bank accounting-enduser-training-manual
 
Sap funds management online training
Sap funds management online trainingSap funds management online training
Sap funds management online training
 
Parallel accounting in sap erp account approachversus ledger approachin new g...
Parallel accounting in sap erp account approachversus ledger approachin new g...Parallel accounting in sap erp account approachversus ledger approachin new g...
Parallel accounting in sap erp account approachversus ledger approachin new g...
 
Sap fi interview question
Sap fi interview questionSap fi interview question
Sap fi interview question
 
Cash Management in SAP
Cash Management in SAPCash Management in SAP
Cash Management in SAP
 
Sap treasury and risk management
Sap treasury and risk managementSap treasury and risk management
Sap treasury and risk management
 
S4Finance
S4FinanceS4Finance
S4Finance
 
inter-company-reconciliation in SAP
inter-company-reconciliation in SAPinter-company-reconciliation in SAP
inter-company-reconciliation in SAP
 
FM presentation
FM  presentationFM  presentation
FM presentation
 
Implementação SAP S/4 HANA Finance
Implementação SAP S/4 HANA FinanceImplementação SAP S/4 HANA Finance
Implementação SAP S/4 HANA Finance
 
SAP FICO GST Configurations .pdf
SAP FICO GST Configurations .pdfSAP FICO GST Configurations .pdf
SAP FICO GST Configurations .pdf
 
mizing Fileds in FBL1N/FBL5N
mizing Fileds in FBL1N/FBL5Nmizing Fileds in FBL1N/FBL5N
mizing Fileds in FBL1N/FBL5N
 

Viewers also liked

OpenERP - Security in OpenERP
OpenERP - Security in OpenERPOpenERP - Security in OpenERP
OpenERP - Security in OpenERP
Odoo
 
Watson HR workflow
Watson HR workflowWatson HR workflow
Watson HR workflow
Hoang Le Vu
 
Odoo Accounting Roadmap
Odoo Accounting RoadmapOdoo Accounting Roadmap
Odoo Accounting Roadmap
Odoo
 

Viewers also liked (20)

OpenERP - Security in OpenERP
OpenERP - Security in OpenERPOpenERP - Security in OpenERP
OpenERP - Security in OpenERP
 
Odoo acces rights & groups
Odoo acces rights & groupsOdoo acces rights & groups
Odoo acces rights & groups
 
Odoo access rights
Odoo access rightsOdoo access rights
Odoo access rights
 
Watson HR workflow
Watson HR workflowWatson HR workflow
Watson HR workflow
 
Odoo report
Odoo reportOdoo report
Odoo report
 
Translation engine in odoo
Translation engine in odooTranslation engine in odoo
Translation engine in odoo
 
المعيار الدولي لوصف الوظائف (ISDF)
المعيار الدولي لوصف الوظائف (ISDF)المعيار الدولي لوصف الوظائف (ISDF)
المعيار الدولي لوصف الوظائف (ISDF)
 
Odoo accounting or financial module:
Odoo accounting or financial module:Odoo accounting or financial module:
Odoo accounting or financial module:
 
Odoo 8 tutorial part 2
Odoo 8 tutorial   part 2Odoo 8 tutorial   part 2
Odoo 8 tutorial part 2
 
Odoo 8 tutorial HR Module part 1
Odoo 8 tutorial   HR Module part 1Odoo 8 tutorial   HR Module part 1
Odoo 8 tutorial HR Module part 1
 
Odoo Accounting Roadmap
Odoo Accounting RoadmapOdoo Accounting Roadmap
Odoo Accounting Roadmap
 
Odoo (OpenERP) User Manual - Human Resource
Odoo (OpenERP) User Manual - Human Resource Odoo (OpenERP) User Manual - Human Resource
Odoo (OpenERP) User Manual - Human Resource
 
Odoo 8 tutorial accounting part 1
Odoo 8 tutorial   accounting part 1Odoo 8 tutorial   accounting part 1
Odoo 8 tutorial accounting part 1
 
The benefits of odoo
The benefits of odoo The benefits of odoo
The benefits of odoo
 
Service Management with Odoo/OpenERP - Opendays 2014
Service Management with Odoo/OpenERP - Opendays 2014Service Management with Odoo/OpenERP - Opendays 2014
Service Management with Odoo/OpenERP - Opendays 2014
 
Venture Design, Session I at General Assembly (GA SF)
Venture Design, Session I at General Assembly (GA SF)Venture Design, Session I at General Assembly (GA SF)
Venture Design, Session I at General Assembly (GA SF)
 
Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenv
 
Odoo Features | Opensource ERP | Odoo Ecommerce
Odoo Features | Opensource ERP | Odoo EcommerceOdoo Features | Opensource ERP | Odoo Ecommerce
Odoo Features | Opensource ERP | Odoo Ecommerce
 
Odoo introduction
Odoo introductionOdoo introduction
Odoo introduction
 
How to manage a service company with Odoo
How to manage a service company with OdooHow to manage a service company with Odoo
How to manage a service company with Odoo
 

Similar to Workflow functional concept on openerp7

Workflow demo
Workflow demoWorkflow demo
Workflow demo
Kamal Raj
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development
Ahmed Farag
 
Understanding and using life event checklists in oracle hrms r12
Understanding and using life event checklists in oracle hrms r12Understanding and using life event checklists in oracle hrms r12
Understanding and using life event checklists in oracle hrms r12
MuhammadAbubakar206124
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
Kranthi Kumar
 

Similar to Workflow functional concept on openerp7 (20)

]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
 
Workflow demo
Workflow demoWorkflow demo
Workflow demo
 
Salary advanceworkflow
Salary advanceworkflowSalary advanceworkflow
Salary advanceworkflow
 
Open erp 7 workflow
Open erp 7 workflowOpen erp 7 workflow
Open erp 7 workflow
 
BPM-1 Introduction to Advanced Workflows
BPM-1 Introduction to Advanced WorkflowsBPM-1 Introduction to Advanced Workflows
BPM-1 Introduction to Advanced Workflows
 
Technical training sample
Technical training sampleTechnical training sample
Technical training sample
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4
 
BPM-2 Introduction to Advanced Workflows
BPM-2 Introduction to Advanced WorkflowsBPM-2 Introduction to Advanced Workflows
BPM-2 Introduction to Advanced Workflows
 
Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development Dynamics ax 2012 workflow development
Dynamics ax 2012 workflow development
 
Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015Asynchronous Apex Salesforce World Tour Paris 2015
Asynchronous Apex Salesforce World Tour Paris 2015
 
Understanding and using life event checklists in oracle hrms r12
Understanding and using life event checklists in oracle hrms r12Understanding and using life event checklists in oracle hrms r12
Understanding and using life event checklists in oracle hrms r12
 
About work flow
About work flowAbout work flow
About work flow
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
 
AngularJS, More Than Directives !
AngularJS, More Than Directives !AngularJS, More Than Directives !
AngularJS, More Than Directives !
 
Discrete Job Closure Process
Discrete Job Closure ProcessDiscrete Job Closure Process
Discrete Job Closure Process
 
Difference between-action-support
Difference between-action-supportDifference between-action-support
Difference between-action-support
 
SAP workflow events
SAP workflow eventsSAP workflow events
SAP workflow events
 
Charm workflow for urgent changes while adding node
Charm workflow for urgent changes while adding nodeCharm workflow for urgent changes while adding node
Charm workflow for urgent changes while adding node
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Salesforce Summer 14 Release
Salesforce Summer 14 ReleaseSalesforce Summer 14 Release
Salesforce Summer 14 Release
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 

Recently uploaded (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

Workflow functional concept on openerp7

  • 2. Contents  What is workflow  Workflow Goals  Benefits of applying Workflow  Defining Workflow  Example holiday Request approval  How to modify the workflow  How to add approval workflow OpenERP 7  How to hide a workflow button based on user in OpenERP7
  • 3. The workflow system in OpenERP  is a very powerful mechanism that can describe the evolution of documents (model) in time.
  • 4. Goals of Workflow Mechanism  description of document evolution in time  automatic trigger of actions if some conditions are met  management of company roles and validation steps  management of interactions between the different objects/modules  graphical tool for visualization of document flows
  • 5. Advantage of Workflow in OpenERP7  Workflows are entirely customizable, they can be adapted to the flows and trade logic of almost any company. The workflow system makes OpenERP very flexible and allows it to easily support changing needs without having to program new functionality.
  • 6. Defining Workflow  Define the States of your object  The first step is to define the States your object can be in. We do this by adding a 'state' field to our object, in the _columns collection Example Hr.Holidays Model: 'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'dept_mang_apprv'), ('validate2', 'head_mang_apprv'), ('validate', 'Approvedff')], 'Status', readonly=True, track_visibility='onchange',  Define the State-change Handling Methods  Add additional methods to your object. These will be called by our workflow buttons.
  • 7. Defining Workflow  Creating your Workflow XML file File Path : serveraddonsmodule folder[module_name]_workflow.xml Workflow Header Record Activity Record Do action Activity Record Do action Transition Record: condition must executed to transfer These define the actions that must be executed when the workflow reaches a particular state. These define the possible transitions between workflow states
  • 8. Activity: These define the actions that must be executed when the workflow reaches a particular state.  “ Draft Activity “ <record model="workflow.activity" id="act_draft"> <!-- draft --> <field name="wkf_id" ref="wkf_holidays" /> <field name="flow_start">True</field> <field name="name">draft</field> </record>
  • 9. Activity Fields  flow_start Indicates if the node is a start node. When a new instance of a workflow is created, a workitem is activated for each activity marked as a flow_start.  flow_stop Indicates if the node is an ending node. When all the active workitems for a given instance come in the node marked by flow_stop, the workflow is finished.
  • 10.  kind Possible values: dummy: Do nothing (default). function: Execute the function selected by an action field. subflow: Execute a sub-workflow SUBFLOW_ID. The action method must return the ID of the concerned resource by the subflow. If the action returns False, the workitem disappears.  action The action indicates the method to execute when a workitem comes into this activity. The method must be defined in an object which belongs to this workflow
  • 11. Transition: are the conditions which need to be satisfied to move from one activity to the next.  The conditions are signals: button pressed in the interface[view.xml file for module ] # create button of type workflow signals are evaluated before the expression. If a signal is false, the expression will not be evaluated.
  • 12. Transition Fields act_from Source activity. When this activity is over, the condition is tested to determine if we can start the ACT_TO activity. act_to The destination activity. condition Expression to be satisfied if we want the transition done. signal When the operation of transition comes from a button pressed in the client form, signal tests the name of the pressed button. If signal is NULL, no button is necessary to validate this transition. Group id user to do this action must have privildge rules on this group , if not will displayed permission denied
  • 13. Holidays Request Approval mechanism  Manage employee leaves from the top menu "Human Resources". Employees can create leave requests that are validated by their manager and/or HR officers. note and/or based on chosen holiday type on holiday request  Once validated, they are visible in the employee's calendar.  HR officers can define leave types and allocate leaves to employees and employee categories
  • 14. Customized Holidays Request Approval mechanism  Based on job employement hierarchy :  How to add approval workflow OpenERP 7  How to control number of approvals based on employee job id department manager project manager project manager project manager developer1 developer2 Head Manager
  • 15. Fit your Needs draft state='to submit' (draft) confirm holidays_confirm() state=‘confirm' (to approve) validate holidays_validate() state='approvedff' (validate)) Validate_second holidays_second_validate() state='head_man_apprv' (validate2) First_validate holidays_first_validate() state='dept_man_apprv' (validate1) Approve ValidateValidate2 Refuse Holidays_refuse() State=‘refuse’ EmpJobid=developer Split mode = or Join mode = Xor [default]
  • 16.  “ Draft Activity “ <record model="workflow.activity" id="act_draft"> <!-- draft --> <field name="wkf_id" ref="wkf_holidays" /> <field name="flow_start">True</field> <field name="name">draft</field> </record>
  • 17.  “ Frist Validate activity ” <record model="workflow.activity" id="act_validate1"> <!-- first_accepted --> <field name="wkf_id" ref="wkf_holidays" /> <field name="name">first_validate</field> <field name="kind">function</field> <field name="action">holidays_first_validate()</field> <field name="split_mode">OR</field> </record>
  • 18.  “Validate Activity ” <record model="workflow.activity" id="act_validate"> <!-- accepted --> <field name="wkf_id" ref="wkf_holidays" /> <field name="name">validate</field> <field name="kind">function</field> <field name="action">holidays_validate()</field> </record>
  • 19. Steps to modify hr.wkf.holidays  Follow needs flow diagrams :  To add another approval state : Modify state field in _column partion in class hr.holidays in hr_holidays.py to be: 'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'to dept_mang_apprv'), ('validate2', 'to head_mang_apprv'), ('validate', 'Approvedff')],'Status', readonly=True, track_visibility='onchange',
  • 20.  Add activity node In xml file for this state <record model="workflow.activity" id="act_validate2"> <!-- second_accepted --> <field name="wkf_id" ref="wkf_holidays" /> <field name="name">validate_second</field> <field name="kind">function</field> <field name="action">holidays_second_validate()</field> <field name="split_mode">OR</field> </record>
  • 21.  Previuosly, define function holidays_second_validate() in hr_holidays.py file def holidays_second_validate(self, cr, uid, ids, context=None): self.check_holidays(cr, uid, ids, context=context) obj_emp = self.pool.get('hr.employee') ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)]) manager = ids2 and ids2[0] or False self.holidays_first_validate_notificate(cr, uid, ids, context=context) return self.write(cr, uid, ids, {'state':'validate2', 'manager_id': manager})
  • 22.  this node will be active based on transition defined: <record model="workflow.transition" id="holiday_validate1_validate2"> <!-- 4. first_accepted -> second accepted (second_validate signal) --> <field name="act_from" ref="act_validate1" /> <field name="act_to" ref="act_validate2" /> <field name="signal">second_validate</field> <field name="condition">True</field> <field name="group_id" ref="base.group_hr_user"/> </record>
  • 23. OR this node will be active based on transition defined: <record model="workflow.transition" id="holiday_confirm2validate2"> <!-- 2. submitted->dept_man_approval directlyif jobid==1[project manager]) --> <field name="act_from" ref="act_confirm" /> <field name="act_to" ref="act_validate2" /> <field name="signal">validate</field> <field name="condition">True</field> <!--field name="condition">check_job_promag()</field--> <field name="group_id" ref="base.group_hr_user"/> </record>
  • 24.  check_job_promag() is defined in object class in hr_holidays.py file and check must return false or true to satisfy expression def check_job_promag(self, cr, uid, ids, context=None): #hol_ids=self.search(cr, uid,[('hol_job_id','=',1)]) for record in self.browse(cr, uid, hol_ids, context): if record.hol_job_id==1: return True else: return False
  • 25.  Buttons of type workflow is defined in hr_holidays_view.xml <button string="Validate" name="second_validate" states="validate1" type="workflow" class="oe_highlight"/>  To apply this workflow file on state change of module , must be called in descriptor of module __openerp__.py file
  • 26. Useful URLS regarding workflow  https://doc.openerp.com/v6.1/developer/07_workflows.html/  exception handling during workflow transitions: https://answers.launchpad.net/openobject-server/+question/103295  How to hide a workflow button based on user in openerp 7? http://stackoverflow.com/questions/23568345/how-to-hide-a-workflow-button-based-on-user-in- openerp-7  How to add approval workflow OpenERP 7 http://stackoverflow.com/questions/16393415/how-to-add-approval-workflow-openerp-7?rq=1

Editor's Notes

  1. Note: The first two arguments wkf_id and name are mandatory per each activity.
  2. transition rules Workflow transition rules are rules that restrict some operations to certain groups. Those rules handle rights to go from one step to another one in the workflow. For example, you can limit the right to validate an invoice, i.e. going from a draft action to a validated action.
  3. // how to defines groups and security next session ISA
  4. Previously I add hol_job_id filled to hr. holidays refer to job id for employee