endi.views.business package

Submodules

endi.views.business.business module

class endi.views.business.business.BusinessEditView(context, request=None)

Bases : BaseEditView, TreeMixin

before(form)

Performs some processing on the form prior to rendering.

By default, this method does nothing. Override this method in your dervived class to modify the form. Your function will be executed immediately after instansiating the form instance in __call__() (thus before obtaining widget resources, considering buttons, or rendering).

children = []
dbsession: DBSESSION
redirect(appstruct)
request: Request
route_name = '/businesses/{id}'
schema = <colanderalchemy.schema.SQLAlchemySchemaNode object at 140624296215248 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

class endi.views.business.business.BusinessOverviewView(*args, **kw)

Bases : BaseView, TreeMixin

Single business view

children = []
current()

Return A POSTButton for adding estimations

estimation_add_url()

Build the estimation add url

Type renvoyé:

str

Returns links used for invoicing

route_name = '/businesses/{id}/overview'

Build a link used to initialize the business invoicing mode

property title

Return the page title both for the view and for the breadcrumb

property tree_is_visible

Check if this node should be displayed in the breadcrumb tree

property tree_url
class endi.views.business.business.BusinessProgressInvoicingAddView(context, request=None)

Bases : BaseFormView

Specific invoice add view

dbsession: DBSESSION
request: Request
schema = <endi.forms.progress_invoicing.NewInvoiceSchema object at 140624296216016 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
submit_success(appstruct)
title = 'Nouvelle facture'
class endi.views.business.business.BusinessSwitchInvoicingModeView(context, request=None)

Bases : BaseView

endi.views.business.business.business_entry_point_view(context, request)

Project entry point view only redirects to the most appropriate page

endi.views.business.business.close_business_view(context, request)

View used to close a Business

Return the appropriate link for invoice generation

endi.views.business.business.includeme(config)
endi.views.business.business.invoice_all_url(business, request)

Build the url used to generate all invoices

Type renvoyé:

str

endi.views.business.business.progress_invoicing_url(business, request)

Build the progress invoicing switch url

Type renvoyé:

str

endi.views.business.estimation module

class endi.views.business.estimation.BusinessEstimationList(*args, **kwargs)

Bases : CompanyEstimationList, TreeMixin

add_template_vars = ('title', 'is_admin', 'with_draft', 'add_url')
property add_url
children = []
dbsession: DBSESSION
filter_business(query, appstruct)
request: Request
route_name = '/businesses/{id}/estimations'
schema = <endi.forms.lists.BaseListsSchema object at 140624128367760 (named )>
session: ISession
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

endi.views.business.estimation.add_estimation_view(context, request)

View used to add an estimation to the current business

endi.views.business.estimation.includeme(config)

endi.views.business.expense module

class endi.views.business.expense.AbstractLinkToLineView(context, request=None)

Bases : BaseFormView

Abstract view to link instances of some line-ish model to a Business The following properties must be defined by inheritor:

  • schema: the schema for model selection

  • model: the model class

  • success_msg_singular: the message to flash to the user after sucessfuly linking one line

  • success_msg_plural: the message to flash to the user after sucessfuly linking several lines

dbsession: DBSESSION
redirect()
request: Request
session: ISession
submit_failure(appstruct)

Called by default when we failed to submit the values We add a token here for forms that are collapsed by default to keep them open if there is an error

submit_success(appstruct)
class endi.views.business.expense.BusinessExpensesHybridListView(context, request=None)

Bases : BaseView, TreeMixin

Lists both expenses and supplier invoices

add_template_vars = ('title', 'expense_lines', 'supplier_invoice_lines', 'link_to_expense_form', 'link_to_supplier_invoice_line_form', 'get_unlink_line_link')
children = []
route_name = '/businesses/{id}/expenses'
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

class endi.views.business.expense.ExpenseSelectionSchema(*args, **kw)

Bases : Schema

Multi-selection Expense Line mapping schema

class endi.views.business.expense.LinkToExpenseView(context, request=None)

Bases : AbstractLinkToLineView

dbsession: DBSESSION
model

alias de BaseExpenseLine

request: Request
schema = <endi.views.business.expense.ExpenseSelectionSchema object at 140624128323728 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
success_msg_plural = "Les dépenses ont bien été rattachées à l'affaire"
success_msg_singular = "La dépense a bien été rattachée à l'affaire"
class endi.views.business.expense.LinkToSupplierInvoiceLineView(context, request=None)

