Ejemplo n.º 1
0
def get_all_userdatas_views():
    """
    Return view_class, route_name for all option configuration views in the
    userdatas module
    """
    yield get_model_admin_view(
        CaeSituationOption,
        js_requirements=admin_option_js,
    )
    for model in (
            ZoneOption,
            ZoneQualificationOption,
            StudyLevelOption,
            SocialStatusOption,
            ActivityTypeOption,
            PcsOption,
            PrescripteurOption,
            NonAdmissionOption,
            ParcoursStatusOption,
            MotifSortieOption,
            SocialDocTypeOption,
            TypeSortieOption,
    ):
        yield get_model_admin_view(model)
    yield TemplateList, 'templates', '/admin/templates.mako'
Ejemplo n.º 2
0
def get_all_userdatas_views():
    """
    Return view_class, route_name for all option configuration views in the
    userdatas module
    """
    yield get_model_admin_view(
        CaeSituationOption,
        js_requirements=admin_option_js,
    )
    for model in (
        ZoneOption,
        ZoneQualificationOption,
        StudyLevelOption,
        SocialStatusOption,
        ActivityTypeOption,
        PcsOption,
        PrescripteurOption,
        NonAdmissionOption,
        ParcoursStatusOption,
        MotifSortieOption,
        SocialDocTypeOption,
        TypeSortieOption,
    ):
        yield get_model_admin_view(model)
    yield TemplateList, 'templates', '/admin/templates.mako'
Ejemplo n.º 3
0
def include_receipts_views(config):
    """
    Add views for payments configuration
    """
    config.add_route("admin_receipts", "admin/receipts")

    all_views = [
        (
            MainReceiptsConfig,
            "admin_main_receipts",
            "/admin/main.mako",
        ),
        get_model_admin_view(BankAccount, r_path="admin_receipts"),
    ]

    for view, route_name, tmpl in all_views:
        config.add_route(route_name, "admin/" + route_name)
        config.add_admin_view(
            view,
            route_name=route_name,
            renderer=tmpl,
        )

    config.add_admin_view(
        make_enter_point_view(
            "admin_vente",
            all_views,
            u"Configuration comptables du module encaissements",
        ),
        route_name='admin_receipts'
    )
Ejemplo n.º 4
0
def includeme(config):
    """
    Configure route and views for userdatas management
    """
    for model in (
        CaeSituationOption,
        AntenneOption,
        ZoneOption,
        ZoneQualificationOption,
        StudyLevelOption,
        SocialStatusOption,
        EmployeeQualityOption,
        ActivityTypeOption,
        PcsOption,
        PrescripteurOption,
        NonAdmissionOption,
        ParcoursStatusOption,
        MotifSortieOption,
        SocialDocTypeOption,
        TypeSortieOption,
        TypeContratOption,
    ):
        view = get_model_admin_view(model, r_path=USERDATAS_URL)
        config.add_route(view.route_name, view.route_name)
        config.add_admin_view(view, parent=UserDatasIndexView)
Ejemplo n.º 5
0
def include_receipts_views(config):
    """
    Add views for payments configuration
    """
    config.add_route("admin_receipts", "admin/receipts")

    all_views = [
        (
            MainReceiptsConfig,
            "admin_main_receipts",
            "/admin/main.mako",
        ),
        get_model_admin_view(BankAccount, r_path="admin_receipts"),
    ]

    for view, route_name, tmpl in all_views:
        config.add_route(route_name, "admin/" + route_name)
        config.add_admin_view(
            view,
            route_name=route_name,
            renderer=tmpl,
        )

    config.add_admin_view(
        make_enter_point_view(
            "admin_vente",
            all_views,
            u"Configuration comptables du module encaissements",
        ),
        route_name='admin_receipts'
    )
