Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5701 Lượt xem

My actual requirement is : To move products from one location to another location, i am using the warehouse -> stock moves menu for this. I can move the stock to source to destination eventhough i dont have sufficient stock in source. My client asked me to show one confirmation to check.

I have a case like in     if (quantity on hand of source locatio < quantity required for move){ i want to show one confirmation box here like do you want to procedd or cancel with two buttons "confirm" and "cancel". if(confirm): make a move else: stay in draft state}. Can any one give small code for this?

Ảnh đại diện
Huỷ bỏ

Me too want this spec.. If u found please update the answer

Câu trả lời hay nhất

You can refer <button name="cancel_voucher" string="Cancel Voucher" type="object" confirm="Are you sure you want to unreconcile this record?"/> in account voucher module for confirmation.

But for catching the result its not possible. You can define a method for confirm. If use press confirm means your method will be triggered. Else cancel means nothing happens.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Try in xml file where you define a view an add a button with something like :

<button name="button_name" ... confirm="Some warnning text... "/>

When you press that button you will have a popup with confirmation message, and Continue / Cancel buttons... 
 

 

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you Bole, But this confirmation shows for every time. But my case is different.. i want to show confirmation only for particular case only..