Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
27430 มุมมอง

In account_asset module when i click the confirm asset button it is show like a popup OK or Cancel, how can i achieve this, give me the suggestions plzzzzzzzzzzzz

Thanks in Advance.

อวตาร
ละทิ้ง

Hello, just add the attribute confirm="" in the xml : <button name="your_xml_act_window_name"  string="My Button"  confirm="Are you sure you wa/>

คำตอบที่ดีที่สุด

The return value of your button function should be a window action with target attribute 'new'.

XML:

<button name="your_button_function", string="My Button", type="object"/>

or

 <button name="your_xml_act_window_name", string="My Button"/>

If your button triggers a python function (the 1st case):

def your_button_function:
    return {
        'name': 'My Window',
        'domain': [],
        'res_model': 'my.model',
        'type': 'ir.actions.act_window',
        'view_mode': 'form',
        'view_type': 'form',
        'context': {},
        'target': 'new',
    }

Otherwise: Window Action

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello, just add the attribute confirm="" in the xml :

 

 <button name="your_xml_act_window_name"  string="My Button"  confirm="Are you sure you want to delete this stuff ???" />

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks Rene, Have a good day.

Once I click on the button, a popup must appear and ask me whether to proceed or not. Just like it is asking at the time of deleting the record (Do you want to delete the record.).

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I think this is what you are looking for: https://www.odoo.com/forum/Help-1/question/How-to-add-confirm-dialog-box-on-button-or-action--2054

อวตาร
ละทิ้ง