refactor!: change "is_subcontracted" field type from "Select" to "Check"
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index a925470..0920ca0 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -81,7 +81,7 @@
}
this.frm.set_query("item_code", "items", function() {
- if (me.frm.doc.is_subcontracted == "Yes") {
+ if (me.frm.doc.is_subcontracted) {
return{
query: "erpnext.controllers.queries.item_query",
filters:{ 'supplier': me.frm.doc.supplier, 'is_stock_item': 0 }
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index 23c2bd4..57cbe91 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -239,7 +239,7 @@
() => set_value('currency', currency),
() => set_value('price_list_currency', currency),
() => set_value('status', 'Draft'),
- () => set_value('is_subcontracted', 'No'),
+ () => set_value('is_subcontracted', 0),
() => {
if(this.frm.doc.company && !this.frm.doc.amended_from) {
this.frm.trigger("company");
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 8260426..eded165 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -483,8 +483,8 @@
if (frm.doc.doctype == 'Sales Order') {
filters = {"is_sales_item": 1};
} else if (frm.doc.doctype == 'Purchase Order') {
- if (frm.doc.is_subcontracted == "Yes") {
- filters = {"is_stock_item": 0};
+ if (frm.doc.is_subcontracted) {
+ filters = {"is_sub_contracted_item": 1};
} else {
filters = {"is_purchase_item": 1};
}