field renaming

This commit is contained in:
Nabin Hait 2014-12-26 11:41:15 +05:30
parent 4b8185db19
commit 79f091e2fe
13 changed files with 1169 additions and 1169 deletions

View File

@ -24,7 +24,7 @@ frappe.ui.form.on("Payment Tool", "onload", function(frm) {
}
});
frm.set_query("against_voucher_type", "against_vouchers", function() {
frm.set_query("against_voucher_type", "vouchers", function() {
return {
filters: {"name": ["in", ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Sales Order", "Purchase Order"]]}
};
@ -75,7 +75,7 @@ erpnext.payment_tool.check_mandatory_to_set_button = function(frm) {
frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
erpnext.payment_tool.check_mandatory_to_fetch(frm.doc);
frm.set_value("against_vouchers", []);
frm.set_value("vouchers", []);
return frappe.call({
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_outstanding_vouchers',
@ -93,16 +93,16 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
frm.fields_dict.get_outstanding_vouchers.$input.removeClass("btn-primary");
frm.fields_dict.make_journal_entry.$input.addClass("btn-primary");
frappe.model.clear_table(frm.doc, "against_vouchers");
frappe.model.clear_table(frm.doc, "vouchers");
$.each(r.message, function(i, d) {
var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "against_vouchers");
var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "vouchers");
invoice_detail.against_voucher_type = d.voucher_type;
invoice_detail.against_voucher_no = d.voucher_no;
invoice_detail.total_amount = d.invoice_amount;
invoice_detail.outstanding_amount = d.outstanding_amount;
});
}
refresh_field("against_vouchers");
refresh_field("vouchers");
erpnext.payment_tool.set_total_payment_amount(frm);
}
});
@ -114,7 +114,7 @@ frappe.ui.form.on("Payment Tool Detail", "against_voucher_type", function(frm) {
});
erpnext.payment_tool.validate_against_voucher = function(frm) {
$.each(frm.doc.against_vouchers || [], function(i, row) {
$.each(frm.doc.vouchers || [], function(i, row) {
if(frm.doc.party_type=="Customer"
&& !in_list(["Sales Order", "Sales Invoice", "Journal Entry"], row.against_voucher_type)) {
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", "");
@ -154,13 +154,13 @@ frappe.ui.form.on("Payment Tool Detail", "payment_amount", function(frm) {
erpnext.payment_tool.set_total_payment_amount(frm);
});
frappe.ui.form.on("Payment Tool Detail", "against_vouchers_remove", function(frm) {
frappe.ui.form.on("Payment Tool Detail", "vouchers_remove", function(frm) {
erpnext.payment_tool.set_total_payment_amount(frm);
});
erpnext.payment_tool.set_total_payment_amount = function(frm) {
var total_amount = 0.00;
$.each(frm.doc.against_vouchers || [], function(i, row) {
$.each(frm.doc.vouchers || [], function(i, row) {
if (row.payment_amount && (row.payment_amount <= row.outstanding_amount)) {
total_amount = total_amount + row.payment_amount;
} else {

View File

@ -1,361 +1,361 @@
{
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2014-07-23 15:12:27.746665",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"creation": "2014-07-23 15:12:27.746665",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
"fields": [
{
"fieldname": "sec_break1",
"fieldtype": "Section Break",
"label": "Party Details",
"fieldname": "sec_break1",
"fieldtype": "Section Break",
"label": "Party Details",
"permlevel": 0
},
},
{
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"permlevel": 0,
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company",
"permlevel": 0,
"reqd": 1
},
},
{
"allow_on_submit": 0,
"default": "Customer",
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Party Type",
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"allow_on_submit": 0,
"default": "Customer",
"fieldname": "party_type",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Party Type",
"no_copy": 0,
"options": "DocType",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Party",
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"allow_on_submit": 0,
"depends_on": "",
"fieldname": "party",
"fieldtype": "Dynamic Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Party",
"no_copy": 0,
"options": "party_type",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0
},
},
{
"fieldname": "party_account",
"fieldtype": "Link",
"hidden": 0,
"label": "Party Account",
"no_copy": 1,
"options": "Account",
"permlevel": 0,
"fieldname": "party_account",
"fieldtype": "Link",
"hidden": 0,
"label": "Party Account",
"no_copy": 1,
"options": "Account",
"permlevel": 0,
"read_only": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "received_or_paid",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Received Or Paid",
"no_copy": 0,
"options": "Received\nPaid",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "received_or_paid",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Received Or Paid",
"no_copy": 0,
"options": "Received\nPaid",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "get_outstanding_vouchers",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Outstanding Vouchers",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "get_outstanding_vouchers",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Outstanding Vouchers",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break 1",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "col_break1",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Column Break 1",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "payment_mode",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Mode",
"no_copy": 0,
"options": "Mode of Payment",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "payment_mode",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Mode",
"no_copy": 0,
"options": "Mode of Payment",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "payment_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Account",
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "payment_account",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Payment Account",
"no_copy": 0,
"options": "Account",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "reference_no",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference No",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "reference_no",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference No",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "reference_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Date",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "reference_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Reference Date",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "sec_break3",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Voucher",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "sec_break3",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Voucher",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"allow_on_submit": 0,
"fieldname": "against_vouchers",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Vouchers",
"no_copy": 0,
"options": "Payment Tool Detail",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "vouchers",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Against Vouchers",
"no_copy": 0,
"options": "Payment Tool Detail",
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"permlevel": 0,
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "section_break_19",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
},
{
"fieldname": "total_payment_amount",
"fieldtype": "Currency",
"label": "Total Payment Amount",
"permlevel": 0,
"fieldname": "total_payment_amount",
"fieldtype": "Currency",
"label": "Total Payment Amount",
"permlevel": 0,
"read_only": 1
},
},
{
"allow_on_submit": 0,
"fieldname": "make_journal_entry",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Make Journal Entry",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "make_journal_entry",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Make Journal Entry",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
},
},
{
"fieldname": "data_22",
"fieldtype": "Column Break",
"permlevel": 0,
"fieldname": "data_22",
"fieldtype": "Column Break",
"permlevel": 0,
"precision": ""
},
},
{
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "section_break_21",
"fieldtype": "Section Break",
"permlevel": 0,
"depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
"fieldname": "section_break_21",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
},
{
"allow_on_submit": 0,
"fieldname": "make_jv_help",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"allow_on_submit": 0,
"fieldname": "make_jv_help",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0
}
],
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "icon-magic",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2014-12-25 16:28:30.612640",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool",
"name_case": "",
"owner": "Administrator",
],
"hide_heading": 0,
"hide_toolbar": 1,
"icon": "icon-magic",
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
"issingle": 1,
"istable": 0,
"modified": "2014-12-26 16:28:30.612640",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 0,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts Manager",
"set_user_permissions": 0,
"submit": 0,
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 0,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts Manager",
"set_user_permissions": 0,
"submit": 0,
"write": 1
},
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 0,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts User",
"set_user_permissions": 0,
"submit": 0,
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
"email": 0,
"export": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 0,
"role": "Accounts User",
"set_user_permissions": 0,
"submit": 0,
"write": 1
}
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
],
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}
}

View File

@ -29,7 +29,7 @@ class PaymentTool(Document):
if not self.total_payment_amount:
frappe.throw(_("Please enter Payment Amount in atleast one row"))
for v in self.get("against_vouchers"):
for v in self.get("vouchers"):
if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}):
frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no,
v.against_voucher_type))

View File

@ -154,7 +154,7 @@ class TestPaymentTool(unittest.TestCase):
def check_jv_entries(self, paytool, outstanding_entries, expected_outstanding):
for e in outstanding_entries:
d1 = paytool.append("against_vouchers")
d1 = paytool.append("vouchers")
d1.against_voucher_type = e.get("voucher_type")
d1.against_voucher_no = e.get("voucher_no")
d1.total_amount = e.get("invoice_amount")

View File

@ -539,9 +539,9 @@
"permlevel": 0
},
{
"fieldname": "educational_qualifications",
"fieldname": "education",
"fieldtype": "Table",
"label": "Educational Qualifications",
"label": "Education",
"options": "Employee Education",
"permlevel": 0
},
@ -553,9 +553,9 @@
"permlevel": 0
},
{
"fieldname": "external_work_experiences",
"fieldname": "external_work_history",
"fieldtype": "Table",
"label": "External Work Experiences",
"label": "External Work History",
"options": "Employee External Work History",
"permlevel": 0
},
@ -567,9 +567,9 @@
"permlevel": 0
},
{
"fieldname": "internal_work_experiences",
"fieldname": "internal_work_history",
"fieldtype": "Table",
"label": "Internal Work Experiences",
"label": "Internal Work History",
"options": "Employee Internal Work History",
"permlevel": 0
},
@ -673,7 +673,7 @@
],
"icon": "icon-user",
"idx": 1,
"modified": "2014-12-24 15:28:06.576523",
"modified": "2014-12-26 11:12:57.631617",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee",