Ejemplo n.º 6
0
def includeme(config):
    """
    Configure route and views for userdatas management
    """
    for model in (
            CaeSituationOption,
            AntenneOption,
            ZoneOption,
            ZoneQualificationOption,
            StudyLevelOption,
            SocialStatusOption,
            EmployeeQualityOption,
            ActivityTypeOption,
            PcsOption,
            PrescripteurOption,
            NonAdmissionOption,
            ParcoursStatusOption,
            MotifSortieOption,
            SocialDocTypeOption,
            TypeSortieOption,
            TypeContratOption,
    ):
        view = get_model_admin_view(model, r_path=USERDATAS_URL)
        config.add_route(view.route_name, view.route_name)
        config.add_admin_view(view, parent=UserDatasIndexView)
Ejemplo n.º 7
0
def includeme(config):
    """
    Include views and routes
    """
    config.add_route("admin_competences", "admin/competences")
    config.add_route("admin_competence_print", "admin/competences/print")
    config.add_view(
        admin_competence_index_view,
        route_name="admin_competences",
        renderer="admin/index.mako",
        permission="admin",
    )
    config.add_view(
        AdminCompetencePrintOutput,
        route_name="admin_competence_print",
        renderer="admin/main.mako",
        permission='admin',
    )

    for model in (CompetenceScale, CompetenceDeadline):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path='admin_competences',
        )
        config.add_route(route_name, "admin/competences/" + route_name)
        config.add_view(
            view,
            route_name=route_name,
            renderer=tmpl,
            permission="admin",
        )

    config.add_route(
        COMPETENCE_OPTION_ROUTE,
        "admin/competences/" + COMPETENCE_OPTION_ROUTE,
    )
    config.add_view(
        AdminCompetenceOption,
        route_name=COMPETENCE_OPTION_ROUTE,
        renderer=COMPETENCE_OPTION_TMPL,
        permission='admin',
    )

    config.add_route(
        COMPETENCE_REQ_ROUTE,
        "admin/competences/" + COMPETENCE_REQ_ROUTE,
    )
    config.add_view(
        AdminCompetenceRequirement,
        route_name=COMPETENCE_REQ_ROUTE,
        renderer=COMPETENCE_REQ_TMPL,
        permission='admin',
    )
Ejemplo n.º 8
0
def add_views(config):
    config.add_admin_view(
        ReceiptIndexView,
        parent=SaleIndexView,
    )
    config.add_admin_view(
        MainReceiptConfig,
        parent=ReceiptIndexView,
    )

    view = get_model_admin_view(BankAccount, r_path=RECEIPT_URL)
    config.add_route(view.route_name, view.route_name)
    config.add_admin_view(view, parent=ReceiptIndexView)
Ejemplo n.º 9
0
def add_views(config):
    config.add_admin_view(
        ReceiptIndexView,
        parent=SaleIndexView,
    )
    config.add_admin_view(
        MainReceiptConfig,
        parent=ReceiptIndexView,
    )

    view = get_model_admin_view(BankAccount, r_path=RECEIPT_URL)
    config.add_route(view.route_name, view.route_name)
    config.add_admin_view(view, parent=ReceiptIndexView)
Ejemplo n.º 10
0
    BaseConfigView,
)
from autonomie.forms.admin import (
    get_config_schema, )
from autonomie.models.expense import (
    ExpenseType,
    ExpenseKmType,
    ExpenseTelType,
)

(
    type_admin_class,
    TYPE_ROUTE,
    TYPE_TMPL,
) = get_model_admin_view(
    ExpenseType,
    r_path="admin_expense",
)
(
    kmtype_admin_class,
    KMTYPE_ROUTE,
    KMTYPE_TMPL,
) = get_model_admin_view(
    ExpenseKmType,
    r_path="admin_expense",
)
(
    teltype_admin_class,
    TELTYPE_ROUTE,
    TELTYPE_TTELPL,
) = get_model_admin_view(
    ExpenseTelType,
Ejemplo n.º 11
0
    WorkUnit,
    PaymentConditions,
)
from autonomie.models.payments import (
    PaymentMode, )

