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

i want to open a window view, but without closing the current window, but this code close the curren window, someone help me ?

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" />

Or who know wwhich function called when we click on the button which appears in the right of the many2one fields ?

 

 

อวตาร
ละทิ้ง

Your code should open a new window (a smaller floating window) and preserve your current view... the 'target' and 'nodestroy' keywords are used for that (just as you did).

ผู้เขียน

No René my code didn't open in a new window, the button is in a pop up window

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

use 'target': 'current', it will open in next tab within a browser

อวตาร
ละทิ้ง
ผู้เขียน

i try to use target': 'current' but no changes

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

Hi kaisusr,

Try using 'target': 'blank' or 'target': '_blank' 

Regards,

Juan José - Ing ADHOC

 

อวตาร
ละทิ้ง

Dear Juan. This is not HTML so you can't use that.

ผู้เขียน

Dear juan, there is no changes, i want to open a new popup window from a button in a popup window without closing the current window.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ต.ค. 21
3076
1
เม.ย. 17
4272
2
ก.ค. 22
8494
3
ม.ค. 18
8589
0
ก.ย. 17
3817