Skip to content

Commit

Permalink
fix(ux): set qty to 1 on row add
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Dec 15, 2023
1 parent 03a61cf commit aba586a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
frappe.ui.form.on(this.frm.doctype + " Item", {
items_add: function(frm, cdt, cdn) {
var item = frappe.get_doc(cdt, cdn);

if (!item.qty) item.qty = 1;

if (!item.warehouse && frm.doc.set_warehouse) {
item.warehouse = frm.doc.set_warehouse;
}
Expand Down

0 comments on commit aba586a

Please sign in to comment.