Example #1
0
    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
            ('Details', Gtk.STOCK_INFO, _('Details...'),
             group.get('inventory_details'),
             _('See details about this 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')),
            ('Export', Gtk.STOCK_SAVE, _('Export for external counting...'),
             None, _('Export the list of products for external counting')),
            ('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)
        self.set_help_section(_("Inventory help"), 'app-inventory')
Example #2
0
 def _add_pos_menus(self, app):
     group = get_accels('plugin.books')
     actions = [
         ('BookSearch', None, _(u'Book Search'), group.get('search_books'),
          None, self._on_BookSearchView__activate),
     ]
     app.add_ui_actions(actions)
     app.window.add_search_items([app.BookSearch], _('Books'))
Example #3
0
    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')),
            ("TillDailyMovement", None, _("Till daily movement..."),
             group.get('daily_movement')),
            ('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")),
            ("SearchCardPayment", None, _("Card payments..."),
             None, _("Search for card payments")),
            ("SearchSoldItemsByBranch", None, _("Sold items by branch..."),
             group.get('search_sold_items_by_branch'),
             _("Search for items sold by branch")),
            ("SearchTillHistory", None, _("Till entry 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")),
            ("SearchClosedTill", None, _("Closed till search..."),
             group.get('search_closed_till'),
             _("Search for all closed tills")),
            ("Confirm", Gtk.STOCK_APPLY, _("Confirm..."),
             group.get('confirm_sale'),
             _("Confirm the selected sale, decreasing stock and making it "
               "possible to receive it's payments")),

            # FIXME: This button should change the label to "Cancel" when the
            # selected sale can be cancelled and not returned, since that's
            # what is going to happen when the user click in it
            ("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")),
            ("Payment", Gtk.STOCK_INFO, _("Edit payments..."), None,
             _("Edit payments of the selected sale")),
        ]

        self.till_ui = self.add_ui_actions(actions)
        self.set_help_section(_("Till help"), 'app-till')
Example #4
0
    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(actions)
        self.set_help_section(_("Accounts payable help"), 'app-payable')
        self.set_sensitive([self.Pay], False)
        self.set_sensitive([self.PrintReceipt], False)

        self.window.add_print_items()
        self.window.add_new_items([self.AddPayment])
        self.window.add_search_items([
            self.BillCheckSearch, self.PaymentCategories,
            self.PaymentFlowHistory
        ])
Example #5
0
 def _add_purchase_menus(self, app):
     group = get_accels('plugin.books')
     actions = [
         ('BookSearch', None, _(u'Book Search'), group.get('search_books'),
          None, self._on_BookSearch__activate),
         ('Publishers', None, _(u'Publishers ...'),
          group.get('search_publishers'), None,
          self._on_Publishers__activate),
     ]
     app.add_ui_actions(actions)
     app.window.add_search_items([app.BookSearch, app.Publishers],
                                 _('Books'))