Bases : AbstractLinkToLineView

dbsession: DBSESSION
model

alias de SupplierInvoiceLine

request: Request
schema = <endi.views.business.expense.SupplierInvoiceLineSelectionSchema object at 140624128324688 (named )>

Colander schema instance to be used to create the form instance. Provide your schema in your derived class.

session: ISession
success_msg_plural = "Les lignes ont bien été rattachées à l'affaire"
success_msg_singular = "La ligne a bien été rattachée à l'affaire"
class endi.views.business.expense.SupplierInvoiceLineSelectionSchema(*args, **kw)

Bases : Schema

Multi-selection SupplierInvoiceLine Mapping schema.

class endi.views.business.expense.UnlinkLineView(context, request=None)

Bases : BaseView

redirect()
Paramètres:

entity – the entity we want to link to

endi.views.business.expense.includeme(config)

endi.views.business.files module

Attached files related views

class endi.views.business.files.BusinessFileAddView(*args, **kw)

Bases : ProjectFileAddView

children = []
dbsession: DBSESSION
request: Request
route_name = '/businesses/{id}/addfile'
session: ISession
class endi.views.business.files.BusinessFilesView(context, request=None)

Bases : ProjectFilesView

children = []
get_project_id()
route_name = '/businesses/{id}/files'
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

endi.views.business.files.includeme(config)

endi.views.business.invoice module

endi.views.business.layout module

class endi.views.business.layout.BusinessLayout(context, request)

Bases : DefaultLayout

Layout for business related pages

Provide the main page structure for project view

property businessmenu
property close_button
property edit_url
endi.views.business.layout.includeme(config)

endi.views.business.lists module

class endi.views.business.lists.BusinessListTools

Bases : object

filter_bpf_filled(query, appstruct)

Double behaviour : - if a year is selected, check bpf_filled for that given year (see

filter_invoicing_year)

  • else check global bpf_filled indicator

filter_business_type_id(query, appstruct)
filter_company_id(query, appstruct)
filter_customer_id(query, appstruct)
filter_include_closed(query, appstruct)
filter_invoicing_year(query, appstruct)
query()
schema = <endi.forms.lists.BaseListsSchema object at 140624127188688 (named )>
class endi.views.business.lists.GlobalBusinessListView(*args, **kwargs)

Bases : BusinessListTools, BaseListView

View listing businesses »

Status Company Customers (?) CA Actions

add_template_vars = ('stream_columns', 'stream_actions')
is_admin = True
stream_actions(item)
stream_columns(item)
title = 'Liste des affaires de la CAE'
endi.views.business.lists.includeme(config)

endi.views.business.py3o module

Business templates related views

class endi.views.business.py3o.BusinessFileGeneration(context, request=None)

Bases : BaseView, TreeMixin

children = []
default_context_task_id()

Return the last estimation as default context for template generation

help_message = '\n    Vous pouvez générer et télécharger des documents modèles définis\n    par la coopérative qui seront pré-remplis avec vos coordonnées et\n    celles du client.'
py3o_action_view(business_type_id, file_type_id, context_task_id)
property title

str(object=””) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to “strict”.

property tree_url
endi.views.business.py3o.get_key_from_genshi_error(err)

Genshi raises an UndefinedError, but doesn’t store the key name in the Exception object We get the missing key from the resulting message

endi.views.business.py3o.includeme(config)

endi.views.business.rest_api module

class endi.views.business.rest_api.BusinessRestView(context, request=None)

Bases : RestListMixinClass, BaseRestView

Businesses REST view, scoped to company

GET : return list of businesses (company should be provided as context)

dbsession: DBSESSION
filter_customer_id(query, appstruct)
filter_project_id(query, appstruct)
list_schema = <endi.forms.project.business.APIBusinessListSchema object at 140624124493072 (named )>
query()

The main query, should be overrided by a subclass

request: Request
session: ISession
endi.views.business.rest_api.business_py3o_list_view(context, request)

Return a list of available templates for a given business

endi.views.business.rest_api.includeme(config)

endi.views.business.routes module

endi.views.business.routes.includeme(config)

Module contents

endi.views.business.includeme(config)