from autonomie.views.admin.tools import (
    get_model_admin_view, )
from autonomie.views.admin.sale import (
    SaleIndexView,
    SALE_URL,
)

logger = logging.getLogger(__name__)

BaseWorkUnitAdminView = get_model_admin_view(WorkUnit, r_path=SALE_URL)


class WorkUnitAdminView(BaseWorkUnitAdminView):
    disable = False


BasePaymentModeAdminView = get_model_admin_view(PaymentMode, r_path=SALE_URL)


class PaymentModeAdminView(BasePaymentModeAdminView):
    disable = False


PaymentConditionsAdminView = get_model_admin_view(
    PaymentConditions,
Ejemplo n.º 12
0
def includeme(config):
    """
        Add module's views
    """
    # Administration routes
    config.add_route("admin_index", "/admin")
    config.add_route("admin_main", "/admin/main")
    config.add_route("admin_tva", "/admin/tva")
    config.add_route("admin_paymentmode", "admin/paymentmode")
    config.add_route("admin_workunit", "admin/workunit")
    config.add_route("admin_expense", "admin/expense")
    config.add_route("admin_accompagnement", "admin/accompagnement")
    config.add_route("admin_activity", "admin/activity")
    config.add_route("admin_workshop", "admin/workshop")
    config.add_route("admin_cae", "admin/cae")

    config.add_view(
        index,
        route_name='admin_index',
        renderer='admin/index.mako',
        permission='admin',
    )

    config.add_view(
        AdminMain,
        route_name="admin_main",
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminTva,
        route_name='admin_tva',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminPaymentMode,
        route_name='admin_paymentmode',
        renderer="admin/main.mako",
        permission='admin',
    )

    for model in (PaymentConditions, CompanyActivity):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path="admin_index",
        )
        config.add_route(route_name, "admin/" + route_name)
        config.add_view(
            view,
            route_name=route_name,
            renderer=tmpl,
            permission="admin",
        )

    config.add_view(
        AdminWorkUnit,
        route_name='admin_workunit',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminExpense,
        route_name='admin_expense',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        admin_accompagnement_index_view,
        route_name='admin_accompagnement',
        renderer="admin/index.mako",
        permission='admin',
    )

    config.add_view(
        AdminActivities,
        route_name='admin_activity',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminWorkshop,
        route_name='admin_workshop',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminCae,
        route_name='admin_cae',
        renderer="admin/main.mako",
        permission="admin",
    )

    # User Datas view configuration
    config.add_route("admin_userdatas", "admin/userdatas")

    all_option_views = list(get_all_userdatas_views())
    for view, route_name, tmpl in all_option_views:
        config.add_route(route_name, "admin/" + route_name)
        config.add_view(
            view,
            route_name=route_name,
            renderer=tmpl,
            permission="admin",
        )

    config.add_route(
        'template',
        'admin/templates/{id}',
        traverse="templates/{id}",
    )

    config.add_view(
        TemplateDisableView,
        route_name='template',
        request_param='action=disable',
        permission='admin',
    )

    config.add_view(
        file_dl_view,
        route_name='template',
        permission='admin',
    )

    config.add_view(
        TemplateEditView,
        route_name='template',
        renderer='admin/template_edit.mako',
        request_param='action=edit',
        permission='admin',
    )

    config.add_view(
        TemplateUploadView,
        route_name='templates',
        renderer='admin/template_add.mako',
        request_param='action=new',
        permission='admin',
    )

    config.add_view(
        make_enter_point_view('admin_index', all_option_views,
                              u"Administration de la gestion sociale"),
        route_name="admin_userdatas",
        renderer='admin/index.mako',
        permission="admin",
    )

    # Hidden console view
    config.add_route("admin_console", "admin_console/")
    config.add_view(
        console_view,
        route_name="admin_console",
        renderer="admin/index.mako",
        permission="admin",
    )
