Commit 67cb642b authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_base: check more tax condition and display correcly cell resource reference

parent ac36a0d8
......@@ -94,7 +94,8 @@ def getTaxLineList(order):
order.contentValues(portal_type=order.getPortalTaxMovementTypeList())
if line.getTotalPrice()]
for line in order.Base_getSpecialisedAggregatedAmountList():
if any(line.isMemberOf(tax_use) for tax_use in tax_use_list):
#if any(line.isMemberOf(tax_use) for tax_use in tax_use_list):
if any(line.isMemberOf(tax_use) for tax_use in tax_use_list) or line.getTradePhase() == "trade/tax":
tax_line_list.append(line)
tax_line_list.sort(key=lambda line:line.getTitle())
return tax_line_list
......@@ -146,12 +147,15 @@ for line in getSubLineList(context):
'specialise_title': '',
}
else:
line_reference = line.getResource() and line.getResourceValue().getReference() or ''
if line.getPortalType().endswith('Cell'):
display_id = 'translated_title'
if request.get('international_form'):
display_id = 'title'
variation_description = ', '.join([x[0] for x in line.getVariationCategoryItemList(display_id=display_id)])
desc = ('%s %s' % (desc[0], variation_description), )
if line.getVariation() and line.getVariationValue().getReference():
line_reference = line.getVariationValue().getReference()
is_tax = any(line.isMemberOf(tax_use) for tax_use in tax_use_list)
#set the not_tax_line with the tax_number and the tax_line with the tax_name
......@@ -176,8 +180,7 @@ for line in getSubLineList(context):
'right_style_name': 'Table_20_Contents_20_Right',
'index': line.getReference() or line.getIntIndex(),
'source_reference': getSourceReference(line),
'reference': line.getResource() is not None\
and line.getResourceValue().getReference() or '',
'reference': line_reference,
'description': desc,
'base_contribution':line.getBaseContribution() or None,
'use_type':line.getResourceValue().getUse() or '',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment