04.02.26
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user