I'm using OpenERP V7,need some basic helps. Added a new icon in POLine ,When Click on this icon , need to display the popup screen for entering data.
Created new Xml,py file under Wizard in Purchase Module.
add.xml code:
<openerp>
<data>
<record id="add_slab_form" model="ir.ui.view">
<field name="name">Add Slab</field>
<field name="model">add.slab</field>
<field name="arch" type="xml">
<form string="Add Slab" version="7.0">
<group col="4" colspan="4">
<field name="block_no"/>
<field name="product_id"/>
<field name="slab_qty"/>
<field name="price"/>
<field name="other_charges"/>
</group>
<separator string="Slab Dimensions"/>
<group col="6" colspan="4">
<field name="length"/>
<field name="width"/>
<field name="uom"/>
<field name="sequence" invisible="1"/>
</group>
<footer>
<button name="add_slab_info" string="Add" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="add_slab_action" model="ir.actions.act_window">
<field name="name">Add Slab</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">add.slab</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="add_slab_form"/>
</record>
</data>
</openerp> Form view get installed and i cant see the action view.
Button Action Code called in purchase_view.xml file
<button name="%(add_slab_action)d" icon="gtk-add" string="Add Slab" type="action"/>
add.py
def add_slab_action(self, cr, uid, ids, context=None):
return {
'type': 'ir.actions.act_window',
'name': 'Add Slab',
'view_mode': 'form',
'view_type': 'form',
'res_model': 'add.slab',
'nodestroy': True,
'target':'new',
'context': context,
}
I got an error : ValueError: No such external ID currently defined in the system: purchase.add_slab_action
Button Action is not performing ,How do i resolve?