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
{
"name" : "Purchase Order Lines With Discounts",
"author" : "Tiny",
"version" : "1.0",
"category" : "Generic Modules/Sales & Purchases",
"depends" : ["base", "account", "stock"],
"demo_xml" : [],
"update_xml" : ["purchase_discount_view.xml"],
"active": False,
"installable": True
}
and I have my purchase_discount.py
from osv import fields
from osv import osv
class purchase_order_line(osv.osv):
_table = 'purchase_order_line'
_name = 'purchase.order.line'
_description = 'Purchase Order line'
_inherit = 'purchase.order.line'
_columns = {
'test': fields.char('TEST', size=34,
help="Inherited field"),
}
purchase_order_line()
and my purchase_discount_view.xml
- <terp>
- <data>
- <record model="ir.ui.view" id="view_purchase_form1">
<field
name="name">purchase.orderline.form.inherit</field>
<field name="model">purchase.order.line</field>
<field name="type">form</field>
<field name="inherit_id"
ref="purchase.purchase_order_line_form" />
- <field name="arch" type="xml">
- <field name="product_qty" position="after">
<field name="test" colspan="2" />
</field>
</field>
</record>
- <!--
Default purchase discount description
-->
- <record model="purchase.order.line" id="test">
<field name="name">(test)</field>
<field name="code">test</field>
</record>
</data>
</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