diff --git a/project/customer/views/clients.py b/project/customer/views/clients.py index 49959c1..cfae48f 100644 --- a/project/customer/views/clients.py +++ b/project/customer/views/clients.py @@ -46,6 +46,7 @@ def clients_add(request): if form.is_valid(): new_client = form.save(commit=False) new_client.user = request.user + new_client.company = request.user.profile new_client.save() return redirect(success_url) else: diff --git a/project/templates/docs/parts/form_field_client.html b/project/templates/docs/parts/form_field_client.html index 2376e68..8985f28 100644 --- a/project/templates/docs/parts/form_field_client.html +++ b/project/templates/docs/parts/form_field_client.html @@ -10,7 +10,7 @@ no_clear_after - не добавлять очистку float после бло {{ label|default:"Контрагент" }}:{% if required %} *{% endif %}
{{ field }} - + Добавить контрагента