View File

@ -100,9 +100,9 @@ rename_map = {
],
"Employee": [
["employee_leave_approvers", "leave_approvers"],
# ["educational_qualification_details", "educational_qualifications"],
# ["previous_experience_details", "external_work_experiences"], work_history
# ["experience_in_company_details", "internal_work_experiences"], internal_work_history
["educational_qualification_details", "education"],
["previous_experience_details", "external_work_history"],
["experience_in_company_details", "internal_work_history"]
],
"Event": [
["event_individuals", "users"],
@ -124,8 +124,8 @@ rename_map = {
["item_variants", "variants"],
["item_reorder", "reorder_levels"],
["uom_conversion_details", "uoms"],
# ["item_supplier_details", "supplier_item_codes"],
# ["item_customer_details", "customer_item_codes"],
["item_supplier_details", "supplier_items"],
["item_customer_details", "customer_items"],
["item_tax", "taxes"],
["item_specification_details", "quality_parameters"],
["item_website_specifications", "website_specifications"]
@ -161,7 +161,7 @@ rename_map = {
["party_accounts", "accounts"]
],
"Payment Tool": [
# ["payment_tool_details", "against_vouchers"]
["payment_tool_details", "vouchers"]
],
"Production Planning Tool": [
["pp_so_details", "sales_orders"],
@ -185,7 +185,7 @@ rename_map = {
["sales_bom_items", "items"]
],
"SMS Settings": [
# ["static_parameter_details", "static_parameters"]
["static_parameter_details", "parameters"]
],
"Stock Entry": [
["mtn_details", "items"]
@ -203,7 +203,7 @@ rename_map = {
["time_log_batch_details", "time_logs"]
],
"Workflow": [
# ["workflow_document_states", "document_states"],
["workflow_document_states", "states"],
["workflow_transitions", "transitions"]
],
"Workstation": [

View File

@ -142,14 +142,14 @@ pscript.feature_dict = {
},
'fs_item_advanced': {
'Item': {'fields':['customer_item_codes']}
'Item': {'fields':['customer_items']}
},
'fs_sales_extras': {
'Address': {'fields':['sales_partner']},
'Contact': {'fields':['sales_partner']},
'Customer': {'fields':['sales_team']},
'Delivery Note': {'fields':['sales_team']},
'Item': {'fields':['customer_item_codes']},
'Item': {'fields':['customer_items']},
'Sales Invoice': {'fields':['sales_team']},
'Sales Order': {'fields':['sales_team']}
},

View File

@ -1,78 +1,78 @@
{
"allow_copy": 1,
"allow_email": 1,
"allow_print": 1,
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
"doctype": "DocType",
"allow_copy": 1,
"allow_email": 1,
"allow_print": 1,
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
"doctype": "DocType",
"fields": [
{
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0,
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0,
"width": "50%"
},
},
{
"description": "Eg. smsgateway.com/api/send_sms.cgi",
"fieldname": "sms_gateway_url",
"fieldtype": "Data",
"in_list_view": 1,
"label": "SMS Gateway URL",
"permlevel": 0,
"description": "Eg. smsgateway.com/api/send_sms.cgi",
"fieldname": "sms_gateway_url",
"fieldtype": "Data",
"in_list_view": 1,
"label": "SMS Gateway URL",
"permlevel": 0,
"reqd": 1
},
},
{
"description": "Enter url parameter for message",
"fieldname": "message_parameter",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Message Parameter",
"permlevel": 0,
"description": "Enter url parameter for message",
"fieldname": "message_parameter",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Message Parameter",
"permlevel": 0,
"reqd": 1
},
},
{
"description": "Enter url parameter for receiver nos",
"fieldname": "receiver_parameter",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Receiver Parameter",
"permlevel": 0,
"description": "Enter url parameter for receiver nos",
"fieldname": "receiver_parameter",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Receiver Parameter",
"permlevel": 0,
"reqd": 1
},
},
{
"fieldname": "static_parameters_section",
"fieldtype": "Column Break",
"permlevel": 0,
"fieldname": "static_parameters_section",
"fieldtype": "Column Break",
"permlevel": 0,
"width": "50%"
},
},
{
"description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
"fieldname": "static_parameters",
"fieldtype": "Table",
"label": "Static Parameters",
"options": "SMS Parameter",
"description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
"fieldname": "parameters",
"fieldtype": "Table",
"label": "Static Parameters",
"options": "SMS Parameter",
"permlevel": 0
}
],
"icon": "icon-cog",
"idx": 1,
"in_create": 0,
"issingle": 1,
"modified": "2014-12-24 16:42:57.956544",
"modified_by": "Administrator",
"module": "Setup",
"name": "SMS Settings",
"owner": "Administrator",
],
"icon": "icon-cog",
"idx": 1,
"in_create": 0,
"issingle": 1,
"modified": "2014-12-26 16:42:57.956544",
"modified_by": "Administrator",
"module": "Setup",
"name": "SMS Settings",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"permlevel": 0,
"read": 1,
"report": 0,
"role": "System Manager",
"submit": 0,
"create": 1,
"permlevel": 0,
"read": 1,
"report": 0,
"role": "System Manager",
"submit": 0,
"write": 1
}
],
],
"read_only": 0
}
}