Ejemplo n.º 13
0
def includeme(config):
    """
        Add module's views
    """
    # Administration routes
    config.add_route("admin_index", "/admin")
    config.add_route("admin_main", "/admin/main")
    config.add_route("admin_tva", "/admin/tva")
    config.add_route("admin_paymentmode", "admin/paymentmode")
    config.add_route("admin_workunit", "admin/workunit")
    config.add_route("admin_expense", "admin/expense")
    config.add_route("admin_accompagnement", "admin/accompagnement")
    config.add_route("admin_activity", "admin/activity")
    config.add_route("admin_workshop", "admin/workshop")
    config.add_route("admin_cae", "admin/cae")

    config.add_view(
        index,
        route_name='admin_index',
        renderer='admin/index.mako',
        permission='admin',
    )

    config.add_view(
        AdminMain,
        route_name="admin_main",
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminTva,
        route_name='admin_tva',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminPaymentMode,
        route_name='admin_paymentmode',
        renderer="admin/main.mako",
        permission='admin',
    )

    for model in (PaymentConditions, CompanyActivity):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path="admin_index",
        )
        config.add_route(route_name, "admin/" + route_name)
        config.add_view(
            view,
            route_name=route_name,
            renderer=tmpl,
            permission="admin",
        )

    config.add_view(
        AdminWorkUnit,
        route_name='admin_workunit',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminExpense,
        route_name='admin_expense',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        admin_accompagnement_index_view,
        route_name='admin_accompagnement',
        renderer="admin/index.mako",
        permission='admin',
    )

    config.add_view(
        AdminActivities,
        route_name='admin_activity',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminWorkshop,
        route_name='admin_workshop',
        renderer="admin/main.mako",
        permission='admin',
    )

    config.add_view(
        AdminCae,
        route_name='admin_cae',
        renderer="admin/main.mako",
        permission="admin",
    )

    # User Datas view configuration
    config.add_route("admin_userdatas", "admin/userdatas")

    all_option_views = list(get_all_userdatas_views())
    for view, route_name, tmpl in all_option_views:
        config.add_route(route_name, "admin/" + route_name)
        config.add_view(
            view,
            route_name=route_name,
            renderer=tmpl,
            permission="admin",
        )

    config.add_route(
        'template',
        'admin/templates/{id}',
        traverse="templates/{id}",
    )

    config.add_view(
        TemplateDisableView,
        route_name='template',
        request_param='action=disable',
        permission='admin',
    )

    config.add_view(
        file_dl_view,
        route_name='template',
        permission='admin',
    )

    config.add_view(
        TemplateEditView,
        route_name='template',
        renderer='admin/template_edit.mako',
        request_param='action=edit',
        permission='admin',
    )

    config.add_view(
        TemplateUploadView,
        route_name='templates',
        renderer='admin/template_add.mako',
        request_param='action=new',
        permission='admin',
    )

    config.add_view(
        make_enter_point_view(
            'admin_index',
            all_option_views,
            u"Administration de la gestion sociale"
        ),
        route_name="admin_userdatas",
        renderer='admin/index.mako',
        permission="admin",
    )

    # Hidden console view
    config.add_route("admin_console", "admin_console/")
    config.add_view(
        console_view,
        route_name="admin_console",
        renderer="admin/index.mako",
        permission="admin",
    )
Ejemplo n.º 14
0
from autonomie.models.payments import (
    PaymentMode,
)

from autonomie.views.admin.tools import (
    get_model_admin_view,
)
from autonomie.views.admin.sale import (
    SaleIndexView,
    SALE_URL,
)

logger = logging.getLogger(__name__)


BaseWorkUnitAdminView = get_model_admin_view(WorkUnit, r_path=SALE_URL)


class WorkUnitAdminView(BaseWorkUnitAdminView):
    disable = False


BasePaymentModeAdminView = get_model_admin_view(PaymentMode, r_path=SALE_URL)


class PaymentModeAdminView(BasePaymentModeAdminView):
    disable = False


