selections/selections/public/js/request_for_quotation.js

33 lines
812 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Интеграция формы подбора с Request for Quotation
*/
frappe.ui.form.on('Request for Quotation', {
refresh: function(frm) {
if (frm.doc.docstatus === 0) {
setup_selection_button(frm);
}
}
});
function setup_selection_button(frm) {
const grid = frm.fields_dict.items.grid;
grid.wrapper.find('.grid-add-multiple-rows').remove();
$('<button type="button" class="grid-add-multiple-rows btn btn-xs btn-secondary">')
.html(__('Add Multiple'))
.insertAfter(grid.wrapper.find('.grid-add-row'))
.on('click', function(e) {
e.stopImmediatePropagation();
const selection_dialog = new SelectionDialog({
frm: frm,
doctype: 'Request for Quotation',
child_doctype: 'Request for Quotation Item',
has_rate: false
});
selection_dialog.show();
});
}