endi.views.estimations package

Submodules

endi.views.estimations.estimation module

Estimation views

Estimation datas edition :

date address customer object note mentions ….

Estimation line edition :

description quantity cost unity tva …

Estimation line group edition :

title description

Estimation discount edition

Estimation payment edition

class endi.views.estimations.estimation.EstimationAddView(context, request=None)

Bases : TaskAddView

Estimation add view context is a project or company

factory

alias de Estimation

get_api_url(_query: dict = {}) str
title = 'Nouveau devis'
class endi.views.estimations.estimation.EstimationAdminView(context, request=None)

Bases : BaseEditView

dbsession: DBSESSION
factory

alias de Estimation

request: Request
schema = <colanderalchemy.schema.SQLAlchemySchemaNode object at 140624121691856 (named )>

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

session: ISession
class endi.views.estimations.estimation.EstimationAttachInvoiceView(context, request=None)

Bases : BaseFormView

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).

buttons = (<deform.form.Button object>, <deform.form.Button object>)

Tuple of buttons or strings to pass to the form instance. Override in your derived class.

cancel_failure(appstruct)
cancel_success(appstruct)
dbsession: DBSESSION
redirect()
request: Request
schema = <endi.forms.tasks.estimation.InvoiceAttachSchema object at 140624121697168 (named )>

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

session: ISession
submit_success(appstruct)
class endi.views.estimations.estimation.EstimationDuplicateView(context, request=None)

Bases : TaskDuplicateView

dbsession: DBSESSION
label = 'le devis'
request: Request
session: ISession
class endi.views.estimations.estimation.EstimationEditView(context, request=None)

Bases : TaskEditView

children = []
discount_api_url()
get_js_app_options() dict
payment_lines_api_url()
route_name = '/estimations/{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”.

class endi.views.estimations.estimation.EstimationFilesView(context, request=None)

Bases : TaskFilesView

children = []
route_name = '/estimations/{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”.

class endi.views.estimations.estimation.EstimationGeneralView(context, request=None)

Bases : TaskGeneralView

children = []
file_route_name: str = '/estimations/{id}/files'
get_actions()
route_name: str = '/estimations/{id}/general'
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.estimations.estimation.EstimationPdfView(context, request=None)

Bases : TaskPdfView

class endi.views.estimations.estimation.EstimationPreviewView(context, request=None)

Bases : TaskPreviewView

children = []
route_name = '/estimations/{id}/preview'
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.estimations.estimation.EstimationSetMetadatasView(context, request=None)

Bases : TaskSetMetadatasView

dbsession: DBSESSION
request: Request
session: ISession
property title
endi.views.estimations.estimation.add_routes(config)

Add module’s specific routes

endi.views.estimations.estimation.estimation_genbusiness_view(context, request)

Business generation view : used in long handed workflows

Paramètres:

context (obj) – The current estimation

endi.views.estimations.estimation.estimation_geninv_view(context, request)

Invoice generation view : used in shorthanded workflow

Paramètres:

context (obj) – The current context (estimation)

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

endi.views.estimations.lists module

class endi.views.estimations.lists.CompanyEstimationList(*args, **kwargs)

Bases : GlobalEstimationList

dbsession: DBSESSION
filter_status(query, appstruct)

Filter the estimations by status