PaymentConditionsAdminView = get_model_admin_view(
    PaymentConditions,
Ejemplo n.º 15
0
from autonomie.views import BaseFormView
from autonomie.views.admin.tools import (
    get_model_admin_view,
    add_link_to_menu,
)


logger = logging.getLogger(__name__)


(
    main_admin_class,
    COMPETENCE_OPTION_ROUTE,
    COMPETENCE_OPTION_TMPL,
) = get_model_admin_view(
    CompetenceOption,
    r_path='admin_competences',
)


class AdminCompetenceOption(main_admin_class):
    def before(self, form):
        if CompetenceScale.query().count() == 0:
            self.session.flash(
                u"Les barêmes doivent être configurer avant \
la grille de compétences."
            )
            raise HTTPFound(self.request.route_path("admin_competence_scale"))
        main_admin_class.before(self, form)


class AdminCompetencePrintOutput(BaseFormView):
Ejemplo n.º 16
0
from autonomie.views.admin.tools import (
    get_model_admin_view,
    BaseConfigView,
    BaseAdminIndexView,
)
from autonomie.views.admin.sale import (
    SALE_URL,
    SaleIndexView,
)

logger = logging.getLogger(__name__)
ACCOUNTING_URL = os.path.join(SALE_URL, 'accounting')
ACCOUNTING_CONFIG_URL = os.path.join(ACCOUNTING_URL, 'config')

BaseSaleAccountingCustomView = get_model_admin_view(
    CustomInvoiceBookEntryModule,
    r_path=ACCOUNTING_URL,
)


class SaleAccountingIndex(BaseAdminIndexView):
    title = u"Configuration comptable du module Vente"
    description = u"Configurer la génération des écritures de vente"
    route_name = ACCOUNTING_URL


class SaleAccountingConfigView(BaseConfigView):
    """
        Cae information configuration
    """
    title = u"Configuration des informations générales et des \
modules prédéfinis"
Ejemplo n.º 17
0
)
from autonomie.views.admin.accompagnement import (
    ACCOMPAGNEMENT_URL,
    AccompagnementIndexView,
)


COMPETENCE_URL = os.path.join(ACCOMPAGNEMENT_URL, 'competences')
COMPETENCE_PRINT_URL = os.path.join(COMPETENCE_URL, "print")


logger = logging.getLogger(__name__)


BaseCompetenceOptionView = get_model_admin_view(
    CompetenceOption,
    r_path=COMPETENCE_URL,
)
BaseCompetenceRequirementView = get_model_admin_view(
    CompetenceRequirement,
    r_path=COMPETENCE_URL,
)
CompetenceScaleView = get_model_admin_view(
    CompetenceScale,
    r_path=COMPETENCE_URL
)
CompetenceDeadlineView = get_model_admin_view(
    CompetenceDeadline,
    r_path=COMPETENCE_URL
)

Ejemplo n.º 18
0
    BaseConfigView,
    BaseAdminIndexView,
)
from autonomie.views.admin.sale import (
    SALE_URL,
    SaleIndexView,
)


logger = logging.getLogger(__name__)
ACCOUNTING_URL = os.path.join(SALE_URL, 'accounting')
ACCOUNTING_CONFIG_URL = os.path.join(ACCOUNTING_URL, 'config')


BaseSaleAccountingCustomView = get_model_admin_view(
    CustomInvoiceBookEntryModule,
    r_path=ACCOUNTING_URL,
)


class SaleAccountingIndex(BaseAdminIndexView):
    title = u"Configuration comptable du module Vente"
    description = u"Configurer la génération des écritures de vente"
    route_name = ACCOUNTING_URL


class SaleAccountingConfigView(BaseConfigView):
    """
        Cae information configuration
    """
    title = u"Configuration des informations générales et des \
modules prédéfinis"
Ejemplo n.º 19
0
)
from autonomie.views.admin.tools import (
    get_model_admin_view,
    BaseAdminFormView,
)


logger = logging.getLogger(__name__)


