Merge branch 'dev' of github.com:webnotes/wnframework into dev
This commit is contained in:
commit
bfc56dcd09
6 changed files with 15 additions and 8 deletions
|
|
@ -80,12 +80,12 @@ _f.Frm.prototype.check_doctype_conflict = function(docname) {
|
|||
if(this.doctype=='DocType' && docname=='DocType') {
|
||||
msgprint('Allowing DocType, DocType. Be careful!')
|
||||
} else if(this.doctype=='DocType') {
|
||||
if(wn.views.formview[docname]) {
|
||||
if (wn.views.formview[docname] || wn.pages['List/'+docname]) {
|
||||
msgprint("Cannot open DocType when its instance is open")
|
||||
throw 'doctype open conflict'
|
||||
}
|
||||
} else {
|
||||
if(wn.views.formview.DocType && wn.views.formview.DocType.frm.opendocs[this.doctype]) {
|
||||
if (wn.views.formview.DocType && wn.views.formview.DocType.frm.opendocs[this.doctype]) {
|
||||
msgprint("Cannot open instance when its DocType is open")
|
||||
throw 'doctype open conflict'
|
||||
}
|
||||
|
|
@ -542,11 +542,16 @@ _f.Frm.prototype.refresh = function(docname) {
|
|||
cur_frm = this;
|
||||
this.parent.cur_frm = this;
|
||||
}
|
||||
|
||||
|
||||
if(this.docname) { // document to show
|
||||
|
||||
// check permissions
|
||||
if(!this.check_doc_perm()) return;
|
||||
|
||||
// check if doctype is already open
|
||||
if (!this.opendocs[this.docname]) {
|
||||
this.check_doctype_conflict(this.docname);
|
||||
}
|
||||
|
||||
// set the doc
|
||||
this.doc = get_local(this.doctype, this.docname);
|
||||
|
|
@ -759,7 +764,8 @@ _f.Frm.prototype.refresh_dependency = function() {
|
|||
// ======================================================================================
|
||||
|
||||
_f.Frm.prototype.setnewdoc = function(docname) {
|
||||
this.check_doctype_conflict(docname);
|
||||
// moved this call to refresh function
|
||||
// this.check_doctype_conflict(docname);
|
||||
|
||||
// if loaded
|
||||
if(this.opendocs[docname]) { // already exists
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ wn.views.DocListView = wn.ui.Listing.extend({
|
|||
docstatus: this.can_submit ? $.map(this.$page.find('.show-docstatus :checked'),
|
||||
function(inp) { return $(inp).attr('data-docstatus') }) : [],
|
||||
order_by: this.listview.order_by || undefined,
|
||||
group_by: this.listview.group_by || undefined,
|
||||
}
|
||||
},
|
||||
add_delete_option: function() {
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ class _DocType:
|
|||
|
||||
_add_code(scrub(doc.name) + '.js', '__js')
|
||||
_add_code(scrub(doc.name) + '.css', '__css')
|
||||
_add_code('listview.js', '__listjs')
|
||||
_add_code('%s_list.js' % scrub(doc.name), '__listjs')
|
||||
_add_code('help.md', 'description')
|
||||
|
||||
# embed all require files
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ def get(arg=None):
|
|||
|
||||
if not data.get('order_by'):
|
||||
data['order_by'] = tables[0] + '.modified desc'
|
||||
|
||||
if len(tables) > 1:
|
||||
data['group_by'] = "group by " + tables[0] + ".name"
|
||||
|
||||
if data.get('group_by'):
|
||||
data['group_by'] = "group by " + data.get('group_by')
|
||||
else:
|
||||
data['group_by'] = ''
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue