瀏覽代碼

communcation date & doctype check timestamp if not deleted error

version-14
Rushabh Mehta 12 年之前
父節點
當前提交
170e6d523a
共有 2 個檔案被更改,包括 5 行新增3 行删除
  1. +2
    -3
      public/js/wn/views/communication.js
  2. +3
    -0
      webnotes/model/wrapper.py

+ 2
- 3
public/js/wn/views/communication.js 查看文件

@@ -10,10 +10,9 @@ wn.views.CommunicationList = Class.extend({
return; return;
} }
var sortfn = function (a, b) { return new Date(a.modified) > new Date(b.modified)
? -1 : 1}
var sortfn = function (a, b) { return (b > a) ? 1 : -1; }
this.list = this.list.sort(sortfn); this.list = this.list.sort(sortfn);
this.make(); this.make();
}, },
make: function() { make: function() {


+ 3
- 0
webnotes/model/wrapper.py 查看文件

@@ -118,6 +118,9 @@ class ModelWrapper:
SELECT modified FROM `tab%s` WHERE name="%s" for update""" SELECT modified FROM `tab%s` WHERE name="%s" for update"""
% (self.doc.doctype, self.doc.name)) % (self.doc.doctype, self.doc.name))


if not tmp:
webnotes.msgprint("""This record does not exist. Please refresh.""", raise_exception=1)

if tmp and str(tmp[0][0]) != str(self.doc.modified): if tmp and str(tmp[0][0]) != str(self.doc.modified):
webnotes.msgprint(""" webnotes.msgprint("""
Document has been modified after you have opened it. Document has been modified after you have opened it.


Loading…
取消
儲存