add lots in list of erasures actions
This commit is contained in:
parent
6d722bb19f
commit
20ccb385d8
|
@ -676,6 +676,12 @@ class Device(Thing):
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def get_lots_for_template(self):
|
def get_lots_for_template(self):
|
||||||
|
if self.binding:
|
||||||
|
return self.binding.device.get_lots_for_template()
|
||||||
|
|
||||||
|
if not self.lots and hasattr(self, 'parent') and self.parent:
|
||||||
|
return self.parent.get_lots_for_template()
|
||||||
|
|
||||||
lots = []
|
lots = []
|
||||||
for lot in self.lots:
|
for lot in self.lots:
|
||||||
if lot.is_incoming:
|
if lot.is_incoming:
|
||||||
|
|
|
@ -187,9 +187,9 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ ac.device.serial_number.upper() }}
|
{{ ac.device.serial_number.upper() }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ac.device.my_partner.lots | length > 0 %}
|
{% if ac.device.get_lots_for_template() | length > 0 %}
|
||||||
<h6 class="d-inline">
|
<h6 class="d-inline">
|
||||||
{% for lot in ac.device.my_partner.get_lots_for_template() %}
|
{% for lot in ac.device.get_lots_for_template() %}
|
||||||
<span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
|
<span class="badge rounded-pill bg-light text-dark">{{ lot }}</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</h6>
|
</h6>
|
||||||
|
|
Reference in New Issue