View File

@ -71,7 +71,7 @@ def send_sms(receiver_list, msg, sender_name = ''):
def send_via_gateway(arg):
ss = frappe.get_doc('SMS Settings', 'SMS Settings')
args = {ss.message_parameter : arg.get('message')}
for d in ss.get("static_parameters"):
for d in ss.get("parameters"):
args[d.parameter] = d.value
resp = []

View File

@ -178,11 +178,11 @@ cur_frm.cscript.validate = function(doc, cdt, cdn){
cur_frm.cscript.weight_to_validate(doc, cdt, cdn);
}
cur_frm.fields_dict.customer_item_codes.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
cur_frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
return { query: "erpnext.controllers.queries.customer_query" }
}
cur_frm.fields_dict.supplier_item_codes.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
cur_frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
return { query: "erpnext.controllers.queries.supplier_query" }
}

File diff suppressed because it is too large Load Diff

View File

@ -302,7 +302,7 @@ class Item(WebsiteGenerator):
def fill_customer_code(self):
""" Append all the customer codes and insert into "customer_code" field of item table """
cust_code=[]
for d in self.get('customer_item_codes'):
for d in self.get('customer_items'):
cust_code.append(d.ref_code)
self.customer_code=','.join(cust_code)

View File

@ -251,10 +251,10 @@ def validate_conversion_rate(args, meta):
def get_party_item_code(args, item_doc, out):
if args.transaction_type == "selling":
customer_item_code = item_doc.get("customer_item_codes", {"customer_name": args.customer})
customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer})
out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None
else:
item_supplier = item_doc.get("supplier_item_codes", {"supplier": args.supplier})
item_supplier = item_doc.get("supplier_items", {"supplier": args.supplier})
out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None
def get_pos_settings_item_details(company, args, pos_settings=None):