Commit 2ee3bb57 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: get payment mode from the trade condition's payment condition

parent 38677b0f
......@@ -11,6 +11,16 @@ price_currency = invoice.getPriceCurrency()
if invoice.getResource() != price_currency:
invoice.setResource(price_currency)
trade_condition = invoice.getSpecialiseValue(
portal_type=(
'Purchase Trade Condition',
'Sale Trade Condition',
'Internal Trade Condition',
)
)
if (invoice.getPaymentMode("") == "") and (trade_condition is not None):
invoice.setPaymentModeValue(trade_condition.getPaymentConditionPaymentMode())
if invoice.getCausality(None) is None:
causality_list = []
for line in invoice.objectValues():
......
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