From 240f35af264979d826ecfc552751aef6a6c5dc3c Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Wed, 4 Feb 2026 15:18:06 +0100 Subject: [PATCH] 04.02.26 --- modules/purchase_trade/fee.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/purchase_trade/fee.py b/modules/purchase_trade/fee.py index 685993a..2521bf5 100755 --- a/modules/purchase_trade/fee.py +++ b/modules/purchase_trade/fee.py @@ -172,12 +172,13 @@ class Fee(ModelSQL,ModelView): return 'pay' def get_unit(self, name=None): - Lot = Pool().get('lot.lot') - if self.lots: - if self.lots[0].line: - return self.lots[0].line.unit - if self.lots[0].sale_line: - return self.lots[0].sale_line.unit + FeeLots = Pool().get('fee.lots') + fl = FeeLots.search(['fee','=',self.id]) + if fl: + if fl[0].lot.line: + return fl[0].lot.line.unit + if fl[0].lot.sale_line: + return fl[0].lot.sale_line.unit @classmethod @ModelView.button