Odoo Help

Welcome!

This community 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.

0

How can I create a Popup Message?

By
Dr Obx
on 1/26/16, 8:28 AM 851 views

Guys, how can I do it, I would like to add a message when "if statement" is true or if certain value is reached.

At this moment I have a message but once i click on it to confirm/close popup window it stop/cancel whole operation.

Is there any way to do it and once i click "OK" it will continue/finish the operation ?

Something like 'confirm' but message depending on result of calculation for example.

[code]

if cust > full_stock:

raise Warning(('Attention!'),(My_error_msg_1))

if cust <= full_stock:

raise Warning(('Attention!'),(My_error_msg_2))

self.single(cr, uid, ids, context=context)

if cust > (2.5 * mwos):

raise Warning(('Attention!'),(My_error_msg_3))

self.single(cr, uid, ids, context=context)

[/code]

Any ideas ?

By the way, "POPUP Reminder"   ................. nah, do not like it.

0

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 1/27/16, 1:05 AM

Rob,

According to ur code, its working fine only.

But what Odoo actually does is it stops n rollback the whole transaction till the last commit if it encounters any expection/warning raised in the system.

So what you can do is, kepping executable line before raising exception and commit till that..,

if cust <= full_stock:

self.single(cr, uid, ids, context=context)

cr.commit() #it will commit all your transactions after your last commit,

raise Warning(('Attention!'),(My_error_msg_2))

this anyway is not preferred way, until and unless you are sure of using it, as it may bring inconsistency in DB if you use it at wrong place

Hope it Helps    

no mail, yes rob, n i vl be availble today

Pawan
on 1/27/16, 4:58 AM

Problem still not solved ;(

Dr Obx
on 2/12/16, 9:30 AM
-1
Neeraja Ragesh
On 1/26/16, 8:51 AM

Download and install pop-up reminder from Odoo apps

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/26/16, 8:28 AM
Seen: 851 times
Last updated: 1/27/16, 1:05 AM