mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
[minor] [fix] opportunity form, queries, stock uom replace utility
This commit is contained in:
@@ -14,15 +14,17 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
cur_frm.fields_dict['item_code'].get_query = function(doc) {
|
||||
return {
|
||||
query: "controllers.queries.item_std"
|
||||
}
|
||||
}
|
||||
|
||||
//==================== Get Items Stock UOM =====================================================
|
||||
cur_frm.cscript.item_code = function(doc,cdt,cdn) {
|
||||
if (doc.item_code) {
|
||||
get_server_fields('get_stock_uom', doc.item_code, '', doc, cdt, cdn, 1);
|
||||
}
|
||||
}
|
||||
$.extend(cur_frm.cscript, {
|
||||
onload: function() {
|
||||
cur_frm.set_query("item_code", erpnext.queries.item);
|
||||
},
|
||||
|
||||
item_code: function() {
|
||||
if(cur_frm.doc.item_code) {
|
||||
cur_frm.call({
|
||||
method: "get_stock_uom",
|
||||
args: { item_code: cur_frm.doc.item_code }
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -31,9 +31,6 @@ class DocType:
|
||||
def __init__(self, d, dl=[]):
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
def get_stock_uom(self, item_code):
|
||||
return {'current_stock_uom': cstr(webnotes.conn.get_value('Item', item_code, 'stock_uom'))}
|
||||
|
||||
def validate_mandatory(self):
|
||||
if not cstr(self.doc.item_code):
|
||||
msgprint("Please Enter an Item.")
|
||||
@@ -111,3 +108,8 @@ class DocType:
|
||||
self.update_bin()
|
||||
|
||||
get_obj("Item", self.doc.item_code).on_update()
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_stock_uom(item_code):
|
||||
return { 'current_stock_uom': cstr(webnotes.conn.get_value('Item', item_code, 'stock_uom')) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user