def create_actions(self): group = get_accels('app.stock') actions = [ ("NewReceiving", STOQ_RECEIVING, _("Order _receival..."), group.get('new_receiving')), ('NewTransfer', gtk.STOCK_CONVERT, _('Transfer...'), group.get('transfer_product')), ('NewStockDecrease', None, _('Stock decrease...'), group.get('stock_decrease')), ('StockInitial', gtk.STOCK_GO_UP, _('Register initial stock...')), ("LoanNew", None, _("Loan...")), ("LoanClose", None, _("Close loan...")), ("SearchPurchaseReceiving", None, _("Received purchases..."), group.get('search_receiving'), _("Search for received purchase orders")), ("SearchProductHistory", None, _("Product history..."), group.get('search_product_history'), _("Search for product history")), ("SearchStockDecrease", None, _("Stock decreases..."), '', _("Search for manual stock decreases")), ("SearchPurchasedStockItems", None, _("Purchased items..."), group.get('search_purchased_stock_items'), _("Search for purchased items")), ("SearchStockItems", None, _("Stock items..."), group.get('search_stock_items'), _("Search for items on stock")), ("SearchTransfer", None, _("Transfers..."), group.get('search_transfers'), _("Search for stock transfers")), ("SearchClosedStockItems", None, _("Closed stock Items..."), group.get('search_closed_stock_items'), _("Search for closed stock items")), ("LoanSearch", None, _("Loans...")), ("LoanSearchItems", None, _("Loan items...")), ("ProductMenu", None, _("Product")), ("ProductStockHistory", gtk.STOCK_INFO, _("History..."), group.get('history'), _('Show the stock history of the selected product')), ("EditProduct", gtk.STOCK_EDIT, _("Edit..."), group.get('edit_product'), _("Edit the selected product, allowing you to change it's " "details")), ] self.stock_ui = self.add_ui_actions('', actions, filename='stock.xml') toggle_actions = [ ('StockPictureViewer', None, _('Picture viewer'), group.get('toggle_picture_viewer')), ] self.add_ui_actions('', toggle_actions, 'ToggleActions', 'toggle') self.set_help_section(_("Stock help"), 'app-stock') self.NewReceiving.set_short_label(_("Receive")) self.NewTransfer.set_short_label(_("Transfer")) self.EditProduct.set_short_label(_("Edit")) self.ProductStockHistory.set_short_label(_("History")) self.EditProduct.props.is_important = True self.ProductStockHistory.props.is_important = True
def _add_pos_menus(self, uimanager): if sysparam(self.default_store).POS_SEPARATE_CASHIER: return ui_string = """<ui> <menubar name="menubar"> <placeholder name="ExtraMenubarPH"> <menu action="ECFMenu"> <menuitem action="CancelLastDocument" name="CancelLastDocument"/> <menuitem action="Summary" name="Summary"/> <menuitem action="ReadMemory" name="ReadMemory"/> </menu> </placeholder> </menubar> </ui>""" group = get_accels('plugin.ecf') ag = gtk.ActionGroup('ECFMenuActions') ag.add_actions([ ('ECFMenu', None, _('ECF')), ('ReadMemory', None, _('Read Memory'), group.get('read_memory'), None, self._on_ReadMemory__activate), ('CancelLastDocument', None, _('Cancel Last Document'), None, None, self._on_CancelLastDocument__activate), ]) ag.add_action_with_accel(self._till_summarize_action, group.get('summarize')) uimanager.insert_action_group(ag, 0) self._ui = uimanager.add_ui_from_string(ui_string)
def create_actions(self): group = get_accels('app.financial') actions = [ ('TransactionMenu', None, _('Transaction')), ('AccountMenu', None, _('Account')), ('Import', gtk.STOCK_ADD, _('Import...'), group.get('import'), _('Import a GnuCash or OFX file')), ('ConfigurePaymentMethods', None, _('Payment methods'), group.get('configure_payment_methods'), _('Select accounts for the payment methods on the system')), ('DeleteAccount', gtk.STOCK_DELETE, _('Delete...'), group.get('delete_account'), _('Delete the selected account')), ('DeleteTransaction', gtk.STOCK_DELETE, _('Delete...'), group.get('delete_transaction'), _('Delete the selected transaction')), ("NewAccount", gtk.STOCK_NEW, _("Account..."), group.get('new_account'), _("Add a new account")), ("NewTransaction", gtk.STOCK_NEW, _("Transaction..."), group.get('new_store'), _("Add a new transaction")), ("Edit", gtk.STOCK_EDIT, _("Edit..."), group.get('edit')), ] self.financial_ui = self.add_ui_actions('', actions, filename='financial.xml') self.set_help_section(_("Financial help"), 'app-financial') self.Edit.set_short_label(_('Edit')) self.DeleteAccount.set_short_label(_('Delete')) self.DeleteTransaction.set_short_label(_('Delete')) user = api.get_current_user(self.store) if not user.profile.check_app_permission(u'admin'): self.ConfigurePaymentMethods.set_sensitive(False)
def create_actions(self): group = get_accels('app.payable') actions = [ # File ('AddPayment', gtk.STOCK_ADD, _('Account payable...'), group.get('add_payable'), _('Create a new account payable')), ('PaymentFlowHistory', None, _('Payment _flow history...'), group.get('payment_flow_history'), _('Show a report of payment expected to receive grouped by day')), # Payment ('PaymentMenu', None, _('Payment')), ('Details', gtk.STOCK_INFO, _('Details...'), group.get('payment_details'), _('Show details for the selected payment')), ('Pay', gtk.STOCK_APPLY, _('Pay...'), group.get('payment_pay'), _('Pay the order associated with the selected payment')), ('Edit', gtk.STOCK_EDIT, _('Edit installments...'), group.get('payment_edit'), _('Edit the selected payment installments')), ('CancelPayment', gtk.STOCK_REMOVE, _('Cancel...'), group.get('payment_cancel'), _('Cancel the selected payment')), ('SetNotPaid', gtk.STOCK_UNDO, _('Set as not paid...'), group.get('payment_set_not_paid'), _('Mark the selected payment as not paid')), ('ChangeDueDate', gtk.STOCK_REFRESH, _('Change due date...'), group.get('payment_change_due_date'), _('Change the due date of the selected payment')), ('Comments', None, _('Comments...'), group.get('payment_comments'), _('Add comments to the selected payment')), ('PrintReceipt', None, _('Print _receipt...'), group.get('payment_print_receipt'), _('Print a receipt for the selected payment')), # Search ('PaymentCategories', None, _("Payment categories..."), group.get('search_payment_categories'), _('Search for payment categories')), ('BillCheckSearch', None, _('Bills and checks...'), group.get('search_bills'), _('Search for bills and checks')), ] self.payable_ui = self.add_ui_actions(None, actions, filename='payable.xml') self.set_help_section(_("Accounts payable help"), 'app-payable') self.Pay.set_short_label(_('Pay')) self.Edit.set_short_label(_('Edit')) self.Details.set_short_label(_('Details')) self.Pay.props.is_important = True self.Pay.set_sensitive(False) self.PrintReceipt.set_sensitive(False) self.popup = self.uimanager.get_widget('/PayableSelection') self.window.add_new_items([self.AddPayment]) self.window.NewToolItem.set_tooltip(self.AddPayment.get_tooltip()) self.window.add_search_items([self.BillCheckSearch]) self.window.SearchToolItem.set_tooltip( self.BillCheckSearch.get_tooltip()) self.window.Print.set_tooltip(_("Print a report of these payments"))
def create_actions(self): group = get_accels('app.maintenance') actions = [ # File ("OrderMenu", None, _(u"Order")), ("NewOrder", None, _(u"Work order..."), group.get("new_order")), ("SendOrders", None, _(u"Send orders...")), ("ReceiveOrders", None, _(u"Receive orders...")), # Search ("Products", None, _(u"Products..."), group.get("search_products") ), ("Services", None, _(u"Services..."), group.get("search_services")), ("Categories", None, _(u"Categories..."), group.get("search_categories")), ("Clients", STOQ_CLIENTS, _(u"Clients..."), group.get("search_clients")), # Order ("Edit", gtk.STOCK_EDIT, _(u"Edit..."), group.get('order_edit'), _(u"Edit the selected order")), ("Finish", gtk.STOCK_APPLY, _(u"Finish..."), group.get('order_finish'), _(u"Finish the selected order")), ("Cancel", gtk.STOCK_CANCEL, _(u"Cancel..."), group.get('order_cancel'), _(u"Cancel the selected order")), ("Details", gtk.STOCK_INFO, _(u"Details..."), group.get('order_details'), _(u"Show details of the selected order")), ("PrintQuote", None, _(u"Print quote..."), group.get('order_print_quote'), _(u"Print a quote report of the selected order")), ("PrintReceipt", None, _(u"Print receipt..."), group.get('order_print_receipt'), _(u"Print a receipt of the selected order")), ] self.maintenance_ui = self.add_ui_actions("", actions, filename="maintenance.xml") radio_actions = [ ('ViewKanban', '', _("View as Kanban"), '', _("Show in Kanban mode")), ('ViewList', '', _("View as List"), '', _("Show in list mode")), ] self.add_ui_actions('', radio_actions, 'RadioActions', 'radio') if is_developer_mode(): self.ViewList.props.active = True else: self.ViewList.props.visible = False self.ViewKanban.props.visible = False self.Edit.set_short_label(_(u"Edit")) self.Finish.set_short_label(_(u"Finish")) self.Edit.props.is_important = True self.Finish.props.is_important = True self.set_help_section(_(u"Maintenance help"), 'app-maintenance') self.popup = self.uimanager.get_widget('/MaintenanceSelection')
def create_actions(self): group = get_accels('app.till') actions = [ ('SaleMenu', None, _('Sale')), ('TillOpen', None, _('Open till...'), group.get('open_till')), ('TillClose', None, _('Close till...'), group.get('close_till')), ('TillVerify', None, _('Verify till...'), group.get('verify_till')), ('TillAddCash', None, _('Cash addition...'), ''), ('TillRemoveCash', None, _('Cash removal...'), ''), ("PaymentReceive", None, _("Payment receival..."), group.get('payment_receive'), _("Receive payments")), ("SearchClient", None, _("Clients..."), group.get('search_clients'), _("Search for clients")), ("SearchSale", None, _("Sales..."), group.get('search_sale'), _("Search for sales")), ("SearchSoldItemsByBranch", None, _("Sold items by branch..."), group.get('search_sold_items_by_branch'), _("Search for items sold by branch")), ("SearchTillHistory", None, _("Till history..."), group.get('search_till_history'), _("Search for till history")), ("SearchFiscalTillOperations", None, _("Fiscal till operations..."), group.get('search_fiscal_till_operations'), _("Search for fiscal till operations")), ("Confirm", gtk.STOCK_APPLY, _("Confirm..."), group.get('confirm_sale'), _("Confirm the selected sale, decreasing stock and making it " "possible to receive it's payments")), ("Return", gtk.STOCK_CANCEL, _("Return..."), group.get('return_sale'), _("Return the selected sale, returning stock and the client's " "payments")), ("Details", gtk.STOCK_INFO, _("Details..."), group.get('sale_details'), _("Show details of the selected sale")), ] self.till_ui = self.add_ui_actions('', actions, filename="till.xml") self.set_help_section(_("Till help"), 'app-till') self.Confirm.set_short_label(_('Confirm')) self.Return.set_short_label(_('Return')) self.Details.set_short_label(_('Details')) self.Confirm.props.is_important = True self.Return.props.is_important = True self.Details.props.is_important = True
def create_actions(self): group = get_accels('app.production') actions = [ ('menubar', None, ''), # File ('NewProduction', gtk.STOCK_NEW, _('Production order...'), group.get('new_production_order'), _('Create a new production')), ('ProductionPurchaseQuote', STOQ_PRODUCTION_APP, _('Purchase quote...'), group.get('new_production_quote')), # Production ('ProductionMenu', None, _('Production')), ('StartProduction', gtk.STOCK_CONVERT, _('Start production...'), group.get('production_start'), _('Start the selected production')), ('EditProduction', gtk.STOCK_EDIT, _('Edit production...'), group.get('production_edit'), _('Edit the selected production')), ('ProductionDetails', gtk.STOCK_INFO, _('Production details...'), group.get('production_details'), _('Show production details and register produced items')), # Search ("SearchProduct", None, _("Production products..."), group.get('search_production_products'), _("Search for production products")), ("SearchService", None, _("Services..."), group.get('search_services'), _("Search for services")), ("SearchProductionItem", STOQ_PRODUCTION_APP, _("Production items..."), group.get('search_production_items'), _("Search for production items")), ("SearchProductionHistory", None, _("Production history..."), group.get('search_production_history'), _("Search for production history")), ] self.production_ui = self.add_ui_actions("", actions, filename="production.xml") self.set_help_section(_("Production help"), 'app-production') self.NewProduction.set_short_label(_("New Production")) self.ProductionPurchaseQuote.set_short_label(_("Purchase")) self.SearchProductionItem.set_short_label(_("Search items")) self.StartProduction.set_short_label(_('Start')) self.EditProduction.set_short_label(_('Edit')) self.ProductionDetails.set_short_label(_('Details')) self.StartProduction.props.is_important = True
def create_actions(self): group = get_accels('app.admin') actions = [ ("SearchRole", None, _("Roles..."), group.get('search_roles')), ("SearchEmployee", None, _("Employees..."), group.get('search_employees')), ("SearchEvents", None, _("Events..."), group.get('search_events')), ("SearchCostCenters", None, _("Cost Centers..."), group.get('search_cost_centers')), ("SearchCfop", None, _("C.F.O.P..."), group.get('search_cfop')), ("SearchFiscalBook", None, _("Fiscal books..."), group.get('search_fiscalbook')), ("SearchUserProfile", None, _("Profiles..."), group.get('search_profile')), ("SearchUser", None, _("Users..."), group.get('search_users')), ("SearchBranch", None, _("Branches..."), group.get('search_branches')), ("SearchComputer", None, _('Computers...'), group.get('search_computers')), ("SearchTaxTemplate", None, _('Tax Classes...')), ("ConfigureMenu", None, _("_Configure")), ("ConfigureDevices", None, _("Devices..."), group.get('config_devices')), ("ConfigurePaymentMethods", None, _("Payment methods..."), group.get('config_payment_methods')), ("ConfigurePaymentCategories", None, _("Payment categories..."), group.get('config_payment_categories')), ("ConfigureClientCategories", None, _("Client categories..."), group.get('config_client_categories')), ("ConfigureInvoices", None, _("Invoices..."), group.get('config_invoices')), ("ConfigureInvoicePrinters", None, _("Invoice printers..."), group.get('config_invoice_printers')), ("ConfigureSintegra", None, _("Sintegra..."), group.get('config_sintegra')), ("ConfigurePlugins", None, _("Plugins...")), ("ConfigureTaxes", None, _("Taxes..."), group.get('config_taxes')), ("ConfigureParameters", None, _("Parameters..."), group.get('config_parameters')), ("NewUser", None, _("User..."), '', _("Create a new user")), ] self.admin_ui = self.add_ui_actions('', actions, filename='admin.xml') self.set_help_section(_("Admin help"), 'app-admin')
def _add_sale_menus(self, uimanager): menu_items_str = '<menuitem action="OpticalPreSale"/>' ui_string = self._get_menu_ui_string() % menu_items_str group = get_accels('plugin.optical') ag = gtk.ActionGroup('OpticalMenuActions') ag.add_actions([ ('OpticalMenu', None, _(u'Optical')), ('OpticalPreSale', None, _(u'Optical pre sale'), group.get('pre_sale'), None, self._on_OpticalPreSale__activate), ]) uimanager.insert_action_group(ag, 0) self._ui = uimanager.add_ui_from_string(ui_string)
def _add_sale_menus(self, uimanager): menu_items_str = '<menuitem action="BookSearch"/>' ui_string = self._get_menu_ui_string() % menu_items_str group = get_accels('plugin.books') ag = gtk.ActionGroup('BooksMenuActions') ag.add_actions([ ('BooksMenu', None, _(u'Books')), ('BookSearch', None, _(u'Book Search'), group.get('search_books'), None, self._on_BookSearchView__activate), ]) uimanager.insert_action_group(ag, 0) self._ui = uimanager.add_ui_from_string(ui_string)
def create_actions(self): group = get_accels('app.maintenance') actions = [ # File ("OrderMenu", None, _(u"Order")), ("NewOrder", None, _(u"Work order..."), group.get("new_order")), # Search ("Products", None, _(u"Products..."), group.get("search_products")), ("Services", None, _(u"Services..."), group.get("search_services")), ("Categories", None, _(u"Categories..."), group.get("search_categories")), # Order ("Edit", gtk.STOCK_EDIT, _(u"Edit..."), group.get('order_edit'), _(u"Edit the selected order")), ("Finish", gtk.STOCK_APPLY, _(u"Finish..."), group.get('order_finish'), _(u"Finish the selected order")), ("Cancel", gtk.STOCK_CANCEL, _(u"Cancel..."), group.get('order_cancel'), _(u"Cancel the selected order")), ("Details", gtk.STOCK_INFO, _(u"Details..."), group.get('order_details'), _(u"Show details of the selected order")), ("PrintQuote", None, _(u"Print quote..."), group.get('order_print_quote'), _(u"Print a quote report of the selected order")), ("PrintReceipt", None, _(u"Print receipt..."), group.get('order_print_receipt'), _(u"Print a receipt of the selected order")), ] self.maintenance_ui = self.add_ui_actions("", actions, filename="maintenance.xml") self.Edit.set_short_label(_(u"Edit")) self.Finish.set_short_label(_(u"Finish")) self.Edit.props.is_important = True self.Finish.props.is_important = True self.set_help_section(_(u"Maintenance help"), 'app-maintenance') self.popup = self.uimanager.get_widget('/MaintenanceSelection')
def create_actions(self): group = get_accels('app.pos') actions = [ # File ('NewTrade', None, _('Trade...'), group.get('new_trade')), ('PaymentReceive', None, _('Payment Receival...'), group.get('payment_receive')), ("TillOpen", None, _("Open Till..."), group.get('till_open')), ("TillClose", None, _("Close Till..."), group.get('till_close')), ("TillVerify", None, _("Verify Till..."), group.get('till_verify')), ("LoanClose", None, _("Close loan...")), ("WorkOrderClose", None, _("Close work order...")), # Order ("OrderMenu", None, _("Order")), ('ConfirmOrder', None, _('Confirm...'), group.get('order_confirm')), ('CancelOrder', None, _('Cancel...'), group.get('order_cancel')), ('NewDelivery', None, _('Create delivery...'), group.get('order_create_delivery')), # Search ("Sales", None, _("Sales..."), group.get('search_sales')), ("SoldItemsByBranchSearch", None, _("Sold Items by Branch..."), group.get('search_sold_items')), ("Clients", None, _("Clients..."), group.get('search_clients')), ("ProductSearch", None, _("Products..."), group.get('search_products')), ("ServiceSearch", None, _("Services..."), group.get('search_services')), ("DeliverySearch", None, _("Deliveries..."), group.get('search_deliveries')), ] self.pos_ui = self.add_ui_actions('', actions, filename='pos.xml') self.set_help_section(_("POS help"), 'app-pos')
def _add_till_menus(self, uimanager): ui_string = """<ui> <menubar name="menubar"> <placeholder name="ExtraMenubarPH"> <menu action="ECFMenu"> <menuitem action="Summary"/> <menuitem action="ReadMemory"/> </menu> </placeholder> </menubar> </ui>""" group = get_accels('plugin.ecf') ag = gtk.ActionGroup('ECFMenuActions') ag.add_actions([ ('ECFMenu', None, _('ECF')), ('ReadMemory', None, _('Read Memory'), group.get('read_memory'), None, self._on_ReadMemory__activate), ]) ag.add_action_with_accel(self._till_summarize_action, group.get('summarize')) uimanager.insert_action_group(ag, 0) self._ui = uimanager.add_ui_from_string(ui_string)
def create_actions(self): group = get_accels('app.inventory') actions = [ # File ('NewInventory', None, _('Inventory...'), group.get('new_inventory'), _('Create a new inventory for product counting')), # Inventory ('InventoryMenu', None, _('Inventory')), ('CountingAction', gtk.STOCK_INDEX, _('_Count...'), group.get('inventory_count'), _('Register the actual stock of products in the selected ' 'inventory')), ('AdjustAction', gtk.STOCK_CONVERT, _('_Adjust...'), group.get('inventory_adjust'), _('Adjust the stock accordingly to the counting in the selected ' 'inventory')), ('Cancel', gtk.STOCK_CANCEL, _('Cancel...'), group.get('inventory_cancel'), _('Cancel the selected inventory')), ('PrintProductListing', gtk.STOCK_PRINT, _('Print product listing...'), group.get('inventory_print'), _('Print the product listing for this inventory')) ] self.inventory_ui = self.add_ui_actions('', actions, filename='inventory.xml') self.set_help_section(_("Inventory help"), 'app-inventory') self.AdjustAction.set_short_label(_("Adjust")) self.CountingAction.set_short_label(_("Count")) self.Cancel.set_short_label(_("Cancel")) self.AdjustAction.props.is_important = True self.CountingAction.props.is_important = True self.Cancel.props.is_important = True
def create_actions(self): group = get_accels('app.calendar') actions = [ # File ('NewClientCall', None, _("Client call"), group.get('new_client_call'), _("Add a new client call")), ('NewPayable', None, _("Account payable"), group.get('new_payable'), _("Add a new account payable")), ('NewReceivable', None, _("Account receivable"), group.get('new_receivable'), _("Add a new account receivable")), # View ('Back', gtk.STOCK_GO_BACK, _("Back"), group.get('go_back'), _("Go back")), ('Forward', gtk.STOCK_GO_FORWARD, _("Forward"), group.get('go_forward'), _("Go forward")), ('Today', STOQ_CALENDAR_TODAY, _("Show today"), group.get('show_today'), _("Show today")), ('CalendarEvents', None, _("Calendar events")), ('CurrentView', None, _("Display view as")), ] self.calendar_ui = self.add_ui_actions('', actions, filename='calendar.xml') self.set_help_section(_("Calendar help"), 'app-calendar') toggle_actions = [ ('AccountsPayableEvents', None, _("Accounts payable"), None, _("Show accounts payable in the list")), ('AccountsReceivableEvents', None, _("Accounts receivable"), None, _("Show accounts receivable in the list")), ('PurchaseEvents', None, _("Purchases"), None, _("Show purchases in the list")), ('ClientCallEvents', None, _("Client Calls"), None, _("Show client calls in the list")), ] self.add_ui_actions('', toggle_actions, 'ToggleActions', 'toggle') events_info = dict( in_payments=(self.AccountsReceivableEvents, self.NewReceivable, u'receivable'), out_payments=(self.AccountsPayableEvents, self.NewPayable, u'payable'), purchase_orders=(self.PurchaseEvents, None, u'stock'), client_calls=(self.ClientCallEvents, self.NewClientCall, u'sales'), ) user = api.get_current_user(self.store) events = self._calendar.get_events() for event_name, value in events_info.items(): view_action, new_action, app = value view_action.props.active = events[event_name] # Disable feature if user does not have acces to required # application if not user.profile.check_app_permission(app): view_action.props.active = False view_action.set_sensitive(False) if new_action: new_action.set_sensitive(False) view_action.connect('notify::active', self._update_events) self._update_events() radio_actions = [ ('ViewMonth', STOQ_CALENDAR_MONTH, _("View as month"), '', _("Show one month")), ('ViewWeek', STOQ_CALENDAR_WEEK, _("View as week"), '', _("Show one week")), ('ViewDay', STOQ_CALENDAR_LIST, _("View as day"), '', _("Show one day")), ] self.add_ui_actions('', radio_actions, 'RadioActions', 'radio') self.ViewMonth.set_short_label(_("Month")) self.ViewWeek.set_short_label(_("Week")) self.ViewDay.set_short_label(_("Day")) self.ViewMonth.props.is_important = True self.ViewWeek.props.is_important = True self.ViewDay.props.is_important = True view = api.user_settings.get('calendar-view', 'month') if view == 'month': self.ViewMonth.props.active = True elif view == 'basicWeek': self.ViewWeek.props.active = True else: self.ViewDay.props.active = True
def create_actions(self): group = get_accels('app.maintenance') actions = [ # File ("OrderMenu", None, _(u"Order")), ("NewOrder", None, _(u"Work order..."), group.get("new_order")), ("SendOrders", None, _(u"Send orders...")), ("ReceiveOrders", None, _(u"Receive orders...")), # Search ("Products", None, _(u"Products..."), group.get("search_products")), ("Services", None, _(u"Services..."), group.get("search_services")), ("Categories", None, _(u"Categories..."), group.get("search_categories")), ("Clients", STOQ_CLIENTS, _(u"Clients..."), group.get("search_clients")), # Order ("Edit", gtk.STOCK_EDIT, _(u"Edit..."), group.get('order_edit'), _(u"Edit the selected order")), ("Finish", gtk.STOCK_APPLY, _(u"Finish..."), group.get('order_finish'), _(u"Finish the selected order")), ("Cancel", gtk.STOCK_CANCEL, _(u"Cancel..."), group.get('order_cancel'), _(u"Cancel the selected order")), ("Details", gtk.STOCK_INFO, _(u"Details..."), group.get('order_details'), _(u"Show details of the selected order")), ("PrintQuote", None, _(u"Print quote..."), group.get('order_print_quote'), _(u"Print a quote report of the selected order")), ("PrintReceipt", None, _(u"Print receipt..."), group.get('order_print_receipt'), _(u"Print a receipt of the selected order")), ] self.maintenance_ui = self.add_ui_actions("", actions, filename="maintenance.xml") radio_actions = [ ('ViewKanban', '', _("View as Kanban"), '', _("Show in Kanban mode")), ('ViewList', '', _("View as List"), '', _("Show in list mode")), ] self.add_ui_actions('', radio_actions, 'RadioActions', 'radio') if is_developer_mode(): self.ViewList.props.active = True else: self.ViewList.props.visible = False self.ViewKanban.props.visible = False self.Edit.set_short_label(_(u"Edit")) self.Finish.set_short_label(_(u"Finish")) self.Edit.props.is_important = True self.Finish.props.is_important = True self.set_help_section(_(u"Maintenance help"), 'app-maintenance') self.popup = self.uimanager.get_widget('/MaintenanceSelection')
def create_actions(self): group = get_accels('app.receivable') actions = [ # File ('AddReceiving', gtk.STOCK_ADD, _('Account receivable...'), group.get('add_receiving'), _('Create a new account receivable')), ('PaymentFlowHistory', None, _('Payment _flow history...'), group.get('payment_flow_history')), # Payment ('PaymentMenu', None, _('Payment')), ( 'Details', gtk.STOCK_INFO, _('Details...'), group.get('payment_details'), _('Show details for the selected payment'), ), ('Receive', gtk.STOCK_APPLY, _('Receive...'), group.get('payment_receive'), _('Receive the selected payments')), ('CancelPayment', gtk.STOCK_REMOVE, _('Cancel payment...'), group.get('payment_cancel'), _('Cancel the selected payment')), ('SetNotPaid', gtk.STOCK_UNDO, _('Set as not paid...'), group.get('payment_set_not_paid'), _('Mark the selected payment as not paid')), ('ChangeDueDate', gtk.STOCK_REFRESH, _('Change due date...'), group.get('payment_change_due_date'), _('Change the due date of the selected payment')), ('Renegotiate', None, _('Renegotiate...'), group.get('payment_renegotiate'), _('Renegotiate the selected payments')), ('Edit', None, _('Edit installments...'), group.get('payment_edit_installments'), _('Edit the selected payment installments')), ('Comments', None, _('Comments...'), group.get('payment_comments'), _('Add comments to the selected payment')), ('PrintDocument', gtk.STOCK_PRINT, _('Print document...'), group.get('payment_print_bill'), _('Print a bill for the selected payment')), ('PrintReceipt', None, _('Print _receipt...'), group.get('payment_print_receipt'), _('Print a receipt for the selected payment')), # Search ('PaymentCategories', None, _("Payment categories..."), group.get('search_payment_categories'), _('Search for payment categories')), ('BillCheckSearch', None, _('Bills and checks...'), group.get('search_bills'), _('Search for bills and checks')), ('CardPaymentSearch', None, _('Card payments...'), group.get('search_card_payments'), _('Search for card payments')), ] self.receivable_ui = self.add_ui_actions(None, actions, filename='receivable.xml') self.set_help_section(_("Accounts receivable help"), 'app-receivable') self.Receive.set_short_label(_('Receive')) self.Details.set_short_label(_('Details')) self.Receive.props.is_important = True self.window.add_new_items([self.AddReceiving]) self.window.add_search_items( [self.BillCheckSearch, self.CardPaymentSearch]) self.window.Print.set_tooltip(_("Print a report of this payments")) self.popup = self.uimanager.get_widget('/ReceivableSelection')
def create_actions(self): group = get_accels('app.sales') actions = [ # File ("SaleQuote", None, _("Sale quote..."), '', _('Create a new quote for a sale')), ("LoanNew", None, _("Loan...")), ("LoanClose", None, _("Close loan...")), # Search ("SearchSoldItemsByBranch", None, _("Sold items by branch..."), group.get("search_sold_items_by_branch"), _("Search for sold items by branch")), ("SearchSalesByPaymentMethod", None, _("Sales by payment method..."), group.get("search_sales_by_payment")), ("SearchSalesPersonSales", None, _("Total sales made by salesperson..."), group.get("search_salesperson_sales"), _("Search for sales by payment method")), ("SearchProduct", STOQ_PRODUCTS, _("Products..."), group.get("search_products"), _("Search for products")), ("SearchService", STOQ_SERVICES, _("Services..."), group.get("search_services"), _("Search for services")), ("SearchDelivery", STOQ_DELIVERY, _("Deliveries..."), group.get("search_deliveries"), _("Search for deliveries")), ("SearchClient", STOQ_CLIENTS, _("Clients..."), group.get("search_clients"), _("Search for clients")), ("SearchClientCalls", None, _("Client Calls..."), group.get("search_client_calls"), _("Search for client calls")), ("SearchCreditCheckHistory", None, _("Client credit check history..."), group.get("search_credit_check_history"), _("Search for client check history")), ("SearchCommission", None, _("Commissions..."), group.get("search_commissions"), _("Search for salespersons commissions")), ("LoanSearch", None, _("Loans..."), group.get("search_loans")), ("LoanSearchItems", None, _("Loan items..."), group.get("search_loan_items")), # Sale ("SaleMenu", None, _("Sale")), ("SalesCancel", None, _("Cancel quote...")), ("SalesPrintInvoice", gtk.STOCK_PRINT, _("_Print invoice...")), ("Return", gtk.STOCK_CANCEL, _("Return..."), '', _("Return the selected sale, canceling it's payments")), ("Edit", gtk.STOCK_EDIT, _("Edit..."), '', _("Edit the selected sale, allowing you to change the details " "of it")), ("Details", gtk.STOCK_INFO, _("Details..."), '', _("Show details of the selected sale")) ] self.sales_ui = self.add_ui_actions("", actions, filename="sales.xml") self.SaleQuote.set_short_label(_("New Sale Quote")) self.SearchClient.set_short_label(_("Clients")) self.SearchProduct.set_short_label(_("Products")) self.SearchService.set_short_label(_("Services")) self.SearchDelivery.set_short_label(_("Deliveries")) self.SalesCancel.set_short_label(_("Cancel")) self.Edit.set_short_label(_("Edit")) self.Return.set_short_label(_("Return")) self.Details.set_short_label(_("Details")) self.set_help_section(_("Sales help"), 'app-sales')
def create_actions(self): group = get_accels('app.purchase') actions = [ # File ("OrderMenu", None, _("Order")), ("NewOrder", gtk.STOCK_NEW, _("Order..."), group.get('new_order'), _("Create a new purchase order")), ("NewQuote", gtk.STOCK_INDEX, _("Quote..."), group.get('new_quote'), _("Create a new purchase quote")), ("NewConsignment", None, _("Consignment..."), group.get('new_consignment'), _("Create a new purchase consignment")), ("NewProduct", None, _("Product..."), group.get('new_product'), _("Create a new product")), ("CloseInConsignment", None, _("Close consigment...")), # Edit ("StockCost", None, _("_Stock cost...")), # Search ("Categories", None, _("Categories..."), group.get("search_categories")), ("Products", STOQ_PRODUCTS, _("Products..."), group.get("search_products")), ("ProductUnits", None, _("Product units..."), group.get("search_product_units")), ("ProductManufacturers", None, _("Manufacturers..."), group.get("search_product_manufacturers")), ("Services", None, _("Services..."), group.get("search_services")), ("SearchStockItems", None, _("Stock items..."), group.get("search_stock_items")), ("SearchClosedStockItems", None, _("Closed stock items..."), group.get("search_closed_stock_items")), ("Suppliers", STOQ_SUPPLIERS, _("Suppliers..."), group.get("search_suppliers")), ("Transporter", None, _("Transporters..."), group.get("search_transporters")), ("SearchQuotes", None, _("Quotes..."), group.get("search_quotes")), ("SearchPurchasedItems", None, _("Purchased items..."), group.get("search_purchased_items")), ("ProductsSoldSearch", None, _("Sold products..."), group.get("search_products_sold")), ("ProductsPriceSearch", None, _("Prices..."), group.get("search_prices")), ("SearchInConsignmentItems", None, _("Search consigment items..."), group.get("search_consignment_items")), # Order ("Confirm", gtk.STOCK_APPLY, _("Confirm..."), group.get('order_confirm'), _("Confirm the selected order(s), marking it as sent to the " "supplier")), ("Cancel", gtk.STOCK_CANCEL, _("Cancel..."), group.get('order_cancel'), _("Cancel the selected order")), ("Edit", gtk.STOCK_EDIT, _("Edit..."), group.get('order_edit'), _("Edit the selected order, allowing you to change it's details")), ("Details", gtk.STOCK_INFO, _("Details..."), group.get('order_details'), _("Show details of the selected order")), ("Finish", gtk.STOCK_APPLY, _("Finish..."), group.get('order_finish'), _('Complete the selected partially received order')), ] self.purchase_ui = self.add_ui_actions("", actions, filename="purchase.xml") self.Confirm.props.is_important = True self.NewOrder.set_short_label(_("New order")) self.NewQuote.set_short_label(_("New quote")) self.Products.set_short_label(_("Products")) self.Suppliers.set_short_label(_("Suppliers")) self.Confirm.set_short_label(_("Confirm")) self.Cancel.set_short_label(_("Cancel")) self.Finish.set_short_label(_("Finish")) self.Edit.set_short_label(_("Edit")) self.Details.set_short_label(_("Details")) self.set_help_section(_("Purchase help"), 'app-purchase') self.popup = self.uimanager.get_widget('/PurchaseSelection')
def create_actions(self): group = get_accels('app.receivable') actions = [ # File ('AddReceiving', gtk.STOCK_ADD, _('Account receivable...'), group.get('add_receiving'), _('Create a new account receivable')), ('PaymentFlowHistory', None, _('Payment _flow history...'), group.get('payment_flow_history')), # Payment ('PaymentMenu', None, _('Payment')), ('Details', gtk.STOCK_INFO, _('Details...'), group.get('payment_details'), _('Show details for the selected payment'), ), ('Receive', gtk.STOCK_APPLY, _('Receive...'), group.get('payment_receive'), _('Receive the selected payments')), ('CancelPayment', gtk.STOCK_REMOVE, _('Cancel payment...'), group.get('payment_cancel'), _('Cancel the selected payment')), ('SetNotPaid', gtk.STOCK_UNDO, _('Set as not paid...'), group.get('payment_set_not_paid'), _('Mark the selected payment as not paid')), ('ChangeDueDate', gtk.STOCK_REFRESH, _('Change due date...'), group.get('payment_change_due_date'), _('Change the due date of the selected payment')), ('Renegotiate', None, _('Renegotiate...'), group.get('payment_renegotiate'), _('Renegotiate the selected payments')), ('Edit', None, _('Edit installments...'), group.get('payment_edit_installments'), _('Edit the selected payment installments')), ('Comments', None, _('Comments...'), group.get('payment_comments'), _('Add comments to the selected payment')), ('PrintDocument', gtk.STOCK_PRINT, _('Print document...'), group.get('payment_print_bill'), _('Print a bill for the selected payment')), ('PrintReceipt', None, _('Print _receipt...'), group.get('payment_print_receipt'), _('Print a receipt for the selected payment')), # Search ('PaymentCategories', None, _("Payment categories..."), group.get('search_payment_categories'), _('Search for payment categories')), ('BillCheckSearch', None, _('Bills and checks...'), group.get('search_bills'), _('Search for bills and checks')), ('CardPaymentSearch', None, _('Card payments...'), group.get('search_card_payments'), _('Search for card payments')), ] self.receivable_ui = self.add_ui_actions(None, actions, filename='receivable.xml') self.set_help_section(_("Accounts receivable help"), 'app-receivable') self.Receive.set_short_label(_('Receive')) self.Details.set_short_label(_('Details')) self.Receive.props.is_important = True self.window.add_new_items([self.AddReceiving]) self.window.add_search_items([self.BillCheckSearch, self.CardPaymentSearch]) self.window.Print.set_tooltip( _("Print a report of this payments")) self.popup = self.uimanager.get_widget('/ReceivableSelection')
def create_actions(self): group = get_accels('app.payable') actions = [ # File ('AddPayment', gtk.STOCK_ADD, _('Account payable...'), group.get('add_payable'), _('Create a new account payable')), ('PaymentFlowHistory', None, _('Payment _flow history...'), group.get('payment_flow_history'), _('Show a report of payment expected to receive grouped by day')), # Payment ('PaymentMenu', None, _('Payment')), ('Details', gtk.STOCK_INFO, _('Details...'), group.get('payment_details'), _('Show details for the selected payment')), ('Pay', gtk.STOCK_APPLY, _('Pay...'), group.get('payment_pay'), _('Pay the order associated with the selected payment')), ('Edit', gtk.STOCK_EDIT, _('Edit installments...'), group.get('payment_edit'), _('Edit the selected payment installments')), ('CancelPayment', gtk.STOCK_REMOVE, _('Cancel...'), group.get('payment_cancel'), _('Cancel the selected payment')), ('SetNotPaid', gtk.STOCK_UNDO, _('Set as not paid...'), group.get('payment_set_not_paid'), _('Mark the selected payment as not paid')), ('ChangeDueDate', gtk.STOCK_REFRESH, _('Change due date...'), group.get('payment_change_due_date'), _('Change the due date of the selected payment')), ('Comments', None, _('Comments...'), group.get('payment_comments'), _('Add comments to the selected payment')), ('PrintReceipt', None, _('Print _receipt...'), group.get('payment_print_receipt'), _('Print a receipt for the selected payment')), # Search ('PaymentCategories', None, _("Payment categories..."), group.get('search_payment_categories'), _('Search for payment categories')), ('BillCheckSearch', None, _('Bills and checks...'), group.get('search_bills'), _('Search for bills and checks')), ] self.payable_ui = self.add_ui_actions(None, actions, filename='payable.xml') self.set_help_section(_("Accounts payable help"), 'app-payable') self.Pay.set_short_label(_('Pay')) self.Edit.set_short_label(_('Edit')) self.Details.set_short_label(_('Details')) self.Pay.props.is_important = True self.Pay.set_sensitive(False) self.PrintReceipt.set_sensitive(False) self.popup = self.uimanager.get_widget('/PayableSelection') self.window.add_new_items([self.AddPayment]) self.window.NewToolItem.set_tooltip(self.AddPayment.get_tooltip()) self.window.add_search_items([self.BillCheckSearch]) self.window.SearchToolItem.set_tooltip( self.BillCheckSearch.get_tooltip()) self.window.Print.set_tooltip( _("Print a report of these payments"))
def create_actions(self): group = get_accels('app.purchase') actions = [ # File ("OrderMenu", None, _("Order")), ("NewOrder", gtk.STOCK_NEW, _("Order..."), group.get('new_order'), _("Create a new purchase order")), ("NewQuote", gtk.STOCK_INDEX, _("Quote..."), group.get('new_quote'), _("Create a new purchase quote")), ("NewConsignment", None, _("Consignment..."), group.get('new_consignment'), _("Create a new purchase consignment")), ("NewProduct", None, _("Product..."), group.get('new_product'), _("Create a new product")), ("CloseInConsignment", None, _("Close consigment...")), # Edit ("StockCost", None, _("_Stock cost...")), # Search ("Categories", None, _("Categories..."), group.get("search_categories")), ("Products", STOQ_PRODUCTS, _("Products..."), group.get("search_products")), ("ProductUnits", None, _("Product units..."), group.get("search_product_units")), ("ProductManufacturers", None, _("Manufacturers..."), group.get("search_product_manufacturers")), ("Services", None, _("Services..."), group.get("search_services")), ("SearchStockItems", None, _("Stock items..."), group.get("search_stock_items")), ("SearchClosedStockItems", None, _("Closed stock items..."), group.get("search_closed_stock_items")), ("Suppliers", STOQ_SUPPLIERS, _("Suppliers..."), group.get("search_suppliers")), ("Transporter", None, _("Transporters..."), group.get("search_transporters")), ("SearchQuotes", None, _("Quotes..."), group.get("search_quotes")), ("SearchPurchasedItems", None, _("Purchased items..."), group.get("search_purchased_items")), ("ProductsSoldSearch", None, _("Sold products..."), group.get("search_products_sold")), ("ProductsPriceSearch", None, _("Prices..."), group.get("search_prices")), ("SearchInConsignmentItems", None, _("Search consigment items..."), group.get("search_consignment_items")), # Order ("Confirm", gtk.STOCK_APPLY, _("Confirm..."), group.get('order_confirm'), _("Confirm the selected order(s), marking it as sent to the " "supplier")), ("Cancel", gtk.STOCK_CANCEL, _("Cancel..."), group.get('order_cancel'), _("Cancel the selected order")), ("Edit", gtk.STOCK_EDIT, _("Edit..."), group.get('order_edit'), _("Edit the selected order, allowing you to change it's details") ), ("Details", gtk.STOCK_INFO, _("Details..."), group.get('order_details'), _("Show details of the selected order")), ("Finish", gtk.STOCK_APPLY, _("Finish..."), group.get('order_finish'), _('Complete the selected partially received order')), ] self.purchase_ui = self.add_ui_actions("", actions, filename="purchase.xml") self.Confirm.props.is_important = True self.NewOrder.set_short_label(_("New order")) self.NewQuote.set_short_label(_("New quote")) self.Products.set_short_label(_("Products")) self.Suppliers.set_short_label(_("Suppliers")) self.Confirm.set_short_label(_("Confirm")) self.Cancel.set_short_label(_("Cancel")) self.Finish.set_short_label(_("Finish")) self.Edit.set_short_label(_("Edit")) self.Details.set_short_label(_("Details")) self.set_help_section(_("Purchase help"), 'app-purchase') self.popup = self.uimanager.get_widget('/PurchaseSelection')
def _create_shared_actions(self): group = get_accels('app.common') actions = [ ('menubar', ), ('toolbar', ), # Menus ('FileMenu', None, _("_File")), ('FileMenuNew', None), ("NewMenu", None, _("New")), ('NewWindow', None, _("_Window"), group.get('new_window'), _('Opens up a new window')), ('Close', None, _('Close'), group.get('close_window'), _('Close the current view and go back to the initial screen')), ('ChangePassword', None, _('Change password...'), group.get('change_password'), _('Change the password for the currently logged in user')), ('SignOut', None, _('Sign out...'), group.get('sign_out'), _('Sign out the currently logged in user and login as another')), ('Print', gtk.STOCK_PRINT, _("Print..."), group.get('print')), ('ExportSpreadSheet', gtk.STOCK_SAVE_AS, _('Export to spreadsheet...')), ("Quit", gtk.STOCK_QUIT, _('Quit'), group.get('quit'), _('Exit the application')), # Edit ('EditMenu', None, _("_Edit")), ('Preferences', None, _("_Preferences"), group.get('preferences'), _('Show preferences')), # View ('ViewMenu', None, _("_View")), # Search ('SearchMenu', None, _("_Search")), # Help ("HelpMenu", None, _("_Help")), ("HelpContents", gtk.STOCK_HELP, _("Contents"), group.get('help_contents')), ("HelpTranslate", None, _("Translate Stoq..."), None, _("Translate this application online")), ("HelpSupport", None, _("Get support online..."), None, _("Get support for Stoq online")), ("HelpChat", None, _("Online chat..."), None, _("Talk about Stoq online")), ("HelpAbout", gtk.STOCK_ABOUT), # Toolbar ("NewToolMenu", None, _("New")), ("SearchToolMenu", None, _("Search")), ] self.add_ui_actions(None, actions, filename='shellwindow.xml') self.Close.set_sensitive(False) toggle_actions = [ ('ToggleToolbar', None, _("_Toolbar"), group.get('toggle_toolbar'), _('Show or hide the toolbar')), ('ToggleStatusbar', None, _("_Statusbar"), group.get('toggle_statusbar'), _('Show or hide the statusbar')), ('ToggleFullscreen', None, _("_Fullscreen"), group.get('toggle_fullscreen'), _('Enter or leave fullscreen mode')), ] self.add_ui_actions('', toggle_actions, 'ToggleActions', 'toggle') self.Print.set_short_label(_("Print")) self.add_tool_menu_actions([ ("NewToolItem", _("New"), '', gtk.STOCK_NEW), ("SearchToolItem", _("Search"), None, gtk.STOCK_FIND), ]) self.NewToolItem.props.is_important = True self.SearchToolItem.props.is_important = True