here shows model class need add approval work flow.
class bpl_work_update(osv.osv): _name = "bpl.work.update" _description = "bpl work update" _columns = { 'bpl_company_id':fields.many2one('res.company', 'company', help='company'), 'ref_no': fields.char('reference no', size=10,), 'offered_date': fields.date('offered date'), # below lines related work update approve workflow (i refer hr.holidays model ) 'state': fields.selection([('draft', 'to submit'), ('cancel', 'cancelled'), ('confirm', 'to approve'), ('refuse', 'refused'), ('validate1', 'second approval'), ('validate', 'approved')], 'status', readonly=true, track_visibility='onchange'), 'user_id': fields.many2one('hr.employee', 'add records', invisible=false, readonly=true), 'manager_id': fields.many2one('hr.employee', 'first approval', invisible=false, readonly=true), } _defaults = { 'bpl_company_id':_default_company, 'offered_date':fields.date.context_today, 'state': 'draft', 'user_id': lambda obj, cr, uid, context: uid, } bpl_work_update() here shows view.xml file (i got lines here related work flow handling )
<header> <button string="approve" name="validate" states="confirm" type="workflow" groups="group_checkroll_user" class="oe_highlight" /> <button string="validate" name="second_validate" states="validate1" type="workflow" groups="group_checkroll_manager" class="oe_highlight" /> <button string="refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="group_checkroll_manager" /> <button string="reset new" name="set_to_draft" states="cancel,refuse" type="object" groups="group_checkroll_manager" /> <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}' /> </header> i have no idea how implement approval type work flow. refer hr.holidays model class unable got clear idea it. please me add level approve work order request. & please give me link refer regarding type of work flow creating..
now workflow buttons added form , shows correctly.but how handle those.? here screen 
you can refer link : http://doc.openerp.com/v6.1/developer/07_workflows.html
you need create new workflow.xml file need define first workflow object creating, different activities want show in workflow , different transitions between activities. first refer above link, understand , after go developing it.
you did right thing assigning type="workflow" in button. here, name of button working signal in transition. means if flow signal, go checking in transition , transition, trigger function of activity which, transition created.
Comments
Post a Comment