mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-17 16:45:02 +00:00
refactor: brand js and allow quick entry (#42829)
* refactor: brand js and allow quick entry * refactor: brand js and allow quick entry --prettier * refactor: brand js and allow quick entry --prettier
This commit is contained in:
committed by
GitHub
parent
85641fd21c
commit
a1183f0165
@@ -3,22 +3,14 @@
|
||||
|
||||
frappe.ui.form.on("Brand", {
|
||||
setup: (frm) => {
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("default_warehouse").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("default_warehouse", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
filters: { company: row.company },
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("default_discount_account").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("default_discount_account", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
@@ -27,13 +19,9 @@ frappe.ui.form.on("Brand", {
|
||||
is_group: 0,
|
||||
},
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("buying_cost_center").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("buying_cost_center", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
@@ -41,25 +29,17 @@ frappe.ui.form.on("Brand", {
|
||||
company: row.company,
|
||||
},
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("expense_account").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("expense_account", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
query: "erpnext.controllers.queries.get_expense_account",
|
||||
filters: { company: row.company },
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("default_provisional_account").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("default_provisional_account", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
@@ -68,13 +48,9 @@ frappe.ui.form.on("Brand", {
|
||||
is_group: 0,
|
||||
},
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("selling_cost_center").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("selling_cost_center", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
filters: {
|
||||
@@ -82,18 +58,14 @@ frappe.ui.form.on("Brand", {
|
||||
company: row.company,
|
||||
},
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
frm.fields_dict["brand_defaults"].grid.get_field("income_account").get_query = function (
|
||||
doc,
|
||||
cdt,
|
||||
cdn
|
||||
) {
|
||||
frm.set_query("income_account", "brand_defaults", function (doc, cdt, cdn) {
|
||||
const row = locals[cdt][cdn];
|
||||
return {
|
||||
query: "erpnext.controllers.queries.get_income_account",
|
||||
filters: { company: row.company },
|
||||
};
|
||||
};
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -56,10 +56,11 @@
|
||||
"idx": 1,
|
||||
"image_field": "image",
|
||||
"links": [],
|
||||
"modified": "2024-08-19 17:47:35.753053",
|
||||
"modified": "2024-08-20 14:10:21.377962",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Brand",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
@@ -104,6 +105,7 @@
|
||||
"role": "Accounts User"
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
|
||||
Reference in New Issue
Block a user