(
    main_admin_class,
    COMPETENCE_OPTION_ROUTE,
    COMPETENCE_OPTION_TMPL,
) = get_model_admin_view(
    CompetenceOption,
    r_path='admin_competences',
)
(
    req_admin_class,
    COMPETENCE_REQ_ROUTE,
    COMPETENCE_REQ_TMPL,
) = get_model_admin_view(
    CompetenceRequirement,
    r_path='admin_competences',
)


def get_requirement_admin_schema():
    schema = get_sequence_model_admin(
        CompetenceOption,
        excludes=('children',),
Ejemplo n.º 20
0
from autonomie.models.task import (
    TaskMention,
    WorkUnit,
    PaymentConditions,
)
from autonomie.models.payments import (
    PaymentMode, )

logger = logging.getLogger(__name__)

(
    mention_admin_class,
    mention_route,
    mention_tmpl,
) = get_model_admin_view(
    TaskMention,
    r_path="admin_vente",
)

(
    work_unit_admin_class,
    work_unit_route,
    work_unit_tmpl,
) = get_model_admin_view(
    WorkUnit,
    r_path="admin_vente",
)

(
    payment_mode_admin_class,
    payment_mode_route,
    payment_mode_tmpl,
Ejemplo n.º 21
0
from autonomie.utils.widgets import ViewLink
from autonomie.forms.admin import CompetencePrintConfigSchema
from autonomie.views import BaseFormView
from autonomie.views.admin.tools import (
    get_model_admin_view,
    add_link_to_menu,
)

logger = logging.getLogger(__name__)

(
    main_admin_class,
    COMPETENCE_OPTION_ROUTE,
    COMPETENCE_OPTION_TMPL,
) = get_model_admin_view(
    CompetenceOption,
    r_path='admin_competences',
)


class AdminCompetenceOption(main_admin_class):
    def before(self, form):
        if CompetenceScale.query().count() == 0:
            self.session.flash(u"Les barêmes doivent être configurer avant \
la grille de compétences.")
            raise HTTPFound(self.request.route_path("admin_competence_scale"))
        main_admin_class.before(self, form)


class AdminCompetencePrintOutput(BaseFormView):
    title = u"Configuration de la sortie imprimable"
    validation_msg = u"Vos données ont bien été enregistrées"
Ejemplo n.º 22
0
    PaymentConditions,
    BankAccount,
)
from autonomie.models.tva import (
    Tva,
)
from autonomie.models.treasury import CustomInvoiceBookEntryModule

logger = logging.getLogger(__name__)

(
    mention_admin_class,
    mention_route,
    mention_tmpl,
) = get_model_admin_view(
    TaskMention,
    r_path="admin_vente",
)

(
    work_unit_admin_class,
    work_unit_route,
    work_unit_tmpl,
) = get_model_admin_view(
    WorkUnit,
    r_path="admin_vente",
)

(
    payment_mode_admin_class,
    payment_mode_route,
    payment_mode_tmpl,
Ejemplo n.º 23
0
    get_model_admin_view,
    BaseAdminFormView,
    BaseAdminIndexView,
)
from autonomie.views.admin.accompagnement import (
    ACCOMPAGNEMENT_URL,
    AccompagnementIndexView,
)

COMPETENCE_URL = os.path.join(ACCOMPAGNEMENT_URL, 'competences')
COMPETENCE_PRINT_URL = os.path.join(COMPETENCE_URL, "print")

logger = logging.getLogger(__name__)

BaseCompetenceOptionView = get_model_admin_view(
    CompetenceOption,
    r_path=COMPETENCE_URL,
)
BaseCompetenceRequirementView = get_model_admin_view(
    CompetenceRequirement,
    r_path=COMPETENCE_URL,
)
CompetenceScaleView = get_model_admin_view(CompetenceScale,
                                           r_path=COMPETENCE_URL)
CompetenceDeadlineView = get_model_admin_view(CompetenceDeadline,
                                              r_path=COMPETENCE_URL)


def get_requirement_admin_schema():
    schema = get_sequence_model_admin(
        CompetenceOption,
        excludes=('children', ),
Ejemplo n.º 24
0
    PaymentConditions,
    BankAccount,
)
from autonomie.models.tva import (
    Tva,
)
from autonomie.models.treasury import CustomInvoiceBookEntryModule

logger = logging.getLogger(__name__)

(
    mention_admin_class,
    mention_route,
    mention_tmpl,
) = get_model_admin_view(
    TaskMention,
    r_path="admin_vente",
)

(
    work_unit_admin_class,
    work_unit_route,
    work_unit_tmpl,
) = get_model_admin_view(
    WorkUnit,
    r_path="admin_vente",
)

(
    payment_mode_admin_class,
    payment_mode_route,
    payment_mode_tmpl,
Ejemplo n.º 25
0
from autonomie.models.treasury import CustomInvoiceBookEntryModule
from autonomie.forms.admin import get_config_schema

from autonomie.views.admin.tools import (
    get_model_admin_view,
    BaseConfigView,
)

logger = logging.getLogger(__name__)

(
    custom_treasury_admin_class,
    custom_treasury_admin_route,
    custom_treasury_admin_tmpl,
) = get_model_admin_view(
    CustomInvoiceBookEntryModule,
    r_path='admin_vente_treasury',
)


class AdminVenteTreasuryMain(BaseConfigView):
    """
        Cae information configuration
    """
    title = u"Configuration des informations générales et des \
modules prédéfinis"

    description = u"Configuration du code journal et des modules prédéfinis \
(Export des factures, contribution à la CAE, RG Externe, RG Interne)"

    redirect_route_name = "admin_vente_treasury"
    validation_msg = u"Les informations ont bien été enregistrées"
Ejemplo n.º 26
0
)
from autonomie.forms.admin import (
    get_config_schema,
)
from autonomie.models.expense import (
    ExpenseType,
    ExpenseKmType,
    ExpenseTelType,
)

(
    type_admin_class,
    TYPE_ROUTE,
    TYPE_TMPL,
) = get_model_admin_view(
    ExpenseType,
    r_path="admin_expense",
)
(
    kmtype_admin_class,
    KMTYPE_ROUTE,
    KMTYPE_TMPL,
) = get_model_admin_view(
    ExpenseKmType,
    r_path="admin_expense",
)
(
    teltype_admin_class,
    TELTYPE_ROUTE,
    TELTYPE_TTELPL,
) = get_model_admin_view(
    ExpenseTelType,
Ejemplo n.º 27
0
def includeme(config):
    """
        Add module's views
    """
    # Configuration routes
    config.add_route("admin_index", "/admin")
    config.add_route("admin_main", "/admin/main")
    config.add_route("admin_accompagnement", "admin/accompagnement")
    config.add_route("admin_activity", "admin/activity")
    config.add_route("admin_workshop", "admin/workshop")
    config.add_route("admin_userdatas", "admin/userdatas")
    config.add_route("admin_console", "admin_console/")
    config.add_route(
        'template',
        'admin/templates/{id}',
        traverse="templates/{id}",
    )

    config.add_admin_view = functools.partial(
        config.add_view,
        permission='admin',
        renderer="admin/main.mako",
    )

    config.add_admin_view(
        index,
        route_name='admin_index',
    )

    config.add_admin_view(
        AdminMain,
        route_name="admin_main",
    )

    for model in (CompanyActivity, ):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path="admin_index",
        )
        config.add_route(route_name, "admin/" + route_name)
        config.add_admin_view(
            view,
            route_name=route_name,
            renderer=tmpl,
        )

    include_userdatas_views(config)

    config.add_admin_view(
        admin_accompagnement_index_view,
        route_name='admin_accompagnement',
    )

    config.add_admin_view(
        AdminActivities,
        route_name='admin_activity',
    )

    config.add_admin_view(
        AdminWorkshop,
        route_name='admin_workshop',
    )
    # Hidden console view
    config.add_admin_view(
        console_view,
        route_name="admin_console",
    )
Ejemplo n.º 28
0
def includeme(config):
    """
        Add module's views
    """
    # Configuration routes
    config.add_route("admin_index", "/admin")
    config.add_route("admin_main", "/admin/main")
    config.add_route("admin_accompagnement", "admin/accompagnement")
    config.add_route("admin_activity", "admin/activity")
    config.add_route("admin_workshop", "admin/workshop")
    config.add_route("admin_userdatas", "admin/userdatas")
    config.add_route("admin_console", "admin_console/")
    config.add_route(
        'template',
        'admin/templates/{id}',
        traverse="templates/{id}",
    )

    config.add_admin_view(
        admin_index_view,
        route_name='admin_index',
    )

    config.add_admin_view(
        AdminMain,
        route_name="admin_main",
    )

    for model in (CompanyActivity, ):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path="admin_index",
        )
        config.add_route(route_name, "admin/" + route_name)
        config.add_admin_view(
            view,
            route_name=route_name,
            renderer=tmpl,
        )

    include_userdatas_views(config)

    config.add_admin_view(
        admin_accompagnement_index_view,
        route_name='admin_accompagnement',
    )

    config.add_admin_view(
        AdminActivities,
        route_name='admin_activity',
    )

    config.add_admin_view(
        AdminWorkshop,
        route_name='admin_workshop',
    )
    # Hidden console view
    config.add_admin_view(
        console_view,
        route_name="admin_console",
    )
