Hi Anoop ,

Let me try 

1. I create a new folder = 'purchase_discount'
2. I create 2 new py , __init__.py and __terp__.py
    where __init__.py have 1 line

> import purchase_discount


   __terp__.py  code are as follow


from osv import fields
from osv import osv
import time
import netsvc

import ir
from mx import DateTime
import pooler
from tools import config

class purchase_order_line(osv.osv):
    _name = 'purchase.order.line'
    _inherit = 'purchase.order.line'
    _columns = {
        'discount': fields.float('Discount 
(%)', digits=(16,2)),
    }
purchase_order_line() 


and a python code , purchase_discount.py

from osv import fields
from osv import osv
import time
import netsvc

import ir
from mx import DateTime
import pooler
from tools import config

class purchase_order_line(osv.osv):
    _name = 'purchase.order.line'
    _inherit = 'purchase.order.line'
    _columns = {
        'discount': fields.float('Discount 
(%)', digits=(16,2)),
    }
purchase_order_line() 


3. I created the purchase_discount_view.xml with content
    
I created the the content of the xml 

<terp>
&nbsp; <data>
&nbsp; &nbsp; &nbsp; I copy and paste your advice...here!
&nbsp; </data>
</terp>


4. I then update the tinyerp .
however when I try to run the client -> purchase order  it threw 

> Traceback (most recent call last):
>   File "netsvc.pyo", line 200, in _dispatch
>   File "C:\Program Files\TinyERP 
> Server\addons\base_module_record.zip\base_module_record\base_module_record.py",
>  line 191, in execute
>   File "service\web_services.pyo", line 366, in execute
>   File "osv\osv.pyo", line 111, in execute
>   File "osv\osv.pyo", line 92, in execute_cr
>   File "osv\orm.pyo", line 1544, in fields_view_get
>   File "osv\orm.pyo", line 1409, in __view_look_dom_arch
> KeyError: u'discount'
> 


Can u help me ? 
Thanks.




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

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

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


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

Reply via email to