3
votes

I would like to show a popup upon the modification of a record. More like a custom verification dialog in which the user will input some extra data before the final saving.

My issue is that I cannot show a popup dialog with 'ir.actions.act_window'.

I try to return a dictionary as indicated by https://www.odoo.com/documentation/8.0/reference/actions.html

but it seems to be completely ignored. This is write method overriden:

def write(self, cr, uid, ids, vals, context=None):
    return_value = super(hr_holidays, self).write(cr, uid, ids, vals, context)
    print 'overriden write'
    view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'leave_request_configuration_page')])
    return {
            "type": "ir.actions.act_window",
            "res_model": "hr.holidays",
            "views": [[view_id, "form"]],
            "target": "new",
            }

Is there any chance to show a popup view upon clicking Save on a form?

1
Im not sure if you can do that, there is an option that is called "Confirm" often usually in wizards, but thats for buttons that you add. I will check if i can do something, any way, i recommend you to use the new api to overwrite: @api.multi def write(self, values): return super(Class, self).write(values) Cheers!dccdany

1 Answers

2
votes

AFAIK there's no such feature. It would be nice to have, since many ppl have this need, but requires quite some work, especially on JS side.

A workaround for this is to add a text field to the model and display it in the form only in view mode and only if valued. You can populate it via onchange, create and/or write.