소스 검색

[ADD] Esconder boton cunado editas

adrielso 7 년 전
부모
커밋
ed3c10b785
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      static/src/js/payslip_payments.js

+ 14 - 1
static/src/js/payslip_payments.js

@@ -16,12 +16,25 @@ openerp.eiru_payslip_payments = function(instance, local) {
 
         init: function(parent) {
             this._super(parent);
+            this.buttons = parent.$buttons;
         },
         start: function() {
             var self = this;
             this.$el.click(function(){
                 self.fectchInitial()
             });
+
+            self.buttons.click(function(e) {
+                /* E (Editar) */
+                if (e.target.accessKey === 'E')
+                    self.$el.css('display','none');
+                /* S (Guarrdar) */
+                if (e.target.accessKey === 'S')
+                    self.$el.css('display','flex');
+                /* D (Cancelar) */
+                if (e.target.accessKey === 'D')
+                    self.$el.css('display','flex');
+            });
         },
         updateId: function(id) {
             var self = this;
@@ -328,7 +341,7 @@ openerp.eiru_payslip_payments = function(instance, local) {
 
                 local.widgetInstance.appendTo(elemento);
                 local.widgetInstance.updateId(record.id);
-            }
+            },
         });
     }