openerp-community team mailing list archive
-
openerp-community team
-
Mailing list archive
-
Message #00753
Re: how to access context in my own method/function?
-
To:
openerp-community@xxxxxxxxxxxxxxxxxxx
-
From:
Martin Herweg <m.herweg@xxxxxx>
-
Date:
Tue, 20 Dec 2011 22:25:47 +0100
-
In-reply-to:
<CANkQ1RDvjGKT98jfLO3D2EUAOqzZY2=P8S0NT28atfz41yPQKw@mail.gmail.com>
-
User-agent:
KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.2; i686; ; )
Thanks for your answer, Niels.
I now have my own fields_view_get and it is beeing executed (I see the output
of my print on cosole) and the return-dict "res" looks o.k. but the tree view
did not change.
def fields_view_get(self, cr, uid, view_id=None, view_type='tree',
context=None, toolbar=False, submenu=False):
res = super(pricelist_screen,self).fields_view_get(cr, uid, view_id,
view_type, context, toolbar=toolbar, submenu=submenu)
form = context['form']
qty1 = form['qty1']
res['fields']['qty1_test']['string']=`qty1`
print 'hallo'
print res
return res
_columns = {
'qty1_test' : fields.function(_calc_price, arg=1 , type = 'float',
method = True, string = 'placeholder'),
Follow ups
References