is_admin = False
property main_actions
request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624129636496 (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”.

with_draft = True
class endi.views.estimations.lists.GlobalEstimationList(*args, **kwargs)

Bases : BaseListView

add_template_vars = ('title', 'is_admin', 'with_draft', 'stream_actions', 'main_actions', 'more_actions')
dbsession: DBSESSION
default_direction = 'desc'
default_sort = 'date'
filter_auto_validated(query, appstruct)

Filter the estimations by doc types

filter_business_type_id(query, appstruct)
filter_company(query, appstruct)
filter_customer(query, appstruct)

filter estimations by customer

filter_date(query, appstruct)
filter_doctype(query, appstruct)

Filter the estimations by doc types

filter_internal_number(query, appstruct)
filter_signed_status(query, appstruct)

Filter estimations by signed status

filter_status(query, appstruct)

Filter the estimations by status

filter_ttc(query, appstruct)
is_admin = True
property main_actions
property more_actions
more_template_vars(response_dict)

Add template vars to the response dict

Paramètres:

result (obj) – A Sqla Query

Renvoie:

vars to pass to the template

Type renvoyé:

dict

query()

The main query, should be overrided by a subclass

request: Request
schema = <endi.forms.lists.BaseListsSchema object at 140624128360784 (named )>
session: ISession
sort_columns = {'company': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'customer': <sqlalchemy.orm.attributes.InstrumentedAttribute object>, 'date': <sqlalchemy.orm.attributes.InstrumentedAttribute object>}
stream_actions(document)
title = 'Devis de la CAE'
with_draft = False
endi.views.estimations.lists.add_views(config)

Add the views defined in this module

endi.views.estimations.lists.includeme(config)

endi.views.estimations.rest_api module

class endi.views.estimations.rest_api.EstimationAddRestView(context, request=None)

Bases : TaskAddRestView

Estimation Add Rest View, Company is the current context

GET /api/v1/companies/(company_id)/estimations/add?form_config=1

Returns configuration informations for Estimation add form

Paramètres de requête:
  • int – company_id (required) – The id of the company

POST /api/v1/companies/(company_id)/estimations/add

Add a new estimation

Paramètres de requête:
  • int – company_id (required) – The if of the company

dbsession: DBSESSION
factory

alias de Estimation

request: Request
session: ISession
class endi.views.estimations.rest_api.EstimationDiscountLineRestView(context, request=None)

Bases : DiscountLineRestView

after_flush(entry, edit, attributes)

Allows to modify datas after the main entry was flushed

HTTP POST and PUT calls

Paramètres:
  • entry – The instance added/edited

  • edit (bool) – Is it an edition view ?

  • attributes (dict) – The validated submitted data

dbsession: DBSESSION
on_delete()
pre_delete()
request: Request
session: ISession
class endi.views.estimations.rest_api.EstimationRestView(context, request=None)

Bases : TaskRestView

after_flush(entry, edit, attributes)

Allows to modify datas after the main entry was flushed

HTTP POST and PUT calls

Paramètres:
  • entry – The instance added/edited

  • edit (bool) – Is it an edition view ?

  • attributes (dict) – The validated submitted data

dbsession: DBSESSION
factory

alias de Estimation

get_schema(submitted)

Return the schema for Estimation add/edition

Paramètres:

submitted (dict) – The submitted datas

Renvoie:

A colander.Schema

pre_format(appstruct, edit=False)

Preformat the posted appstruct to handle Estimation specific mechanisms

request: Request
session: ISession
class endi.views.estimations.rest_api.EstimationSignedStatusRestView(context, request=None)

Bases : StatusView

check_allowed(status)

Check that the status change is allowed

Paramètres:

status (str) – The new status that should be affected

Type renvoyé:

bool

Raises:

Forbidden exception if the action isn’t allowed

redirect()

Redirect function to be used after status processing

status_process(status, params)

Definitively Set the status of the element

Paramètres:
  • status (str) – The new status that should be affected

  • params (dict) – The params that were transmitted by the pre_process

function

class endi.views.estimations.rest_api.EstimationStatusRestView(context, request=None)

Bases : TaskStatusView

get_parent_url()
post_valid_process(status, params)

Launched after the status is set to valid

Paramètres:
  • status (str) – The new status that should be affected

  • params (dict) – The params that were transmitted by the associated

State’s callback

state_manager_key = 'status'
validate()
class endi.views.estimations.rest_api.EstimationTaskLineGroupRestView(context, request=None)

Bases : TaskLineGroupRestView

after_flush(entry, edit, attributes)

Allows to modify datas after the main entry was flushed

HTTP POST and PUT calls

Paramètres:
  • entry – The instance added/edited

  • edit (bool) – Is it an edition view ?

  • attributes (dict) – The validated submitted data

dbsession: DBSESSION
on_delete()
pre_delete()
request: Request
session: ISession
class endi.views.estimations.rest_api.EstimationTaskLineRestView(context, request=None)

Bases : TaskLineRestView

after_flush(entry, edit, attributes)

Allows to modify datas after the main entry was flushed

HTTP POST and PUT calls

Paramètres:
  • entry – The instance added/edited

  • edit (bool) – Is it an edition view ?

  • attributes (dict) – The validated submitted data

dbsession: DBSESSION
on_delete()
pre_delete()
request: Request
session: ISession
class endi.views.estimations.rest_api.PaymentLineRestView(context, request=None)

Bases : BaseRestView

Rest views used to handle the estimation payment lines

context is en Estimation (collection level) or PaymentLine (item level)

Collection views

GET

Return all the items belonging to the parent task

POST

Add a new item

Item views

GET

Return the Item

PUT/PATCH

Edit the item

DELETE

Delete the item

after_flush(entry, edit, attributes)

Allows to modify datas after the main entry was flushed

HTTP POST and PUT calls

Paramètres:
  • entry – The instance added/edited

  • edit (bool) – Is it an edition view ?

  • attributes (dict) – The validated submitted data

collection_get()

View returning the task line groups attached to this estimation

dbsession: DBSESSION
get_schema(submitted)

Return the schema for PaymentLine add/edition

Paramètres:

submitted (dict) – The submitted datas

Renvoie:

A colander.Schema

on_delete()
post_format(entry, edit, attributes)

Associate a newly created element to the parent task

pre_delete()
request: Request
session: ISession
endi.views.estimations.rest_api.add_routes(config)

Add routes to the current configuration

Paramètres:

config (obj) – Pyramid config object

endi.views.estimations.rest_api.add_views(config)

Add views to the current configuration

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

endi.views.estimations.routes module

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

Module contents

endi.views.estimations.includeme(config)