File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
erpnext/accounts/doctype/sales_invoice Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -255,15 +255,16 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends (
255255 }
256256
257257 toggle_get_items ( ) {
258- // Show buttons only when pos view is inactive and not is_return
259- if (
260- cint ( this . frm . doc . docstatus == 0 ) &&
261- this . frm . page . current_view_name !== "pos" &&
262- ! this . frm . doc . is_return
263- ) {
264- this . frm . cscript . sales_order_btn ( ) ;
258+ if ( cint ( this . frm . doc . docstatus == 0 ) && this . frm . page . current_view_name !== "pos" ) {
259+ if ( ! this . frm . doc . is_return ) {
260+ this . frm . cscript . sales_order_btn ( ) ;
261+ this . frm . cscript . quotation_btn ( ) ;
262+ } else {
263+ [ "Sales Order" , "Quotation" , "Timesheet" ] . forEach ( ( label ) => {
264+ this . frm . remove_custom_button ( label , "Get Items From" ) ;
265+ } ) ;
266+ }
265267 this . frm . cscript . delivery_note_btn ( ) ;
266- this . frm . cscript . quotation_btn ( ) ;
267268 } else {
268269 [ "Sales Order" , "Quotation" , "Timesheet" ] . forEach ( ( label ) => {
269270 this . frm . remove_custom_button ( label , "Get Items From" ) ;
You can’t perform that action at this time.
0 commit comments