Hi ,

continue to test add fields , it seems that what I mentioned was not a
TOTALLY 100% CORRECT WAY !!!

Now the test method is circle around this environment:
1. Vista + openerp 4.2.2 (installer NOT SRC) + client 4.2.3
2. using the tinyerp-server.exe --update=ALL or
    using --update=<my_module_name> to execute update
3. always chk whether the updated information is been recorded into
    the modules loader database.

So I make sure that the modules loader has the "purchase_discount"
module , however when I click install it gave.

> 
> Thu, 11 Sep 2008 17:47:18 ERROR:web-services:Exception in call: Traceback 
> (most recent call last):
>   File "netsvc.pyo", line 200, in _dispatch
>   File "service\web_services.pyo", line 422, in execute
>   File "service\web_services.pyo", line 402, in _execute
>   File "wizard\__init__.pyo", line 160, in execute
>   File "wizard\__init__.pyo", line 75, in execute_cr
>   File "C:\Program Files\TinyERP 
> Server\addons\base\module\wizard\wizard_module_upgrade.py", line 80, in 
> _upgrade_module
>   File "pooler.pyo", line 64, in restart_pool
>   File "pooler.pyo", line 53, in get_db_and_pool
>   File "addons\__init__.pyo", line 274, in load_modules
>   File "addons\__init__.pyo", line 198, in load_module_graph
>   File "osv\osv.pyo", line 169, in instanciate
>   File "osv\osv.pyo", line 226, in createInstance
> AttributeError: 'NoneType' object has no attribute '_columns'
> 


and I have my __terp__.py

&#123;
&nbsp; &nbsp;"name" &#58; "Purchase Order Lines With Discounts",
&nbsp; &nbsp;"author" &#58; "Tiny",
&nbsp; &nbsp;"version" &#58; "1.0",
&nbsp; &nbsp;"category" &#58; "Generic Modules/Sales & Purchases",
&nbsp; &nbsp;"depends" &#58; &#91;"base", "account", "stock"&#93;,
&nbsp; &nbsp;"demo_xml" &#58; &#91;&#93;,
&nbsp; &nbsp;"update_xml" &#58; &#91;"purchase_discount_view.xml"&#93;,
&nbsp; &nbsp;"active"&#58; False,
&nbsp; &nbsp;"installable"&#58; True
&#125;


and I have my purchase_discount.py

from osv import fields
from osv import osv

class purchase_order_line&#40;osv.osv&#41;&#58;
&nbsp; &nbsp; _table = 'purchase_order_line'
&nbsp; &nbsp; _name = 'purchase.order.line'
&nbsp; &nbsp; _description = 'Purchase Order line'
&nbsp; &nbsp; _inherit = 'purchase.order.line'
&nbsp; &nbsp; _columns = &#123;
&nbsp; &nbsp; &nbsp; &nbsp; 'test'&#58; fields.char&#40;'TEST', size=34, 
help="Inherited field"&#41;,
&nbsp; &nbsp; &#125;
purchase_order_line&#40;&#41; 



and my purchase_discount_view.xml

- <terp>
- <data>
-&nbsp; &nbsp; &nbsp;<record model="ir.ui.view" id="view_purchase_form1">
&nbsp; &nbsp; &nbsp; &nbsp; <field 
name="name">purchase.orderline.form.inherit</field> 
&nbsp; &nbsp; &nbsp; &nbsp; <field name="model">purchase.order.line</field> 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<field name="type">form</field> 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<field name="inherit_id" 
ref="purchase.purchase_order_line_form" /> 
-&nbsp; &nbsp; &nbsp; &nbsp; <field name="arch" type="xml">
-&nbsp; &nbsp; &nbsp; &nbsp; <field name="product_qty" position="after">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<field name="test" colspan="2" /> 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</field>
&nbsp; &nbsp; &nbsp; &nbsp;</field>
&nbsp; </record>
- <!-- 
&nbsp; &nbsp;Default purchase discount description
&nbsp; --> 
- <record model="purchase.order.line" id="test">
&nbsp; <field name="name">&#40;test&#41;</field> 
&nbsp; <field name="code">test</field> 
&nbsp; </record>
&nbsp; </data>
&nbsp; </terp>



any one can tell me what is wrong with my inherited field ?
until now I have followed all instruction in wiki or forum but I CAN only
update the new fields by directly update the original code in the
purchase module . No luck until now where try to add new fields using
recommended method of inheritance.  If anyone have also
experience this , pls do give some advice . 

Thanks.

kalmen




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

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

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


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

Reply via email to