fix problem with empty layout_category;

develop
Andreas Osim 2021-01-21 13:44:33 +01:00
parent 76822501eb
commit 09d23465c3
2 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@ class AccountInvoice(models.Model):
self.ensure_one() self.ensure_one()
res = [[]] res = [[]]
for category, lines in groupby(self.invoice_line_ids.sorted(key=lambda s: s.layout_category_id.name), lambda l: l.layout_category_id): for category, lines in groupby(self.invoice_line_ids.sorted(key=lambda s: s.layout_category_id.name or ''), lambda l: l.layout_category_id):
# If last added category induced a pagebreak, this one will be on a new page # If last added category induced a pagebreak, this one will be on a new page
if res[-1] and res[-1][-1]['pagebreak']: if res[-1] and res[-1][-1]['pagebreak']:
res.append([]) res.append([])

View File

@ -201,15 +201,15 @@
<br/> <br/>
</span> </span>
<span t-if="shorttext"> <span t-if="shorttext">
<span> <span t-if="invoice_line.lot_id and invoice_line.lot_id.short_text">
<strong>Kurztext:</strong> <strong>Kurztext:</strong>
<span t-if="invoice_line.lot_id.short_text" t-field="invoice_line.lot_id.short_text"/> <span t-field="invoice_line.lot_id.short_text"/>
</span> </span>
<span> <span t-else="">
<span t-if="not invoice_line.lot_id.short_text" t-field="invoice_line.name"/> <span t-field="invoice_line.name"/>
</span> </span>
</span> </span>
<span t-if="not shorttext"> <span t-else="">
<span t-field="invoice_line.name"/> <span t-field="invoice_line.name"/>
</span> </span>
<span t-if="invoice_line.product_id.tracking=='serial'"> <span t-if="invoice_line.product_id.tracking=='serial'">