mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
@@ -26,4 +26,6 @@ cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = fun
|
|||||||
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
|
cur_frm.cscript.invoice_no = function(doc, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
|
get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -69,7 +69,8 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
|
|||||||
filter: function(val, item, opts) {
|
filter: function(val, item, opts) {
|
||||||
return item.company == val || val == opts.default_value;
|
return item.company == val || val == opts.default_value;
|
||||||
}},
|
}},
|
||||||
{fieldtype:"Select", label: "Account", link:"Account", default_value: "Select Account...",
|
{fieldtype:"Select", label: "Account", link:"Account",
|
||||||
|
default_value: "Select Account...", chosen: true,
|
||||||
filter: function(val, item, opts, me) {
|
filter: function(val, item, opts, me) {
|
||||||
if(val == opts.default_value) {
|
if(val == opts.default_value) {
|
||||||
return true;
|
return true;
|
||||||
@@ -104,23 +105,42 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
|
|||||||
var $filter = me.filter_inputs.account;
|
var $filter = me.filter_inputs.account;
|
||||||
var company = $(this).val();
|
var company = $(this).val();
|
||||||
var default_company = me.filter_inputs.company.get(0).opts.default_value;
|
var default_company = me.filter_inputs.company.get(0).opts.default_value;
|
||||||
$filter.empty().add_options([$filter.get(0).opts.default_value].concat(
|
var default_account = $filter.get(0).opts.default_value;
|
||||||
|
var new_options = [default_account].concat(
|
||||||
$.map(wn.report_dump.data["Account"], function(ac) {
|
$.map(wn.report_dump.data["Account"], function(ac) {
|
||||||
return (company===default_company ||
|
return (company===default_company ||
|
||||||
accounts_by_company[company].indexOf(ac.name)!=-1) ?
|
accounts_by_company[company].indexOf(ac.name)!=-1) ?
|
||||||
ac.name : null;
|
ac.name : null;
|
||||||
})));
|
}));
|
||||||
|
var old_account = me.filter_inputs.account.val();
|
||||||
|
|
||||||
|
$filter.empty().add_options(new_options);
|
||||||
|
|
||||||
|
if((old_account != default_account) && new_options.indexOf(old_account)!=-1) {
|
||||||
|
$filter.val(old_account);
|
||||||
|
}
|
||||||
|
|
||||||
|
// chosen
|
||||||
|
// if(me.filter_inputs.company.get(0).opts.chosen) {
|
||||||
|
// $filter.trigger("liszt:updated");
|
||||||
|
// }
|
||||||
|
|
||||||
me.filter_inputs.refresh.click();
|
me.filter_inputs.refresh.click();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.filter_inputs.account && this.filter_inputs.account.change(function() {
|
this.filter_inputs.account && this.filter_inputs.account.change(function() {
|
||||||
me.filter_inputs.refresh.click();
|
me.filter_inputs.refresh.click();
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
init_filter_values: function() {
|
init_filter_values: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.filter_inputs.company.change();
|
this.filter_inputs.company.change();
|
||||||
},
|
},
|
||||||
|
apply_filters_from_route: function() {
|
||||||
|
this._super();
|
||||||
|
this.filter_inputs.company.change();
|
||||||
|
},
|
||||||
make_accounts_by_company: function() {
|
make_accounts_by_company: function() {
|
||||||
var accounts_by_company = {};
|
var accounts_by_company = {};
|
||||||
var me = this;
|
var me = this;
|
||||||
@@ -134,7 +154,7 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({
|
|||||||
account = this.account_by_name[account];
|
account = this.account_by_name[account];
|
||||||
item_account = this.account_by_name[item_account];
|
item_account = this.account_by_name[item_account];
|
||||||
|
|
||||||
return (item_account.lft >= account.lft && item_account.rgt <= account.rgt)
|
return ((item_account.lft >= account.lft) && (item_account.rgt <= account.rgt));
|
||||||
},
|
},
|
||||||
prepare_data: function() {
|
prepare_data: function() {
|
||||||
// add Opening, Closing, Totals rows
|
// add Opening, Closing, Totals rows
|
||||||
|
|||||||
@@ -90,8 +90,12 @@ def import_vouchers(common_values, data, start_idx, import_type):
|
|||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
try:
|
try:
|
||||||
|
jv = Document("Journal Voucher")
|
||||||
|
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
for i in xrange(len(data)):
|
for i in xrange(len(data)):
|
||||||
|
jv = Document("Journal Voucher")
|
||||||
|
|
||||||
d = data[i][0]
|
d = data[i][0]
|
||||||
if import_type == "Voucher Import: Two Accounts" and flt(d.get("amount")) == 0:
|
if import_type == "Voucher Import: Two Accounts" and flt(d.get("amount")) == 0:
|
||||||
webnotes.message_log = ["Amount not specified"]
|
webnotes.message_log = ["Amount not specified"]
|
||||||
@@ -112,7 +116,6 @@ def import_vouchers(common_values, data, start_idx, import_type):
|
|||||||
|
|
||||||
d.company = common_values.company
|
d.company = common_values.company
|
||||||
|
|
||||||
jv = Document("Journal Voucher")
|
|
||||||
map_fields(["voucher_type", "posting_date", "naming_series",
|
map_fields(["voucher_type", "posting_date", "naming_series",
|
||||||
"remarks:user_remark", "ref_number:cheque_no", "ref_date:cheque_date",
|
"remarks:user_remark", "ref_number:cheque_no", "ref_date:cheque_date",
|
||||||
"is_opening", "due_date", "company"], d, jv.fields)
|
"is_opening", "due_date", "company"], d, jv.fields)
|
||||||
|
|||||||
@@ -668,4 +668,6 @@ cur_frm.cscript.project_name = function(doc, cdt, cdn) {
|
|||||||
});
|
});
|
||||||
refresh_field(cur_frm.cscript.fname);
|
refresh_field(cur_frm.cscript.fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
@@ -32,7 +32,7 @@ erpnext.PurchaseAnalytics = wn.views.TreeGridReport.extend({
|
|||||||
parent: $(wrapper).find('.layout-main'),
|
parent: $(wrapper).find('.layout-main'),
|
||||||
appframe: wrapper.appframe,
|
appframe: wrapper.appframe,
|
||||||
doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company",
|
doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company",
|
||||||
"Purchase Invoice", "Purchase Invoice Item"],
|
"Purchase Invoice", "Purchase Invoice Item", "Fiscal Year"],
|
||||||
tree_grid: { show: true }
|
tree_grid: { show: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -40,10 +40,14 @@
|
|||||||
<li>Ace - code editor</li>
|
<li>Ace - code editor</li>
|
||||||
<li>Slick Grid - report grid</li>
|
<li>Slick Grid - report grid</li>
|
||||||
<li>jQPlot - graphs</li>
|
<li>jQPlot - graphs</li>
|
||||||
<li><a href="http://taitems.github.com/jQuery.Gantt/">JQuery.Gantt</a> - Gantt Chart</li>
|
<li><a href="http://taitems.github.com/jQuery.Gantt/" target="_blank">
|
||||||
|
JQuery.Gantt</a> - Gantt Chart</li>
|
||||||
<li>JSON2 - JSON builder, parser</li>
|
<li>JSON2 - JSON builder, parser</li>
|
||||||
<li>JSColor - color picker</li>
|
<li>JSColor - color picker</li>
|
||||||
<li><a href="https://github.com/dcneiner/Downloadify">Downloadify</a> - Export CSV files from the browser</li>
|
<li><a href="https://github.com/dcneiner/Downloadify" target="_blank">
|
||||||
|
Downloadify</a> - Export CSV files from the browser</li>
|
||||||
|
<li><a href="https://github.com/harvesthq/chosen" target="_blank">
|
||||||
|
Chosen</a> - a searchable select dropdown</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,22 @@
|
|||||||
erpnext.updates = [
|
erpnext.updates = [
|
||||||
|
["22nd November 2012", [
|
||||||
|
"Support Ticket: Compose a reply using Markdown",
|
||||||
|
"Supplier Link Field: Search by Supplier Name instead of ID",
|
||||||
|
"Supplier Link Field: Show only ID in auto-suggest \
|
||||||
|
if ID created using Supplier Name (as defined in Global Defaults)",
|
||||||
|
]],
|
||||||
|
["21st November 2012", [
|
||||||
|
"Tree Report: Added missing expand / collapse buttons.",
|
||||||
|
"List View: Do not show restricted records, as defined in Permission Manager.",
|
||||||
|
"Customer Link Field: Search by Customer Name instead of ID",
|
||||||
|
"Customer Link Field: Show only ID in auto-suggest \
|
||||||
|
if ID created using Customer Name (as defined in Global Defaults)",
|
||||||
|
"Letter Head: Fixed bug causing cursor position to reset in Content",
|
||||||
|
]],
|
||||||
|
["20th November 2012", [
|
||||||
|
"Auto-suggest: Show main label in bold",
|
||||||
|
"Data Import Tool: Fixed #Name error faced by MS Excel users in import template",
|
||||||
|
]],
|
||||||
["19th November 2012", [
|
["19th November 2012", [
|
||||||
"Sales Order: Bugfix - Shipping Address should be a Link field.",
|
"Sales Order: Bugfix - Shipping Address should be a Link field.",
|
||||||
"Link Fields: Search Profile, Employee and Lead using Full Names instead of ID.",
|
"Link Fields: Search Profile, Employee and Lead using Full Names instead of ID.",
|
||||||
|
|||||||
@@ -48,3 +48,8 @@ cur_frm.fields_dict['pp_details'].grid.get_field('bom_no').get_query = function(
|
|||||||
var d = locals[this.doctype][this.docname];
|
var d = locals[this.doctype][this.docname];
|
||||||
return 'SELECT DISTINCT `tabBOM`.`name` FROM `tabBOM` WHERE `tabBOM`.`item` = "' + d.item_code + '" AND `tabBOM`.`is_active` = "Yes" AND `tabBOM`.docstatus = 1 AND `tabBOM`.`name` like "%s" ORDER BY `tabBOM`.`name` LIMIT 50';
|
return 'SELECT DISTINCT `tabBOM`.`name` FROM `tabBOM` WHERE `tabBOM`.`item` = "' + d.item_code + '" AND `tabBOM`.`is_active` = "Yes" AND `tabBOM`.docstatus = 1 AND `tabBOM`.`name` like "%s" ORDER BY `tabBOM`.`name` LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.pp_so_details.grid.get_field("customer").get_query =
|
||||||
|
erpnext.utils.customer_query;
|
||||||
@@ -27,4 +27,6 @@ cur_frm.cscript.refresh = function(doc) {
|
|||||||
cur_frm.gantt_area.empty();
|
cur_frm.gantt_area.empty();
|
||||||
erpnext.show_task_gantt(cur_frm.gantt_area, cur_frm.docname);
|
erpnext.show_task_gantt(cur_frm.gantt_area, cur_frm.docname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -27,6 +27,8 @@ cur_frm.cscript.project = function(doc, cdt, cdn){
|
|||||||
if(doc.project) get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
if(doc.project) get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: remove these? field doesn't exist, but custom field could exist
|
||||||
cur_frm.fields_dict['customer'].get_query = function(doc,cdt,cdn){
|
cur_frm.fields_dict['customer'].get_query = function(doc,cdt,cdn){
|
||||||
var cond='';
|
var cond='';
|
||||||
if(doc.project) cond = 'ifnull(`tabProject`.customer, "") = `tabCustomer`.name AND ifnull(`tabProject`.name, "") = "'+doc.project+'" AND';
|
if(doc.project) cond = 'ifnull(`tabProject`.customer, "") = `tabCustomer`.name AND ifnull(`tabProject`.name, "") = "'+doc.project+'" AND';
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ class DocType:
|
|||||||
if cust:
|
if cust:
|
||||||
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
# TODO: Remove these? as the field customer doesn't exists
|
||||||
def get_customer_details(self):
|
def get_customer_details(self):
|
||||||
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
||||||
if cust:
|
if cust:
|
||||||
|
|||||||
@@ -44,4 +44,7 @@ cur_frm.fields_dict['timesheet_details'].grid.get_field("task_name").get_query =
|
|||||||
if(d.project_name) cond = 'ifnull(`tabTask`.project, "") = "'+d.project_name+'" AND';
|
if(d.project_name) cond = 'ifnull(`tabTask`.project, "") = "'+d.project_name+'" AND';
|
||||||
|
|
||||||
return repl('SELECT distinct `tabTask`.`subject` FROM `tabTask` WHERE %(cond)s `tabTask`.`subject` LIKE "%s" ORDER BY `tabTask`.`subject` ASC LIMIT 50', {cond:cond});
|
return repl('SELECT distinct `tabTask`.`subject` FROM `tabTask` WHERE %(cond)s `tabTask`.`subject` LIKE "%s" ORDER BY `tabTask`.`subject` ASC LIMIT 50', {cond:cond});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.timesheet_details.grid.get_field("customer_name").get_query =
|
||||||
|
erpnext.utils.customer_query;
|
||||||
@@ -105,7 +105,7 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
me.init_account(d);
|
me.init_account(d);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.set_indent();
|
this.set_indent();
|
||||||
this.prepare_balances();
|
this.prepare_balances();
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ erpnext.utils.profile_query = function() {
|
|||||||
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
|
from `tabProfile` where ifnull(enabled, 0)=1 and docstatus < 2 and \
|
||||||
name not in ('Administrator', 'Guest') and (%(key)s like \"%s\" or \
|
name not in ('Administrator', 'Guest') and (%(key)s like \"%s\" or \
|
||||||
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
|
concat_ws(' ', first_name, middle_name, last_name) like \"%%%s\") \
|
||||||
order by name asc limit 50";
|
order by \
|
||||||
|
case when name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when concat_ws(' ', first_name, middle_name, last_name) like \"%s%%\" \
|
||||||
|
then 0 else 1 end, \
|
||||||
|
name asc limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
// searches for active employees
|
// searches for active employees
|
||||||
@@ -30,7 +34,10 @@ erpnext.utils.employee_query = function() {
|
|||||||
return "select name, employee_name from `tabEmployee` \
|
return "select name, employee_name from `tabEmployee` \
|
||||||
where status = 'Active' and docstatus < 2 and \
|
where status = 'Active' and docstatus < 2 and \
|
||||||
(%(key)s like \"%s\" or employee_name like \"%%%s\") \
|
(%(key)s like \"%s\" or employee_name like \"%%%s\") \
|
||||||
order by name asc limit 50";
|
order by \
|
||||||
|
case when name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when employee_name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
name limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
// searches for leads which are not converted
|
// searches for leads which are not converted
|
||||||
@@ -38,5 +45,41 @@ erpnext.utils.lead_query = function() {
|
|||||||
return "select name, lead_name, company_name from `tabLead` \
|
return "select name, lead_name, company_name from `tabLead` \
|
||||||
where docstatus < 2 and ifnull(status, '') != 'Converted' and \
|
where docstatus < 2 and ifnull(status, '') != 'Converted' and \
|
||||||
(%(key)s like \"%s\" or lead_name like \"%%%s\" or company_name like \"%%%s\") \
|
(%(key)s like \"%s\" or lead_name like \"%%%s\" or company_name like \"%%%s\") \
|
||||||
order by lead_name asc limit 50";
|
order by \
|
||||||
|
case when name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when lead_name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when company_name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
lead_name asc limit 50";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// searches for customer
|
||||||
|
erpnext.utils.customer_query = function() {
|
||||||
|
if(sys_defaults.cust_master_name == "Customer Name") {
|
||||||
|
var fields = ["name", "customer_group", "country", "territory"];
|
||||||
|
} else {
|
||||||
|
var fields = ["name", "customer_name", "customer_group", "country", "territory"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return "select " + fields.join(", ") + " from `tabCustomer` where docstatus < 2 and \
|
||||||
|
(%(key)s like \"%s\" or customer_name like \"%%%s\") \
|
||||||
|
order by \
|
||||||
|
case when name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when customer_name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
name, customer_name limit 50";
|
||||||
|
};
|
||||||
|
|
||||||
|
// searches for supplier
|
||||||
|
erpnext.utils.supplier_query = function() {
|
||||||
|
if(sys_defaults.supp_master_name == "Supplier Name") {
|
||||||
|
var fields = ["name", "supplier_type"];
|
||||||
|
} else {
|
||||||
|
var fields = ["name", "supplier_name", "supplier_type"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return "select " + fields.join(", ") + " from `tabSupplier` where docstatus < 2 and \
|
||||||
|
(%(key)s like \"%s\" or supplier_name like \"%%%s\") \
|
||||||
|
order by \
|
||||||
|
case when name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
case when supplier_name like \"%s%%\" then 0 else 1 end, \
|
||||||
|
name, supplier_name limit 50";
|
||||||
|
};
|
||||||
@@ -83,3 +83,4 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
|||||||
return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE customer = "'+ doc.customer +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE customer = "'+ doc.customer +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -148,4 +148,6 @@ cur_frm.cscript['Create Opportunity'] = function(){
|
|||||||
//get query select Territory
|
//get query select Territory
|
||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
# These values are common in all dictionaries
|
# These values are common in all dictionaries
|
||||||
{
|
{
|
||||||
u'creation': '2012-08-08 10:41:31',
|
u'creation': '2012-11-19 12:06:56',
|
||||||
u'docstatus': 0,
|
u'docstatus': 0,
|
||||||
u'modified': '2012-11-16 12:26:14',
|
u'modified': '2012-11-21 17:12:54',
|
||||||
u'modified_by': u'Administrator',
|
u'modified_by': u'Administrator',
|
||||||
u'owner': u'Administrator'
|
u'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
@@ -40,12 +40,14 @@
|
|||||||
|
|
||||||
# These values are common for all DocPerm
|
# These values are common for all DocPerm
|
||||||
{
|
{
|
||||||
|
'amend': 0,
|
||||||
u'doctype': u'DocPerm',
|
u'doctype': u'DocPerm',
|
||||||
u'name': u'__common__',
|
u'name': u'__common__',
|
||||||
'parent': u'Lead',
|
'parent': u'Lead',
|
||||||
'parentfield': u'permissions',
|
'parentfield': u'permissions',
|
||||||
'parenttype': u'DocType',
|
'parenttype': u'DocType',
|
||||||
'read': 1
|
'read': 1,
|
||||||
|
'submit': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Lead
|
# DocType, Lead
|
||||||
@@ -146,7 +148,7 @@
|
|||||||
{
|
{
|
||||||
'colour': u'White:FFF',
|
'colour': u'White:FFF',
|
||||||
'depends_on': u"eval:doc.source == 'Existing Customer'",
|
'depends_on': u"eval:doc.source == 'Existing Customer'",
|
||||||
'description': u'Source of th',
|
'description': u'Source of the Lead',
|
||||||
u'doctype': u'DocField',
|
u'doctype': u'DocField',
|
||||||
'fieldname': u'customer',
|
'fieldname': u'customer',
|
||||||
'fieldtype': u'Link',
|
'fieldtype': u'Link',
|
||||||
@@ -626,77 +628,81 @@
|
|||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
|
'cancel': 0,
|
||||||
|
'create': 0,
|
||||||
|
u'doctype': u'DocPerm',
|
||||||
|
'permlevel': 1,
|
||||||
|
'role': u'All',
|
||||||
|
'write': 0
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'cancel': 0,
|
||||||
'create': 1,
|
'create': 1,
|
||||||
u'doctype': u'DocPerm',
|
u'doctype': u'DocPerm',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Guest',
|
'role': u'Sales User',
|
||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
|
||||||
'create': 0,
|
|
||||||
u'doctype': u'DocPerm',
|
|
||||||
'permlevel': 1,
|
|
||||||
'role': u'Sales User',
|
|
||||||
'submit': 0,
|
|
||||||
'write': 0
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
|
||||||
'create': 0,
|
|
||||||
u'doctype': u'DocPerm',
|
|
||||||
'permlevel': 1,
|
|
||||||
'role': u'Sales Manager',
|
|
||||||
'submit': 0,
|
|
||||||
'write': 0
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
'amend': 0,
|
|
||||||
'cancel': 1,
|
'cancel': 1,
|
||||||
'create': 1,
|
'create': 1,
|
||||||
u'doctype': u'DocPerm',
|
u'doctype': u'DocPerm',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'Sales Manager',
|
'role': u'Sales Manager',
|
||||||
'submit': 0,
|
|
||||||
'write': 1
|
'write': 1
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocPerm
|
# DocPerm
|
||||||
{
|
{
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
|
||||||
'create': 1,
|
|
||||||
u'doctype': u'DocPerm',
|
|
||||||
'permlevel': 0,
|
|
||||||
'role': u'Sales User',
|
|
||||||
'submit': 0,
|
|
||||||
'write': 1
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
u'doctype': u'DocPerm',
|
|
||||||
'permlevel': 1,
|
|
||||||
'role': u'All'
|
|
||||||
},
|
|
||||||
|
|
||||||
# DocPerm
|
|
||||||
{
|
|
||||||
'amend': 0,
|
|
||||||
'cancel': 0,
|
'cancel': 0,
|
||||||
'create': 1,
|
'create': 1,
|
||||||
u'doctype': u'DocPerm',
|
u'doctype': u'DocPerm',
|
||||||
'permlevel': 0,
|
'permlevel': 0,
|
||||||
'role': u'System Manager',
|
'role': u'System Manager',
|
||||||
'submit': 0,
|
'write': 1
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'cancel': 0,
|
||||||
|
'create': 0,
|
||||||
|
u'doctype': u'DocPerm',
|
||||||
|
'permlevel': 1,
|
||||||
|
'role': u'Sales Manager',
|
||||||
|
'write': 0
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'cancel': 0,
|
||||||
|
'create': 0,
|
||||||
|
u'doctype': u'DocPerm',
|
||||||
|
'permlevel': 1,
|
||||||
|
'role': u'Sales User',
|
||||||
|
'write': 0
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'cancel': 0,
|
||||||
|
'create': 1,
|
||||||
|
u'doctype': u'DocPerm',
|
||||||
|
'permlevel': 0,
|
||||||
|
'role': u'System Manager',
|
||||||
|
'write': 1
|
||||||
|
},
|
||||||
|
|
||||||
|
# DocPerm
|
||||||
|
{
|
||||||
|
'cancel': 0,
|
||||||
|
'create': 1,
|
||||||
|
u'doctype': u'DocPerm',
|
||||||
|
'permlevel': 0,
|
||||||
|
'role': u'Guest',
|
||||||
'write': 1
|
'write': 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -210,4 +210,6 @@ cur_frm.cscript['Declare Opportunity Lost'] = function(){
|
|||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';}
|
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';}
|
||||||
|
|
||||||
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
cur_frm.fields_dict.lead.get_query = erpnext.utils.lead_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -857,3 +857,5 @@ cur_frm.cscript.validate_items = function(doc) {
|
|||||||
validated = false;
|
validated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -18,3 +18,5 @@
|
|||||||
// =====================================================================
|
// =====================================================================
|
||||||
cur_frm.add_fetch('customer','customer_name','customer_name');
|
cur_frm.add_fetch('customer','customer_name','customer_name');
|
||||||
cur_frm.add_fetch('customer','address','customer_address');
|
cur_frm.add_fetch('customer','address','customer_address');
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -273,7 +273,7 @@ class DocType:
|
|||||||
self.exc_list = []
|
self.exc_list = []
|
||||||
for sle in sll:
|
for sle in sll:
|
||||||
# block if stock level goes negative on any date
|
# block if stock level goes negative on any date
|
||||||
if val_method != 'Moving Average' or flt(allow_negative_stock) == 0:
|
if (val_method != 'Moving Average') or (cint(allow_negative_stock) == 0):
|
||||||
if self.validate_negative_stock(cqty, sle):
|
if self.validate_negative_stock(cqty, sle):
|
||||||
cqty += sle['actual_qty']
|
cqty += sle['actual_qty']
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -332,4 +332,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
|||||||
doctype: 'Delivery Note'
|
doctype: 'Delivery Note'
|
||||||
}
|
}
|
||||||
cur_frm.cscript.notify(doc, args);
|
cur_frm.cscript.notify(doc, args);
|
||||||
}
|
}
|
||||||
@@ -141,4 +141,10 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){
|
|||||||
cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){
|
cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){
|
||||||
locals[cdt][cdn].ref_currency = sys_defaults.currency;
|
locals[cdt][cdn].ref_currency = sys_defaults.currency;
|
||||||
refresh_field('ref_currency',cdn,'ref_rate_details');
|
refresh_field('ref_currency',cdn,'ref_rate_details');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query =
|
||||||
|
erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query =
|
||||||
|
erpnext.utils.supplier_query;
|
||||||
@@ -67,4 +67,8 @@ cur_frm.fields_dict['item_code'].get_query = function(doc,cdt,cdn) {
|
|||||||
WHERE `tabItem`.`docstatus`!= 2 AND ifnull(`tabItem`.`has_serial_no`, "No") = "Yes" \
|
WHERE `tabItem`.`docstatus`!= 2 AND ifnull(`tabItem`.`has_serial_no`, "No") = "Yes" \
|
||||||
AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") \
|
AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") \
|
||||||
AND `tabItem`.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` ASC LIMIT 50';
|
AND `tabItem`.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
@@ -230,3 +230,7 @@ cur_frm.cscript.validate_items = function(doc) {
|
|||||||
validated = false;
|
validated = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
@@ -136,4 +136,8 @@ cur_frm.cscript.contact = function(doc, dt, dn) {
|
|||||||
cur_frm.cscript.hide_dialog = function() {
|
cur_frm.cscript.hide_dialog = function() {
|
||||||
if(cur_frm.communication_list)
|
if(cur_frm.communication_list)
|
||||||
cur_frm.communication_list.run();
|
cur_frm.communication_list.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
@@ -144,3 +144,5 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
|||||||
WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 \
|
WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 \
|
||||||
AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -131,3 +131,5 @@ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
|
|||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -114,3 +114,5 @@ cur_frm.fields_dict['maintenance_schedule'].get_query = function(doc) {
|
|||||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -189,4 +189,6 @@ EmailMessage = function(parent, args, list, idx) {
|
|||||||
this.make();
|
this.make();
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict.allocated_to.get_query = erpnext.utils.profile_query;
|
cur_frm.fields_dict.allocated_to.get_query = erpnext.utils.profile_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
@@ -36,16 +36,19 @@ class DocType(TransactionBase):
|
|||||||
if not self.doc.new_response:
|
if not self.doc.new_response:
|
||||||
webnotes.msgprint("Please write something as a response", raise_exception=1)
|
webnotes.msgprint("Please write something as a response", raise_exception=1)
|
||||||
|
|
||||||
|
import markdown2
|
||||||
|
self.doc.new_response = markdown2.markdown(self.doc.new_response)
|
||||||
|
|
||||||
subject = '[' + self.doc.name + '] ' + (self.doc.subject or 'No Subject Specified')
|
subject = '[' + self.doc.name + '] ' + (self.doc.subject or 'No Subject Specified')
|
||||||
|
|
||||||
response = self.doc.new_response + '\n\n[Please do not change the subject while responding.]'
|
response = self.doc.new_response + '<p>[Please do not change the subject while responding.]</p>'
|
||||||
|
|
||||||
# add last response to new response
|
# add last response to new response
|
||||||
response += self.last_response()
|
response += self.last_response()
|
||||||
|
|
||||||
signature = webnotes.conn.get_value('Email Settings',None,'support_signature')
|
signature = webnotes.conn.get_value('Email Settings',None,'support_signature')
|
||||||
if signature:
|
if signature:
|
||||||
response += '\n\n' + signature
|
response += '<p>' + signature + '</p>'
|
||||||
|
|
||||||
from webnotes.utils.email_lib import sendmail
|
from webnotes.utils.email_lib import sendmail
|
||||||
|
|
||||||
@@ -56,7 +59,7 @@ class DocType(TransactionBase):
|
|||||||
msg=response)
|
msg=response)
|
||||||
|
|
||||||
self.doc.new_response = None
|
self.doc.new_response = None
|
||||||
webnotes.conn.set(self.doc,'status','Waiting for Customer')
|
webnotes.conn.set(self.doc, 'status', 'Waiting for Customer')
|
||||||
self.make_response_record(response)
|
self.make_response_record(response)
|
||||||
|
|
||||||
def last_response(self):
|
def last_response(self):
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||||
if(doc.customer) cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
|
cur_frm.add_fetch('customer', 'customer_name', 'customer_name');
|
||||||
if(doc.supplier) cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name');
|
cur_frm.add_fetch('supplier', 'supplier_name', 'supplier_name');
|
||||||
|
|
||||||
var route = wn.get_route();
|
var route = wn.get_route();
|
||||||
if(route[1]=='Supplier') {
|
if(route[1]=='Supplier') {
|
||||||
@@ -41,4 +41,6 @@ cur_frm.cscript.hide_dialog = function() {
|
|||||||
cur_frm.address_list.run();
|
cur_frm.address_list.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
@@ -42,4 +42,6 @@ cur_frm.cscript.hide_dialog = function() {
|
|||||||
cur_frm.contact_list.run();
|
cur_frm.contact_list.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||||
|
|
||||||
|
cur_frm.fields_dict.supplier.get_query = erpnext.utils.supplier_query;
|
||||||
Reference in New Issue
Block a user