python - how to add a button in custom openerp module -


hi having error while adding button of type action .i cannot view button . following vetclinic_view.xml

<record id="vetclinic_breed_action" model="ir.actions.act_window">          <field name="name">breed</field>          <field name="res_model">vetclinic.breed</field>          <button name="add_field" string="add field" type="object"  class="oe_highlight" />          <field name="view_type">form</field>          <field name="view_mode">tree,form</field>          <field name="help" type="html">                 <p class="oe_view_nocontent_create">click create record.</p>          </field> 

here vetclinic.py

class vetclinic_breed(osv.model): _name="vetclinic.breed" _columns={      'name':fields.char('name',size=32),               } def add_field(cr,self,uid,id): 

that may in vetclinic_view.xml file window action, not view. note model attribute of record element.

you need add button view, not action. window action responsible triggering view display isn't view.


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -