Search code examples
workflowodoo-8parse-error

Odoo add action to workflow mrp.production gets parseError


Hello I want to add an action to the Manufacturing Orders (mrp.production), so after the "new" there is a step "measuring", which then comes between "new" and "ready to produce". I tried following code

mrp_new_workflows.xml:

<openerp>
<data>

<record id="prod_act_nametingen" model="workflow.activity">               
        <field name="name">nametingen</field>                        
        <field name="wkf_id" ref="mrp.production"/>   
        <field name="kind">function</field> 
        <field name="action">action_nametingen()</field> 
</record>
<record id="prod_trans_done_nametingen" model="workflow.transition">       
        <field name="act_from" ref="mrp.production.prod_act_done"/>               
        <field name="act_to" ref="prod_act_nametingen"/>
         <field name="signal">confirm_nametingen</field>                                                             
</record> 
</data>
</openerp>

But then I get following error: ParseError: "External ID not found in the system: mrp.production"


Solution

  • Try this

    instead of "mrp.production.prod_act_done" in ref give "mrp.prod_act_done"

    Change this line -> <field name="act_from" ref="mrp.production.prod_act_done"/>

    to-> <field name="act_from" ref="mrp.prod_act_done"/>

    When specifying reference you have to refer the folder name, not the object

    Hope this helps.