title: OpenERP 7: Adding a button on a product view
body: <p>I am currently playing with openERP 7. I am doing some testing and I am building my first add-on.
  I want to add on every product view a "synchronize" button on a tab named "special" that has been created by another add-on (which works perfectly fine). My button displays successfully but when I click on it I obtain the following error:</p>
  
  <pre><code>AttributeError: 'product.product' object has no attribute 'custom_export'
  </code></pre>
  
  <p>If someone can explain me why do I have that error and how to fix it.</p>
  
  <p>My add-on folder name is: custom_synchronizer, I have 4 files inside.</p>
  
  <p>__init__.py </p>
  
  <pre><code>import product
  </code></pre>
  
  <p>__openerp.py__</p>
  
  <pre><code>{
      "name" : "Custom synchronizer",
      "version" : "0.1",
      "author" : "Ajite",
      "category" : "Product",
      "depends" : ["product"],
      "init_xml" : [],
      "demo_xml" : [],
      "update_xml" : ["product_view.xml"],
      "installable": True,
      "active": True
  }
  </code></pre>
  
  <p>product.py</p>
  
  <pre><code>from openerp.osv import orm, fields
  
  class product_product(osv.osv):
          _name = 'product.product'
          _columns = {}
  
          def custom_export(self, cr, uid, ids, context=None):
              f = open('/home/ajite/faytung.txt','w')
              f.write('Hi there !')
              f.close()
              return True
  product_product()
  </code></pre>
  
  <p>product_view.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;openerp&gt;
      &lt;data&gt;
          &lt;record id="product_normal_form_view" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;product.product.form&lt;/field&gt;
              &lt;field name="model"&gt;product.product&lt;/field&gt;
              &lt;field name="inherit_id" ref="special.product_normal_form_view"/&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;page name="special" position="inside"&gt;
                      &lt;button name="custom_export" string="Export" icon="gtk-execute" type="object"/&gt;
                  &lt;/page&gt;
              &lt;/field&gt;
          &lt;/record&gt;
      &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>