콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다

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.

관련 게시물 답글 화면 활동
1
10월 21
3083
1
4월 17
4283
2
7월 22
8496
3
1월 18
8605
0
9월 17
3820