added multiple item select and allow non purchase items in Material Request of type transfer
This commit is contained in:
parent
be99b1240c
commit
b6843f2087
@ -9,6 +9,10 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
|||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onload_post_render: function() {
|
||||||
|
cur_frm.get_field("entries").grid.set_multiple_add("account");
|
||||||
|
},
|
||||||
|
|
||||||
load_defaults: function() {
|
load_defaults: function() {
|
||||||
if(this.frm.doc.__islocal && this.frm.doc.company) {
|
if(this.frm.doc.__islocal && this.frm.doc.company) {
|
||||||
frappe.model.set_default_values(this.frm.doc);
|
frappe.model.set_default_values(this.frm.doc);
|
||||||
|
@ -94,6 +94,7 @@ class PurchaseCommon(BuyingController):
|
|||||||
frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
|
frappe.throw(_("Warehouse is mandatory for stock Item {0} in row {1}").format(d.item_code, d.idx))
|
||||||
|
|
||||||
# validate purchase item
|
# validate purchase item
|
||||||
|
if not (obj.doctype=="Material Request" and getattr(obj, "material_request_type", None)=="Transfer"):
|
||||||
if item[0][1] != 'Yes' and item[0][2] != 'Yes':
|
if item[0][1] != 'Yes' and item[0][2] != 'Yes':
|
||||||
frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
|
frappe.throw(_("{0} must be a Purchased or Sub-Contracted Item in row {1}").format(d.item_code, d.idx))
|
||||||
|
|
||||||
|
@ -41,6 +41,9 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
|||||||
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.is_pos) {
|
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.is_pos) {
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
}
|
}
|
||||||
|
if(frappe.meta.get_docfield(this.tname, "item_code")) {
|
||||||
|
cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function() {
|
||||||
|
@ -13,6 +13,10 @@ cur_frm.cscript.sales_team_fname = "sales_team";
|
|||||||
{% include 'utilities/doctype/sms_control/sms_control.js' %}
|
{% include 'utilities/doctype/sms_control/sms_control.js' %}
|
||||||
{% include 'accounts/doctype/sales_invoice/pos.js' %}
|
{% include 'accounts/doctype/sales_invoice/pos.js' %}
|
||||||
|
|
||||||
|
frappe.ui.form.on("Quotation", "onload_post_render", function(frm) {
|
||||||
|
frm.get_field("quotation_details").grid.set_multiple_add("item_code");
|
||||||
|
});
|
||||||
|
|
||||||
erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
||||||
onload: function(doc, dt, dn) {
|
onload: function(doc, dt, dn) {
|
||||||
var me = this;
|
var me = this;
|
||||||
@ -21,6 +25,7 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({
|
|||||||
doc.quotation_to = "Customer";
|
doc.quotation_to = "Customer";
|
||||||
else if(doc.lead && !doc.quotation_to)
|
else if(doc.lead && !doc.quotation_to)
|
||||||
doc.quotation_to = "Lead";
|
doc.quotation_to = "Lead";
|
||||||
|
|
||||||
},
|
},
|
||||||
refresh: function(doc, dt, dn) {
|
refresh: function(doc, dt, dn) {
|
||||||
this._super(doc, dt, dn);
|
this._super(doc, dt, dn);
|
||||||
|
@ -21,6 +21,10 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
this.toggle_editable_price_list_rate();
|
this.toggle_editable_price_list_rate();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onload_post_render: function() {
|
||||||
|
cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
|
||||||
|
},
|
||||||
|
|
||||||
setup_queries: function() {
|
setup_queries: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onload_post_render: function() {
|
onload_post_render: function() {
|
||||||
|
cur_frm.get_field(this.fname).grid.set_multiple_add("item_code");
|
||||||
this.set_default_account();
|
this.set_default_account();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user