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

Open a popup window from a popup window ?

By
kaisusr
on 10/6/14, 5:20 AM 1,393 views

Hello,

How to open a new popup window from a button in a popup window without closing the current window.

i used this code but it close the current popup window:

def button_article(self, cr, uid, ids, context=None):
      ctx = (context or {}).copy()
      ctx['article'] = self.browse(cr, uid, ids[0], context=context).product_id.id
      ctx['form_view_ref'] = 'itk_entrepot.itk_entrepot_article_maj'
      if ctx['article'] :
          return {
        'name':'Article',
        'view_type':'form',
        'view_mode':'form',
        'res_model':'product.product',
        'view_id':False,
        'target':'new',
        'type':'ir.actions.act_window',
        'domain':[('id','=',ctx['article'])],
        'context':ctx,
        'nodestroy':True,
        'res_id':ctx['article'],
            }
      else : return True

<button name="button_article"    string="Article" type="object" class="oe_highlight" icon="article" />

 

What is your current window? Is it a popup? If it's, I think you can't have more than two popup.

Ben Bernard
on 10/6/14, 5:29 AM

Just to clarify, it's not possible with your method (server side), cmiiw. But you can create new instance.web.Dialog object to show new pop-up from javascript.

Ben Bernard
on 10/6/14, 10:59 AM

Hi Benard, it'is possible to open a popup window from a popup window, for example in one2many field on edit, a link appear in the right of the field wnd he open a new popup window you can try it

kaisusr
on 10/6/14, 11:17 AM

Can you give specific example?

Ben Bernard
on 10/6/14, 11:45 AM

Create a popup window which contains a many2one field and on edit click on the link which appers in the right of the many2one field , you can sea tha two popup window appears and the firs popup window dosen't been closed

kaisusr
on 10/6/14, 12:06 PM
0
babu
On 10/6/14, 11:11 AM

Hi Kaisusr,

You can try this, I think it will help you
<button name="button_article"    string="Article" type="object" class="oe_highlight" icon="article" confirm="Do you want to confirm to close"/>

hi madhubabu, thanx for ur answer but this is not what i want to do

kaisusr
on 10/6/14, 11:18 AM

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

2 follower(s)

Stats

Asked: 10/6/14, 5:20 AM
Seen: 1393 times
Last updated: 3/16/15, 8:10 AM