fix: pos closing entry cancellation test (#27099)

* fix: pos closing entry cancellation test

* fix: invalid imports

* fix: sider issue
This commit is contained in:
Saqib 2021-08-24 15:37:00 +05:30 committed by GitHub
parent 6cf9254ee5
commit 9e82c24b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -85,9 +85,15 @@ class TestPOSClosingEntry(unittest.TestCase):
pcv_doc.load_from_db()
pcv_doc.cancel()
si_doc.load_from_db()
cancelled_invoice = frappe.db.get_value(
'POS Invoice Merge Log', {'pos_closing_entry': pcv_doc.name},
'consolidated_invoice'
)
docstatus = frappe.db.get_value("Sales Invoice", cancelled_invoice, 'docstatus')
self.assertEqual(docstatus, 2)
pos_inv1.load_from_db()
self.assertEqual(si_doc.docstatus, 2)
self.assertEqual(pos_inv1.status, 'Paid')

View File

@ -16,7 +16,7 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex
onload(doc) {
super.onload();
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log'];
this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log', 'POS Closing Entry'];
if(doc.__islocal && doc.is_pos && frappe.get_route_str() !== 'point-of-sale') {
this.frm.script_manager.trigger("is_pos");
this.frm.refresh_fields();