Odoo Help

2

2
3 Answers
3
Alexander Moldavia
6/8/13, 5:18 PM

Hi! You need to add on_change attribute in your field (xml file)

<field name="price" on_change="price_changed()"/>

and define function in your model:

def price_changed(self,cr,uid,ids,context=None):
    #you can do something here
    return {'value':{},'warning':{'title':'warning','message':'Your message'}}
2 Comments
abdelwahed chiheb Tunisia
6/8/13, 6:01 PM

Thanks Alexander, I tried your example and it didn't work

Alexander Moldavia
6/8/13, 6:30 PM

You can read about on_change event. https://doc.openerp.com/trunk/server/03_module_dev_03/#on-change

Perhaps, in your case, you need to do anything else.

7
Avatar

ClueLogics Technologies Pvt. Ltd. India

--ClueLogics Technologies Pvt. Ltd.--
6223
| 7 5 10
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd. India
6/10/13, 4:02 AM

hi yes

in in on change of product you can add the warning message

 def onchange_product(self,cr,uid,ids,context=None):
   #you can do something here
   return {'value':{},'warning':{'title':'warning','message':'Your message'}}

or you can exception message also

  raise osv.except_osv(_('warning'), _(' Your message'))

Thanks
Sandeep

1 Comment
Atul Kumar jain India
4/28/14, 10:23 AM

Hello i have two datetime fields that calculated diferenc both of them but sometimes i missed to enter date so it raise the error , but i want some custome message instead of error please help me

1
Avatar

Omal Bastin India

--Omal Bastin--

2168
| 7 7 10
Kochi, Kerala, India
--Omal Bastin--

Swiming deep into openERP/ODOO

Omal Bastin India
6/9/13, 3:10 PM

There is a module module called warning in openerp.. Please check that module. it will be helpful for you.

Ask a Question
Keep Informed
3 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now