main #7
@@ -495,6 +495,11 @@ class Line(metaclass=PoolMeta):
|
|||||||
def default_inherit_cer(cls):
|
def default_inherit_cer(cls):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_matched_lines(self):
|
||||||
|
if self.lots:
|
||||||
|
LotQt = Pool().get('lot.qt')
|
||||||
|
return LotQt.search([('lot_p','=',self.lots[0].id),('lot_s','>',0)])
|
||||||
|
|
||||||
def get_date(self,trigger_event):
|
def get_date(self,trigger_event):
|
||||||
date = None
|
date = None
|
||||||
if self.estimated_date:
|
if self.estimated_date:
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ class ValuationBase(ModelSQL):
|
|||||||
|
|
||||||
return price_lines
|
return price_lines
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def group_fees_by_type_supplier(cls,line,fees):
|
def group_fees_by_type_supplier(cls,line,fees):
|
||||||
grouped = defaultdict(list)
|
grouped = defaultdict(list)
|
||||||
@@ -284,8 +283,11 @@ class ValuationBase(ModelSQL):
|
|||||||
Date = Pool().get('ir.date')
|
Date = Pool().get('ir.date')
|
||||||
Currency = Pool().get('currency.currency')
|
Currency = Pool().get('currency.currency')
|
||||||
FeeLots = Pool().get('fee.lots')
|
FeeLots = Pool().get('fee.lots')
|
||||||
|
#if line is matched with sale_line we should add the open sale side
|
||||||
for lot in line.lots or []:
|
sale_lines = line.get_matched_lines()
|
||||||
|
sale_open_lots = [s.lot_s for s in sale_lines]
|
||||||
|
all_lots = (line.lots or []) + sale_open_lots
|
||||||
|
for lot in all_lots:
|
||||||
fl = FeeLots.search([('lot', '=', lot.id)])
|
fl = FeeLots.search([('lot', '=', lot.id)])
|
||||||
if not fl:
|
if not fl:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user