2014-11-18 2 views

답변

0
(function() { 
    "use strict"; 
    openerp.web.form.AddAnItemList.include({ 
     pad_table_to : function() { 
      var self = this; 
      this._super.apply(this, arguments); 
      //for one2may field 
      self.$current.find('.oe_form_field_one2many_list_row_add a').text('Your Text'); 
      //for many2many field 
      self.$current.find('.oe_form_field_many2many_list_row_add a').text('Your Text'); 
     } 
    }); 
})(); 

풋 아웃을 통해 반영

var $cell = $('<td>', { 
     colspan: columns, 
     'class': this._add_row_class || '' 
    }).append(
     $('<a>', {href: '#'}).text(_t("Add an item")) 
      .mousedown(function() { 
       // FIXME: needs to be an official API somehow 
       if (self.view.editor.is_editing()) { 
        self.view.__ignore_blur = true; 
       } 
      }) 

을 "추가"를 위해 또는 새로운 JS 파일을 작성하는 방법 "항목을 추가" js 파일의 위 코드는 js 파일의 openerp 인스턴스에 액세스 할 수 있다고 가정합니다.이 파일이 도움이 되길 바랍니다. :)

+0

죄송합니다. Jigs가 작동하지 않아 기존 모듈에 새 js 파일을 추가하고 또한 __ope에 종속성을 추가합니다. nerp__.py, 주사위는 없습니다. –

+0

나는 코드 비트를 업데이트하고, 익명의 함수로 만들고, 이제는 작동해야한다. j에이 코드 만 있다고 가정 해 보자. – Jigs