Commit 8bf78125 authored by Jérome Perrin's avatar Jérome Perrin

accounting: prefer accessors over edit method

- edit method adds an extra entry in the edit history. We already have one
entry for newContent
- edit silently creates local properties in case of typos, so it's
  generally better not to use it when the property names are known
parent a7688c4e
......@@ -55,12 +55,12 @@ related_payment = portal.accounting_module.newContent(
payment_mode=payment_mode,
)
if is_source:
related_payment.edit(destination_payment=context.getDestinationPayment(),
source_payment=payment)
related_payment.setDestinationPayment(context.getDestinationPayment())
related_payment.setSourcePayment(payment)
mirror_section = context.getDestinationSection()
else:
related_payment.edit(destination_payment=payment,
source_payment=context.getSourcePayment())
related_payment.setDestinationPayment(payment)
related_payment.setSourcePayment(context.getSourcePayment())
mirror_section = context.getSourceSection()
bank = related_payment.newContent(
......
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