Finally SOLVED! It takes me about a few days!!!

There are a few areas we need to take note especially in the
inheritance of another object to add field(s)

1. Make sure you add the correct module in the depends
    for my case , I suppose to add "purchase" module which
    I didn't.
there fore the correct one of my __init__.py is


{
   "name" : "Purchase Order Lines With Discounts",
   "author" : "Tiny",
   "version" : "1.0",
   "category" : "Generic Modules/Sales & Purchases",
   "depends" : ["purchase","base"],
   "demo_xml" : [],
   "update_xml" : ["purchase_discount_view.xml"],
   "active": False,
   "installable": True
} 


2. make sure you always delete the pyo. sometime I experienced
the py code was not compiled during my update.

3. my code after changed , the purchase_discount.py

import netsvc
from osv import fields, osv

class purchase_order_line(osv.osv):
    _inherit = "purchase.order.line"
    _columns = {
            'test': fields.char('TEST', 
size=30, help="Inherited field"),
    }
purchase_order_line() 


4. Not sure this step is required . (Anyway no harm to share)
Finally , I do not know will that help , where the way I am doing is
to modified the view of the module loader and allow create/edit of
the module , so what I did is to create the module with status
NOT INSTALLED first.

Then I make sure the folder in addon is same as the module I
manually create using the client.

5. issue --update=all command line.

there you go extra fields will be added to the purchase_discount
table.

HTH. Thanks.

kalmen




-------------------- m2f --------------------

--
http://www.openerp.com/forum/viewtopic.php?p=24082#24082

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to