Commit f40e36dd authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_accounting: use special user to distinguish payment

parent 08919703
......@@ -6,4 +6,7 @@ payment_transaction = context
if payment_transaction.getSimulationState() == "draft":
payment_transaction.plan(comment=translateString("Initialised by Delivery Builder."))
sale_invoice_transaction = payment_transaction.getCausalityValue(portal_type='Sale Invoice Transaction')
if sale_invoice_transaction and sale_invoice_transaction.getDestination() == 'person_module/100':
payment_transaction.setDestination('person_module/100')
payment_transaction.AccountingTransaction_roundDebitCredit()
......@@ -7,6 +7,9 @@ if parent.getPortalType() != 'Applied Rule':
if parent.getSpecialiseReference() != 'default_invoice_transaction_rule':
return False
if parent.getParentValue().getDestination() != 'person_module/100':
return False
# XXX hardcoded
receivable_account_type_list = ('asset/receivable',)
payable_account_type_list = ('liability/payable',)
......
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