Linkage template
This commit is contained in:
@@ -1510,21 +1510,46 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
return unique
|
||||
|
||||
def _get_report_linkage_lots(self):
|
||||
lots = self._get_report_physical_lots()
|
||||
if lots:
|
||||
return lots
|
||||
return self._report_unique_records(
|
||||
getattr(move, 'lot', None)
|
||||
for move in (self.incoming_moves or self.moves or []))
|
||||
|
||||
@staticmethod
|
||||
def _report_linkage_lot_purchase_line(lot):
|
||||
line = getattr(lot, 'line', None)
|
||||
if line:
|
||||
return line
|
||||
get_virtual_lot = getattr(lot, 'getVlot_p', None)
|
||||
if callable(get_virtual_lot):
|
||||
try:
|
||||
virtual_lot = get_virtual_lot()
|
||||
except (IndexError, AttributeError):
|
||||
virtual_lot = None
|
||||
return getattr(virtual_lot, 'line', None)
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def _report_linkage_lot_sale_line(lot):
|
||||
line = getattr(lot, 'sale_line', None)
|
||||
if line:
|
||||
return line
|
||||
get_virtual_lot = getattr(lot, 'getVlot_s', None)
|
||||
if callable(get_virtual_lot):
|
||||
try:
|
||||
virtual_lot = get_virtual_lot()
|
||||
except (IndexError, AttributeError):
|
||||
virtual_lot = None
|
||||
return getattr(virtual_lot, 'sale_line', None)
|
||||
return None
|
||||
|
||||
def _get_report_linkage_purchase_lines(self):
|
||||
return self._report_unique_records(
|
||||
getattr(lot, 'line', None)
|
||||
self._report_linkage_lot_purchase_line(lot)
|
||||
for lot in self._get_report_linkage_lots())
|
||||
|
||||
def _get_report_linkage_sale_lines(self):
|
||||
return self._report_unique_records(
|
||||
getattr(lot, 'sale_line', None)
|
||||
self._report_linkage_lot_sale_line(lot)
|
||||
for lot in self._get_report_linkage_lots())
|
||||
|
||||
def _get_report_linkage_purchase(self):
|
||||
@@ -1866,12 +1891,18 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
|
||||
@property
|
||||
def report_linkage_desk(self):
|
||||
product = self._get_report_linkage_product()
|
||||
purchase_lines = self._get_report_linkage_purchase_lines()
|
||||
product = (
|
||||
getattr(purchase_lines[0], 'product', None)
|
||||
if purchase_lines else self._get_report_linkage_product())
|
||||
return self._report_rec_name(product)
|
||||
|
||||
@property
|
||||
def report_linkage_book(self):
|
||||
product = self._get_report_linkage_product()
|
||||
purchase_lines = self._get_report_linkage_purchase_lines()
|
||||
product = (
|
||||
getattr(purchase_lines[0], 'product', None)
|
||||
if purchase_lines else self._get_report_linkage_product())
|
||||
code = getattr(product, 'code', None) if product else ''
|
||||
period = self.report_linkage_strategy
|
||||
return ' '.join(part for part in [code, period] if part)
|
||||
@@ -1880,7 +1911,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
def report_linkage_strategy(self):
|
||||
for line in (
|
||||
self._get_report_linkage_purchase_lines()
|
||||
+ self._get_report_linkage_sale_lines()):
|
||||
or self._get_report_linkage_sale_lines()):
|
||||
strategies = list(getattr(line, 'mtm', []) or [])
|
||||
if strategies:
|
||||
strategy = getattr(strategies[0], 'strategy', None) or strategies[0]
|
||||
|
||||
@@ -1150,9 +1150,9 @@
|
||||
<style:style style:name="LKFillW" style:family="table-column"><style:table-column-properties style:column-width="7.4cm"/></style:style>
|
||||
<style:style style:name="LKWideLineW" style:family="table-column"><style:table-column-properties style:column-width="21.7cm"/></style:style>
|
||||
<style:style style:name="LKRestW" style:family="table-column"><style:table-column-properties style:column-width="14.8cm"/></style:style>
|
||||
<style:style style:name="LKSumGroupW" style:family="table-column"><style:table-column-properties style:column-width="2.0cm"/></style:style>
|
||||
<style:style style:name="LKSumCostW" style:family="table-column"><style:table-column-properties style:column-width="4.7cm"/></style:style>
|
||||
<style:style style:name="LKSumAmountW" style:family="table-column"><style:table-column-properties style:column-width="2.65cm"/></style:style>
|
||||
<style:style style:name="LKSumGroupW" style:family="table-column"><style:table-column-properties style:column-width="1.65cm"/></style:style>
|
||||
<style:style style:name="LKSumCostW" style:family="table-column"><style:table-column-properties style:column-width="4.75cm"/></style:style>
|
||||
<style:style style:name="LKSumAmountW" style:family="table-column"><style:table-column-properties style:column-width="2.8cm"/></style:style>
|
||||
<style:style style:name="LKMoveTypeW" style:family="table-column"><style:table-column-properties style:column-width="1.15cm"/></style:style>
|
||||
<style:style style:name="LKMoveRefW" style:family="table-column"><style:table-column-properties style:column-width="5.6cm"/></style:style>
|
||||
<style:style style:name="LKMoveCounterW" style:family="table-column"><style:table-column-properties style:column-width="4.5cm"/></style:style>
|
||||
@@ -1180,8 +1180,8 @@
|
||||
<style:style style:name="LKDetCounterW" style:family="table-column"><style:table-column-properties style:column-width="5.6cm"/></style:style>
|
||||
<style:style style:name="LKDetSourceW" style:family="table-column"><style:table-column-properties style:column-width="4.2cm"/></style:style>
|
||||
<style:style style:name="LKDetUnitW" style:family="table-column"><style:table-column-properties style:column-width="3.1cm"/></style:style>
|
||||
<style:style style:name="LKDetQtyW" style:family="table-column"><style:table-column-properties style:column-width="2.35cm"/></style:style>
|
||||
<style:style style:name="LKDetAmountW" style:family="table-column"><style:table-column-properties style:column-width="3.65cm"/></style:style>
|
||||
<style:style style:name="LKDetQtyW" style:family="table-column"><style:table-column-properties style:column-width="2.55cm"/></style:style>
|
||||
<style:style style:name="LKDetAmountW" style:family="table-column"><style:table-column-properties style:column-width="3.75cm"/></style:style>
|
||||
<style:style style:name="LKSigW" style:family="table-column"><style:table-column-properties style:column-width="6.975cm"/></style:style>
|
||||
<style:style style:name="LKTitleRow" style:family="table-row"><style:table-row-properties style:min-row-height="0.46cm"/></style:style>
|
||||
<style:style style:name="LKHeadRow" style:family="table-row"><style:table-row-properties style:min-row-height="0.48cm"/></style:style>
|
||||
@@ -1202,15 +1202,15 @@
|
||||
<style:style style:name="LKHeadValue" style:family="paragraph"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%"/><style:text-properties style:font-name="Arial" fo:font-size="8.5pt"/></style:style>
|
||||
<style:style style:name="LKSectionText" style:family="paragraph"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%"/><style:text-properties style:font-name="Arial" fo:font-size="10pt" fo:font-weight="bold"/></style:style>
|
||||
<style:style style:name="LKCell" style:family="paragraph"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" fo:line-height="100%"/><style:text-properties style:font-name="Arial" fo:font-size="8.5pt"/></style:style>
|
||||
<style:style style:name="LKCellRight" style:family="paragraph" style:parent-style-name="LKCell"><style:paragraph-properties fo:text-align="end"/></style:style>
|
||||
<style:style style:name="LKCellRight" style:family="paragraph" style:parent-style-name="LKCell"><style:paragraph-properties fo:text-align="end"/><style:text-properties style:font-name="Arial" fo:font-size="8.5pt"/></style:style>
|
||||
<style:style style:name="LKCellCenter" style:family="paragraph" style:parent-style-name="LKCell"><style:paragraph-properties fo:text-align="center"/></style:style>
|
||||
<style:style style:name="LKBold" style:family="paragraph" style:parent-style-name="LKCell"><style:text-properties style:font-name="Arial" fo:font-size="8.5pt" fo:font-weight="bold"/></style:style>
|
||||
<style:style style:name="LKBoldRight" style:family="paragraph" style:parent-style-name="LKBold"><style:paragraph-properties fo:text-align="end"/></style:style>
|
||||
<style:style style:name="LKBoldRight" style:family="paragraph" style:parent-style-name="LKBold"><style:paragraph-properties fo:text-align="end"/><style:text-properties style:font-name="Arial" fo:font-size="8.5pt" fo:font-weight="bold"/></style:style>
|
||||
<style:style style:name="LKSignatureName" style:family="paragraph"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/><style:text-properties style:font-name="Arial" fo:font-size="26pt"/></style:style>
|
||||
<style:style style:name="LKSignatureSmall" style:family="paragraph"><style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm"/><style:text-properties style:font-name="Arial" fo:font-size="11pt"/></style:style>
|
||||
|
||||
|
||||
<style:style style:name="LKSummaryTable" style:family="table"><style:table-properties style:width="11.15cm" table:align="left"/></style:style>
|
||||
<style:style style:name="LKSummaryTable" style:family="table"><style:table-properties style:width="12.0cm" table:align="left"/></style:style>
|
||||
<style:style style:name="LKInfoGapW" style:family="table-column"><style:table-column-properties style:column-width="7.05cm"/></style:style>
|
||||
<style:style style:name="LKInfoLineW" style:family="table-column"><style:table-column-properties style:column-width="7.75cm"/></style:style>
|
||||
<style:style style:name="LKZeroRow" style:family="table-row"><style:table-row-properties style:min-row-height="0.01cm"/></style:style>
|
||||
|
||||
Reference in New Issue
Block a user