Vous voici sur le Git Rural du CRAW

Commit dc4e56a4 authored by Patrick Houben's avatar Patrick Houben

add pk context in templatetag

parent 18e53707
......@@ -16,7 +16,7 @@ plotly = "*"
uWSGI = "*"
pylint-django = "*"
xlwt = "*"
django-easy-pdf = "*"
django-easy-pdf = {git = "git://github.com/geolffreym/django-easy-pdf.git#egg=django-easy-pdf"}
django-ckeditor = "*"
six = "*"
django-request = "*"
......
......@@ -31,25 +31,7 @@ $ cd source # DO NOT FORGET!!!
```bash
(tresoferme) $ python manage.py check
```
If you get the following error:
```bash
File "/home/pat/.local/share/virtualenvs/tresoferme-NMZJAftp/lib/python3.6/site-packages/easy_pdf/rendering.py", line 12, in <module>
from django.utils.six import BytesIO
ModuleNotFoundError: No module named 'django.utils.six'
```
Error raised since [django3 features](https://github.com/nigma/django-easy-pdf/pull/73/files) is not yet integrated in latest version
Edit the file and change **Line 12**
```python
from django.utils.six import BytesIO
```
to
```python
from six import BytesIO
```
#### 4. run the shell source.accounts4sqlite.sh
```bash
......
......@@ -134,7 +134,7 @@ def show_client_supplier_href(context, inst):
else:
display_txt = round(solde, 0)
return {'solde': solde, 'inst': inst, 'display_txt': display_txt, 'ajd': ajd, 'url_list': url_list}
return {'solde': solde, 'display_txt': display_txt, 'ajd': ajd, 'url_list': url_list, 'pk': int(inst.id)}
@register.filter(name='lookup')
......
<!-- Inclusion tag defined in accounts/csstags -->
{% if url_list == "revenue_list" %}
{% if solde > 0 %}
<a href="{% url url_list %}?client={{ inst.id }}&payduedate={{ ajd }}&payflag=ToPay">{{ display_txt }}</a>
<a href="{% url url_list %}?client={{ pk }}&payduedate={{ ajd }}&payflag=ToPay">{{ display_txt }}</a>
{% else %}
<a href="{% url url_list %}?client={{ inst.id }}&payflag=ToPay">{{ display_txt }}</a>
<a href="{% url url_list %}?client={{ pk }}&payflag=ToPay">{{ display_txt }}</a>
{% endif %}
{% else %}
{% if solde > 0 %}
<a href="{% url url_list %}?supplier={{ inst.id }}&payduedate={{ ajd }}&payflag=ToPay">{{ display_txt }}</a>
<a href="{% url url_list %}?supplier={{ pk }}&payduedate={{ ajd }}&payflag=ToPay">{{ display_txt }}</a>
{% else %}
<a href="{% url url_list %}?supplier={{ inst.id }}&payflag=ToPay">{{ display_txt }}</a>
<a href="{% url url_list %}?supplier={{ pk }}&payflag=ToPay">{{ display_txt }}</a>
{% endif %}
{% endif %}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment