From febb42237a0ada5cf450093a2df2d5542efca1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 26 Oct 2024 21:32:06 +0200 Subject: [PATCH] Add currency exchange write-off to demo Closes #13227 --- demo/account.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/demo/account.py b/demo/account.py index fef5f9042e..c9a50a064b 100644 --- a/demo/account.py +++ b/demo/account.py @@ -16,6 +16,8 @@ def setup(config, modules, company): SequenceStrict = Model.get('ir.sequence.strict') SequenceType = Model.get('ir.sequence.type') Party = Model.get('party.party') + WriteOff = Model.get('account.move.reconcile.write_off') + Journal = Model.get('account.journal') root_template, = AccountTemplate.find([ ('parent', '=', None), @@ -80,3 +82,15 @@ def setup(config, modules, company): setattr(invoice_sequence, attr, sequence) fiscalyear.save() fiscalyear.click('create_period') + + expense, = Account.find([ + ('company', '=', company.id), + ('code', '=', '6.2.1'), + ], limit=1) + write_off = WriteOff() + write_off.name = "Currency Exchange" + write_off.journal, = Journal.find( + [('code', '=', 'EXC'), ('type', '=', 'write-off')], limit=1) + write_off.credit_account = expense + write_off.debit_account = expense + write_off.save()