Exemple #1
0
def abstract_add_contact(request, number,
                         form=persons.forms.contact.ContactForm,
                         template='persons/add_contact_form.html',
                        ):
    warnings.warn('cti.views.abstract_add_contact() is deprecated ; '
                  'use the class-based view CTIContactCreation instead.',
                  DeprecationWarning
                 )
    return generic.add_entity(request, form, template=template,
                              extra_initial={'phone': number},
                             )
Exemple #2
0
def abstract_add_invoice(request, form=invoice_forms.InvoiceCreateForm,
                         initial_status=constants.DEFAULT_DRAFT_INVOICE_STATUS,
                         submit_label=Invoice.save_label,
                        ):
    warnings.warn('billing.views.invoice.abstract_add_invoice() is deprecated ; '
                  'use the class-based view InvoiceCreation instead.',
                  DeprecationWarning
                 )
    return generic.add_entity(request, form,
                              extra_initial={'status': initial_status},
                              extra_template_dict={'submit_label': submit_label},
                             )
Exemple #3
0
def abstract_add_folder(
    request,
    form=f_forms.FolderForm,
    submit_label=Folder.save_label,
):
    warnings.warn(
        'documents.views.folder.abstract_add_folder() is deprecated ; '
        'use the class-based view FolderDetail instead.', DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #4
0
def abstract_add_graph(
    request,
    form=g_forms.GraphForm,
    submit_label=Graph.save_label,
):
    warnings.warn(
        'graphs.views.graph.abstract_dd_graph() is deprecated ; '
        'use the class-based view GraphCreation instead.', DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #5
0
def abstract_add_salesman(request, form=SalesManCreateForm,
                          submit_label=_('Save the salesman'),
                          template='persons/add_contact_form.html',
                         ):
    warnings.warn('commercial.views.salesman.abstract_add_salesman() is deprecated ; '
                  'use the class-based view SalesManCreation instead.',
                  DeprecationWarning
                 )
    return add_entity(request, form, template=template,
                      extra_template_dict={'title': _('Create a salesman'),
                                           'submit_label': submit_label,
                                          },
                     )
Exemple #6
0
def abstract_add_mailinglist(
    request,
    form=ml_forms.MailingListForm,
    submit_label=MailingList.save_label,
):
    warnings.warn(
        'emails.views.mailing_list.abstract_add_mailinglist() is deprecated ; '
        'use the class-based view MailingListCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #7
0
def abstract_add_campaign(
    request,
    form=camp_forms.CampaignCreateForm,
    submit_label=EmailCampaign.save_label,
):
    warnings.warn(
        'emails.views.campaign.abstract_add_campaign() is deprecated ; '
        'use the class-based view EmailCampaignCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #8
0
def abstract_add_strategy(
    request,
    form=forms.StrategyForm,
    submit_label=Strategy.save_label,
):
    warnings.warn(
        'commercial.views.strategy.abstract_add_strategy() is deprecated ; '
        'use the class-based view StrategyCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #9
0
def abstract_add_objective_pattern(
    request,
    form=forms.ObjectivePatternForm,
    submit_label=ActObjectivePattern.save_label,
):
    warnings.warn(
        'commercial.views.act.abstract_add_objective_pattern() is deprecated ; '
        'use the class-based view ActObjectivePatternCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #10
0
def abstract_add_event(
    request,
    form=event_forms.EventForm,
    submit_label=Event.save_label,
):
    warnings.warn(
        'events.views.abstract_add_event() is deprecated ; '
        'use the class-based view EventCreation instead.', DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_initial={'type': EventType.objects.first()},
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #11
0
def abstract_add_template(
    request,
    form=tpl_forms.EmailTemplateForm,
    submit_label=EmailTemplate.save_label,
):
    warnings.warn(
        'emails.views.mail.abstract_add_template() is deprecated ; '
        'use the class-based view EmailTemplateCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #12
0
def abstract_add_quote(
    request,
    form=quote_forms.QuoteCreateForm,
    initial_status=1,
    submit_label=Quote.save_label,
):
    warnings.warn(
        'billing.views.quote.abstract_view_quote() is deprecated ; '
        'use the class-based view QuoteCreation instead.', DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_initial={'status': initial_status},
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #13
0
def abstract_add_salesorder(
    request,
    form=order_forms.SalesOrderCreateForm,
    initial_status=1,
    submit_label=SalesOrder.save_label,
):
    warnings.warn(
        'billing.views.sales_order.abstract_add_salesorder() is deprecated ; '
        'use the class-based view SalesOrderCreation instead.',
        DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_initial={'status': initial_status},
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #14
0
def abstract_add_document(
    request,
    form=doc_forms.DocumentCreateForm,
    submit_label=Document.save_label,
):
    warnings.warn(
        'documents.views.document.abstract_add_document() is deprecated ; '
        'use the class-based view DocumentCreation instead.',
        DeprecationWarning)

    return generic.add_entity(
        request,
        form,
        extra_initial={'linked_folder': get_folder_model().objects.first()},
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #15
0
def abstract_add_act(
    request,
    form=forms.ActForm,
    submit_label=Act.save_label,
):
    warnings.warn(
        'commercial.views.act.abstract_add_act() is deprecated ; '
        'use the class-based view ActCreation instead.', DeprecationWarning)
    return generic.add_entity(
        request,
        form,
        extra_initial={
            'act_type': ActType.objects.first(),
            'segment': MarketSegment.objects.first(),
        },
        extra_template_dict={'submit_label': submit_label},
    )
Exemple #16
0
def organisation_add(request):
    return generic.add_entity(request, fake_forms.FakeOrganisationForm)