Commit 139173b4 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Ignore constraint on non-slapos related Invoices

See merge request !519
parents 0e770859 3ee01bfb
invoice = context invoice = context
specialise = context.getSpecialiseValue(portal_type='Sale Trade Condition')
if specialise is None or specialise.getSpecialiseValue() is None:
if not len(invoice.objectValues(portal_type="Invoice Line")):
# The trade model don't applies if the Trade Condition isn't attached to
# A business process
return True
total_price = invoice.getTotalPrice() total_price = invoice.getTotalPrice()
if invoice.getTotalPrice() < 0: if invoice.getTotalPrice() < 0:
# For a negative total is from the Reversal transactions # For a negative total is from the Reversal transactions
......
specialise = context.getSpecialiseValue(portal_type='Sale Trade Condition') specialise = context.getSpecialiseValue(portal_type='Sale Trade Condition')
if specialise.getSpecialiseValue() is None: if specialise is None or specialise.getSpecialiseValue() is None:
# The trade model don't applies if the Trade Condition isn't attached to # The trade model don't applies if the Trade Condition isn't attached to
# A business process # A business process
return True return True
......
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