def __init__(self): self._ui = None self.default_store = get_default_store() self._printer_verified = False # Delay printer creation until we are accessing pos or till app. Other # applications should still be accessible without a printer self._printer = None SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) self._till_summarize_action = gtk.Action( 'Summary', _('Summary'), None, None) self._till_summarize_action.connect( 'activate', self._on_TillSummary__activate) add_bindings([ ('plugin.ecf.read_memory', '<Primary>F9'), ('plugin.ecf.summarize', '<Primary>F11'), ])
def __init__(self): self._ui = None self.default_store = get_default_store() self._printer_verified = False # Delay printer creation until we are accessing pos or till app. Other # applications should still be accessible without a printer self._printer = None SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) self._till_summarize_action = gtk.Action('Summary', _('Summary'), None, None) self._till_summarize_action.connect('activate', self._on_TillSummary__activate) add_bindings([ ('plugin.ecf.read_memory', '<Primary>F9'), ('plugin.ecf.summarize', '<Primary>F11'), ])
def test_confirm(self, warning): editor = CashInEditor(self.store) self.assertNotSensitive(editor.main_dialog, ['ok_button']) editor.cash_slave.proxy.update('value', currency(10)) self.assertSensitive(editor.main_dialog, ['ok_button']) TillAddCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillAddCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)
def testConfirm(self, warning): editor = CashInEditor(self.store) self.assertNotSensitive(editor.main_dialog, ['ok_button']) editor.cash_slave.proxy.update('value', currency(10)) self.assertSensitive(editor.main_dialog, ['ok_button']) TillAddCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillAddCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)
def _setup_events(self): SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) EditorCreateEvent.connect(self._on_EditorCreateEvent) ECFGetPrinterUserNumberEvent.connect(self._on_ECFGetPrinterUserNumberEvent)
def _setup_events(self): SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) EditorCreateEvent.connect(self._on_EditorCreateEvent)