Commit 0e2be32e authored by Romain Courteaud's avatar Romain Courteaud 🐸

slapos_accounting: do not block non automated Sale Invoices

parent 94c0ba3c
invoice = context
if invoice.getLedger() != 'automated':
return False
# Non automated invoices can be used
return True
delivery_list = invoice.getCausalityValueList(portal_type='Sale Packing List')
amount = len(delivery_list)
......
if context.getLedger() != 'automated':
# Non automated invoices can be used
return True
specialise = context.getSpecialiseValue(portal_type='Sale Trade Condition')
if specialise is None or specialise.getSpecialiseValue() is None:
# The trade model don't applies if the Trade Condition isn't attached to
......
......@@ -218,6 +218,7 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
invoice = self.portal.accounting_module.newContent(
portal_type='Sale Invoice Transaction',
price_currency_value=currency,
ledger='automated',
specialise_value=sale_trade_condition)
invoice.newContent(portal_type='Invoice Line', quantity=1., price=1.,
base_contribution='base_amount/invoicing/taxable')
......
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