From 776c1a616332bec90965f487ebacb62625b18492 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Fri, 25 Apr 2025 10:00:33 +0200 Subject: [PATCH] Split DealerDiscount to Order Section fix --- ext/custom-addons/tz_dealer_discount/models/invoice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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