Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make workflow manipulations in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 150
    Comment on it

    Workflows can be moved along by sending them signals. Instead of using the top-level execute_kw, signals are sent using exec_workflow.
    For example code is like below.

    client = models.execute_kw(
        db, uid, password,
        'res.partner', 'search_read',
        [[('customer', '=', True)]],
        {'limit': 1, 'fields': [
            'property_account_receivable',
            'property_payment_term',
            'property_account_position']
        })[0]
    invoice_id = models.execute_kw(
        db, uid, password,
        'account.invoice', 'create', [{
            'partner_id': client['id'],
            'account_id': client['property_account_receivable'][0],
            'invoice_line': [(0, False, {'name': "AAA"})]
        }])
    
    models.exec_workflow(
        db, uid, password, 'account.invoice', 'invoice_open', invoice_id)
    
    

    Note- Signals are sent to a specific record, and possibly trigger a transition on the workflow instance associated with the record.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: