mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-16 18:24:10 +00:00
Merge branch 'call-summary-dialog' of github.com:surajshetty3416/erpnext into call-summary-dialog
This commit is contained in:
@@ -14,8 +14,12 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => {
|
||||
onload: function(frm) {
|
||||
dimension_filters.then((dimensions) => {
|
||||
dimensions.forEach((dimension) => {
|
||||
frm.set_query(dimension['fieldname'],{
|
||||
"is_group": 0
|
||||
frappe.model.with_doctype(dimension['document_type'], () => {
|
||||
if (frappe.meta.has_field(dimension['document_type'], 'is_group')) {
|
||||
frm.set_query(dimension['fieldname'], {
|
||||
"is_group": 0
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -268,26 +268,27 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
{fieldname: 'batches', fieldtype: 'Table', label: __('Batch Entries'),
|
||||
fields: [
|
||||
{
|
||||
fieldtype:'Link',
|
||||
fieldname:'batch_no',
|
||||
options: 'Batch',
|
||||
label: __('Select Batch'),
|
||||
in_list_view:1,
|
||||
get_query: function() {
|
||||
'fieldtype': 'Link',
|
||||
'read_only': 0,
|
||||
'fieldname': 'batch_no',
|
||||
'options': 'Batch',
|
||||
'label': __('Select Batch'),
|
||||
'in_list_view': 1,
|
||||
get_query: function () {
|
||||
return {
|
||||
filters: {item: me.item_code },
|
||||
query: 'erpnext.controllers.queries.get_batch_numbers'
|
||||
};
|
||||
filters: { item: me.item_code },
|
||||
query: 'erpnext.controllers.queries.get_batch_numbers'
|
||||
};
|
||||
},
|
||||
onchange: function(e) {
|
||||
change: function () {
|
||||
let val = this.get_value();
|
||||
if(val.length === 0) {
|
||||
if (val.length === 0) {
|
||||
this.grid_row.on_grid_fields_dict
|
||||
.available_qty.set_value(0);
|
||||
return;
|
||||
}
|
||||
let selected_batches = this.grid.grid_rows.map((row) => {
|
||||
if(row === this.grid_row) {
|
||||
if (row === this.grid_row) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -295,12 +296,12 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
return row.on_grid_fields_dict.batch_no.get_value();
|
||||
}
|
||||
});
|
||||
if(selected_batches.includes(val)) {
|
||||
if (selected_batches.includes(val)) {
|
||||
this.set_value("");
|
||||
frappe.throw(__(`Batch ${val} already selected.`));
|
||||
return;
|
||||
}
|
||||
if(me.warehouse_details.name) {
|
||||
if (me.warehouse_details.name) {
|
||||
frappe.call({
|
||||
method: 'erpnext.stock.doctype.batch.batch.get_batch_qty',
|
||||
args: {
|
||||
@@ -323,31 +324,32 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldtype:'Float',
|
||||
read_only:1,
|
||||
fieldname:'available_qty',
|
||||
label: __('Available'),
|
||||
in_list_view:1,
|
||||
default: 0,
|
||||
onchange: function() {
|
||||
'fieldtype': 'Float',
|
||||
'read_only': 1,
|
||||
'fieldname': 'available_qty',
|
||||
'label': __('Available'),
|
||||
'in_list_view': 1,
|
||||
'default': 0,
|
||||
change: function () {
|
||||
this.grid_row.on_grid_fields_dict.selected_qty.set_value('0');
|
||||
}
|
||||
},
|
||||
{
|
||||
fieldtype:'Float',
|
||||
fieldname:'selected_qty',
|
||||
label: __('Qty'),
|
||||
in_list_view:1,
|
||||
'fieldtype': 'Float',
|
||||
'read_only': 0,
|
||||
'fieldname': 'selected_qty',
|
||||
'label': __('Qty'),
|
||||
'in_list_view': 1,
|
||||
'default': 0,
|
||||
onchange: function(e) {
|
||||
change: function () {
|
||||
var batch_no = this.grid_row.on_grid_fields_dict.batch_no.get_value();
|
||||
var available_qty = this.grid_row.on_grid_fields_dict.available_qty.get_value();
|
||||
var selected_qty = this.grid_row.on_grid_fields_dict.selected_qty.get_value();
|
||||
|
||||
if(batch_no.length === 0 && parseInt(selected_qty)!==0) {
|
||||
if (batch_no.length === 0 && parseInt(selected_qty) !== 0) {
|
||||
frappe.throw(__("Please select a batch"));
|
||||
}
|
||||
if(me.warehouse_details.type === 'Source Warehouse' &&
|
||||
if (me.warehouse_details.type === 'Source Warehouse' &&
|
||||
parseFloat(available_qty) < parseFloat(selected_qty)) {
|
||||
|
||||
this.set_value('0');
|
||||
@@ -363,7 +365,7 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
||||
],
|
||||
in_place_edit: true,
|
||||
data: this.data,
|
||||
get_data: function() {
|
||||
get_data: function () {
|
||||
return this.data;
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2,16 +2,13 @@
|
||||
// MIT License. See license.txt
|
||||
|
||||
frappe.ui.form.on('Website Theme', {
|
||||
apply_custom_theme(frm) {
|
||||
let custom_theme = frm.doc.custom_theme;
|
||||
custom_theme = custom_theme.split('\n');
|
||||
if (
|
||||
frm.doc.apply_custom_theme
|
||||
&& custom_theme.length === 2
|
||||
&& custom_theme[1].includes('frappe/public/scss/website')
|
||||
validate(frm) {
|
||||
let theme_scss = frm.doc.theme_scss;
|
||||
if (theme_scss.includes('frappe/public/scss/website')
|
||||
&& !theme_scss.includes('erpnext/public/scss/website')
|
||||
) {
|
||||
frm.set_value('custom_theme',
|
||||
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`);
|
||||
frm.set_value('theme_scss',
|
||||
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user