Hello communities, I work to add some warning messages (non blocking) in the unit sales as the selling price of a product changes. Any one tell me how can i display a warning message !! thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
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'}}
Thanks Alexander, I tried your example and it didn't work
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.
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
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
There is a module module called warning
in openerp.. Please check that module. it will be helpful for you.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
3
มี.ค. 19
|
3918 | ||
Custom Module: How to add messages?
แก้ไขแล้ว
|
|
8
เม.ย. 23
|
32296 | |
|
2
ธ.ค. 19
|
9265 | ||
|
0
พ.ย. 19
|
4383 | ||
Error on Warning in Odoo 12
แก้ไขแล้ว
|
|
1
ก.ค. 19
|
7098 |
Try this:
How to display confirmation display box: https://goo.gl/6P7aR1