diff --git a/ext/custom-addons/tz_dealer_discount/models/invoice.py b/ext/custom-addons/tz_dealer_discount/models/invoice.py index c5d06f65..f68072df 100644 --- a/ext/custom-addons/tz_dealer_discount/models/invoice.py +++ b/ext/custom-addons/tz_dealer_discount/models/invoice.py @@ -118,10 +118,11 @@ class Invoice(models.Model): # 'sequence': last_sequence, # }) + discount_prefix = discount_text for oref, dpos in dlines.items(): print("%s: %d,pos: %s" % (oref, dline['amount'], ",".join(dline['pos']))) - discount_text += "Auftrag: "+oref - discount_text += "Position:"+";".join(dpos['pos']) + discount_text = discount_prefix + "Auftrag: "+oref + discount_text += "\n Rechnungs-Position: "+";".join(dpos['pos']) last_inv_line = self.env['account.invoice.line'].search([('invoice_id', '=', invoice.id)], order='sequence desc', limit=1) last_sequence = last_inv_line.sequence + 1 if last_inv_line else 99999