I'm working with the module products and stock of openerp. I have to update the products with an external database every time i enter a section that works with them. Currently i have a button to update, so the function is ready, i just need to find the right way to call the function either when i click on the menu item of products or when certain views are open. Is this possible? And which way is better?
Asked
Active
Viewed 582 times
1 Answers
-1
If you want to call a function when view renders, you can override fields_view_get
method of openerp.
here is the example to override fields_view_get
.
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
'''
Your code
'''
return super(CLASS_NAME, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)

Atul Arvind
- 16,054
- 6
- 50
- 58
-
thank you so much! i put this in my products and my sales classes and everything is updating perfectly. – uannaff Jul 16 '14 at 17:27