Commit dfc765f5 authored by Levy--Falk Hugo's avatar Levy--Falk Hugo Committed by chirac

Fais la distinction entre un baseinvoice avec et sans objet facture.

parent b137ddc5
......@@ -110,11 +110,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ v.datetime }}</td>
<td>
{% blocktrans with username=v.username number=v.version.object.number name=v.version.object.name %}{{ username }} has sold {{ number }}x {{ name }} to{% endblocktrans %}
<a href="{% url 'users:profil' v.version.object.facture.user_id %}">{{ v.version.object.facture.user.get_username }}</a>
{% blocktrans with username=v.username number=v.version.object.number name=v.version.object.name %}{{ username }} has sold {{ number }}x {{ name }}{% endblocktrans %}
{% with invoice=v.version.object.facture %}
{% if invoice|is_facture %}
{% trans " to" %}
<a href="{% url 'users:profil' v.version.object.facture.facture.user_id %}">{{ v.version.object.facture.facture.user.get_username }}</a>
{% if v.version.object.iscotisation %}
(<i>{% blocktrans with duration=v.version.object.duration %}+{{ duration }} months{% endblocktrans %}</i>)
{% endif %}
{% endif %}
{% endwith %}
</td>
{% can_edit_history %}
<td>
......
......@@ -19,7 +19,7 @@
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# 51 Franklin Street, Fifth Floor, Boston, MA 021}10-1301 USA.
"""logs.templatetags.logs_extra
A templatetag to get the class name for a given object
"""
......@@ -34,6 +34,10 @@ def classname(obj):
""" Returns the object class name """
return obj.__class__.__name__
@register.filter
def is_facture(baseinvoice):
"""Returns True if a baseinvoice has a `Facture` child."""
return hasattr(baseinvoice, 'facture')
@register.inclusion_tag('buttons/history.html')
def history_button(instance, text=False, html_class=True):
......
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