From a7ca4e89f9f743e7f65698660812a0eb718f7611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 20 Dec 2013 14:00:28 +0100 Subject: [PATCH] Improve write-off - Use account of write-off journal as default - Add write-off journal type issue3538 review2101002 --- CHANGELOG | 2 ++ invoice.py | 11 ++--------- view/pay_ask_form.xml | 2 -- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 53bcf2864f..674615c552 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Use account of write-off journal as default + Version 3.0.0 - 2013-10-21 * Bug fixes (see mercurial logs for details) * Use account move as cache diff --git a/invoice.py b/invoice.py index 68fb0d28d1..550e08e41b 100644 --- a/invoice.py +++ b/invoice.py @@ -2454,14 +2454,8 @@ class PayInvoiceAsk(ModelView): ('partial', 'Partial Payment'), ], 'Type', required=True) journal_writeoff = fields.Many2One('account.journal', 'Write-Off Journal', - states={ - 'invisible': Eval('type') != 'writeoff', - 'required': Eval('type') == 'writeoff', - }, depends=['type']) - account_writeoff = fields.Many2One('account.account', 'Write-Off Account', domain=[ - ('kind', '!=', 'view'), - ('company', '=', Eval('context', {}).get('company', -1)), + ('type', '=', 'write-off'), ], states={ 'invisible': Eval('type') != 'writeoff', @@ -2678,8 +2672,7 @@ class PayInvoice(Wizard): if lines: MoveLine.reconcile(lines, journal=self.ask.journal_writeoff, - date=self.start.date, - account=self.ask.account_writeoff) + date=self.start.date) else: if line: reconcile_lines += [line] diff --git a/view/pay_ask_form.xml b/view/pay_ask_form.xml index 9fb3b31af5..44d501dfda 100644 --- a/view/pay_ask_form.xml +++ b/view/pay_ask_form.xml @@ -12,8 +12,6 @@ this repository contains the full copyright notices and license terms. -->