Example #6
0
    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', None,
             _('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')),
            ('FinalizeProduction', Gtk.STOCK_APPLY, _('Finalize production...'),
             None,
             _('Finalize the selected production')),
            ('CancelProduction', Gtk.STOCK_CANCEL, _('Cancel production...'),
             None,
             _('Cancel 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", None,
             _("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)
        self.set_help_section(_("Production help"), 'app-production')
Example #7
0
 def _add_ecf_menu(self, app):
     group = get_accels('plugin.ecf')
     actions = [
         ('ReadMemory', None, _('Read Memory'), group.get('read_memory'),
          None, self._on_ReadMemory__activate),
         ('CancelLastDocument', None, _('Cancel Last Document'), None, None,
          self._on_CancelLastDocument__activate),
         ('Summary', None, _('Summary'), group.get('read_memory'), None,
          self._on_TillSummary__activate),
     ]
     app.add_ui_actions(actions)
     items = [
         app.Summary,
         app.ReadMemory,
     ]
     if sysparam.get_bool('ALLOW_CANCEL_LAST_COUPON'):
         items.insert(0, app.CancelLastDocument)
     app.window.add_extra_items(items, _('ECF'))
Example #8
0
 def create_actions(self):
     group = get_accels('app.services')
     actions = [
         # 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", None, _(u"Clients..."), group.get("search_clients")),
     ]
     self.services_ui = self.add_ui_actions(actions)
     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')
     self.set_help_section(_(u"Services help"), 'app-services')
Example #9
0
    def create_actions(self):
        group = get_accels('app.financial')
        actions = [
            ('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')),
            ('Delete', None, _('Delete...')),
            ("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)
        self.set_help_section(_("Financial help"), 'app-financial')

        user = api.get_current_user(self.store)
        if not user.profile.check_app_permission(u'admin'):
            self.set_sensitive([self.ConfigurePaymentMethods], False)
Example #10
0
    def _add_sale_menus(self, sale_app):
        group = get_accels('plugin.optical')
        actions = [
            ('OpticalMenu', None, _(u'Optical')),
            ('OpticalPreSale', None, _(u'Sale with work order...'),
             group.get('pre_sale'), None, self._on_OpticalPreSale__activate),
            ('OpticalMedicSearch', None, _(u'Medics...'),
             group.get('search_medics'), None,
             self._on_MedicsSearch__activate),
            ('OpticalMedicSaleItems', None, _(u'Medics sold items...'), None,
             None, self._on_MedicSaleItems__activate),
        ]
        sale_app.add_ui_actions(actions)

        # XXX: Is this really necessary? Looks the same as the regular sale with
        # work order
        #sale_app.window.add_new_items([sale_app.OpticalPreSale])

        sale_app.window.add_search_items([
            sale_app.OpticalMedicSearch,
            sale_app.OpticalMedicSaleItems,
        ], _('Optical'))
Example #11
0
    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')),
            ('ExportBills', None, _('Export bills...')),


            # 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(actions)
        self.set_help_section(_("Accounts receivable help"), 'app-receivable')

        self.window.add_print_items([self.PrintDocument, self.PrintReceipt])
        self.window.add_export_items([self.ExportBills])
        self.window.add_new_items([self.AddReceiving])
        self.window.add_search_items([self.BillCheckSearch,
                                      self.CardPaymentSearch,
                                      self.PaymentCategories,
                                      self.PaymentFlowHistory])
Example #12
0
    def create_actions(self):
        group = get_accels('app.stock')
        actions = [
            ("NewReceiving", None, _("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")),
            ("SearchBrandItems", None, _("Brand items..."),
             group.get('search_brand_items'),
             _("Search for brand items on stock")),
            ("SearchBrandItemsByBranch", None, _("Brand item by branch..."),
             group.get('search_brand_by_branch'),
             _("Search for brand items by branch on stock")),
            ("SearchBatchItems", None, _("Batch items..."),
             group.get('search_batch_items'),
             _("Search for batch items on stock")),
            ("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...")),
            ("SearchTransferItems", None, _("Transfer items...")),
            ("SearchReturnedItems", None, _("Returned items...")),
            ("SearchPendingReturnedSales", None,
             _("Pending returned sales...")),
            ("ProductMenu", None, _("Product")),
            ("PrintLabels", None, _("Print labels...")),
            ("ManageStock", None, _("Manage stock...")),
            ("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)

        toggle_actions = [
            ('StockPictureViewer', None, _('Picture viewer'),
             group.get('toggle_picture_viewer')),
        ]
        self.add_ui_actions(toggle_actions, 'ToggleActions')
        self.set_help_section(_("Stock help"), 'app-stock')
Example #13
0
    def create_actions(self):
        group = get_accels('app.sales')
        actions = [
            # File
            ("SaleQuote", None, _("Sale quote..."), '',
             _('Create a new quote for a sale')),
            ("WorkOrderQuote", None, _("Sale with work order..."), '',
             _('Create a new quote for a sale with work orders')),
            ("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", None, _("Products..."),
             group.get("search_products"), _("Search for products")),
            ("SearchService", None, _("Services..."),
             group.get("search_services"), _("Search for services")),
            ("SearchDelivery", None, _("Deliveries..."),
             group.get("search_deliveries"), _("Search for deliveries")),
            ("SearchClient", None, _("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")),
            ("ReturnedSaleSearch", None, _("Returned sales..."),
             group.get("returned_sales")),
            ("SearchUnconfirmedSaleItems", None,
             _("Unconfirmed sale items..."),
             group.get("search_reserved_product"),
             _("Search for unconfirmed sale items")),
            ("SearchClientsWithSale", None, _("Clients with sales..."), None,
             _("Search for regular clients")),
            ("SearchClientsWithCredit", None, _("Clients with credit..."),
             None, _("Search for clients that have credit")),
            ("SearchSoldItemsByClient", None, _("Sold items by client..."),
             None, _("Search for products sold by client")),
            ("SearchSoldItemsBySalesperson", None,
             _("Sold items by salesperson.."), None,
             _("Search for products sold by salesperson")),

            # Sale
            ("SaleMenu", None, _("Sale")),
            ("SalesCancel", None, _("Cancel...")),
            ("ChangeClient", Gtk.STOCK_EDIT, _("Change client...")),
            ("ChangeSalesperson", Gtk.STOCK_EDIT, _("Change salesperson...")),
            ("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)
        self.set_help_section(_("Sales help"), 'app-sales')
Example #14
0
    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")),
            ('Reconciliation', None, _('Purchase reconciliation...'),
             group.get('new_reconciliation')),
            ("CloseInConsignment", None, _("Close consigment...")),
            ("ExportFilizola", None, _("Export Filizola File...")),

            # Edit
            ("StockCost", None, _("_Stock cost...")),

            # Search
            ("Categories", None, _("Categories..."),
             group.get("search_categories")),
            ("Products", None, _("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", None, _("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)
        self.set_help_section(_("Purchase help"), 'app-purchase')
Example #15
0
    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")),
            ('NewWorkOrder', None, _("Work order"),
             group.get('new_work_order'), _("Add a new work order")),
            # 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', None, _("Show today"),
             group.get('show_today'), _("Show today")),
        ]
        self.calendar_ui = self.add_ui_actions(actions)
        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")),
            ('ClientBirthdaysEvents', None, _("Client Birthdays"),
             None, _("Show client birthdays in the list")),
            ('WorkOrderEvents', None, _("Work orders"),
             None, _("Show work orders in the list")),
        ]
        self.add_ui_actions(toggle_actions, 'ToggleActions')

        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'),
            client_birthdays=(self.ClientBirthdaysEvents, None, u'sales'),
            work_orders=(self.WorkOrderEvents, self.NewWorkOrder, u'services'),
        )

        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.set_state(GLib.Variant.new_boolean(events[event_name]))

            # Disable feature if user does not have acces to required
            # application
            if not user.profile.check_app_permission(app):
                view_action.set_state(GLib.Variant.new_boolean(False))
                self.set_sensitive([view_action], False)
                if new_action:
                    self.set_sensitive([new_action], False)

            view_action.connect('change-state', self._view_option_state_changed)
        self._update_events()