Ejemplo n.º 29
0
def includeme(config):
    """
        Add module's views
    """
    # Administration routes
    config.add_route("admin_index", "/admin")
    config.add_route("admin_main", "/admin/main")
    config.add_route("admin_tva", "/admin/tva")
    config.add_route("admin_paymentmode", "admin/paymentmode")
    config.add_route("admin_workunit", "admin/workunit")
    config.add_route("admin_expense", "admin/expense")
    config.add_route("admin_accompagnement", "admin/accompagnement")
    config.add_route("admin_activity", "admin/activity")
    config.add_route("admin_workshop", "admin/workshop")
    config.add_route("admin_cae", "admin/cae")
    config.add_route("admin_userdatas", "admin/userdatas")
    config.add_route("admin_console", "admin_console/")
    config.add_route(
        'template',
        'admin/templates/{id}',
        traverse="templates/{id}",
    )

    config.add_admin_view = functools.partial(
        config.add_view,
        permission='admin',
        renderer="admin/main.mako",
    )

    config.add_admin_view(
        index,
        route_name='admin_index',
    )

    config.add_admin_view(
        AdminMain,
        route_name="admin_main",
    )

    config.add_admin_view(
        AdminTva,
        route_name='admin_tva',
    )

    config.add_admin_view(
        AdminPaymentMode,
        route_name='admin_paymentmode',
    )

    for model in (PaymentConditions, CompanyActivity):
        view, route_name, tmpl = get_model_admin_view(
            model,
            r_path="admin_index",
        )
        config.add_route(route_name, "admin/" + route_name)
        config.add_admin_view(
            view,
            route_name=route_name,
            renderer=tmpl,
        )

    include_receipts_views(config)
    include_userdatas_views(config)

    config.add_admin_view(
        AdminWorkUnit,
        route_name='admin_workunit',
    )

    config.add_admin_view(
        AdminExpense,
        route_name='admin_expense',
    )

    config.add_admin_view(
        admin_accompagnement_index_view,
        route_name='admin_accompagnement',
    )

    config.add_admin_view(
        AdminActivities,
        route_name='admin_activity',
    )

    config.add_admin_view(
        AdminWorkshop,
        route_name='admin_workshop',
    )

    config.add_admin_view(
        AdminCae,
        route_name='admin_cae',
    )
    # Hidden console view
    config.add_admin_view(
        console_view,
        route_name="admin_console",
    )