From 6018e82a36640570af436a71a2acf841d886fb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 19 Sep 2014 14:24:46 +0200 Subject: [PATCH] Add rec_name to account.move.line issue3862 review5251002 --- doc/index.rst | 3 +++ move.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index b7195bd848..c478cfe65d 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -154,6 +154,9 @@ an account. The fields are: - Tax Lines. Gives the distribution of the amount line on the account chart +The Move Line is displayed using the account's name eventualy surrounded by +parenthesis when it is a credit line. + The *Reconcile Lines* wizard allow to link move lines of the same acount for whose the credit sum is equal to the debit sum. If the selected lines are not balanced, the wizard offer to create a diff --git a/move.py b/move.py index a9b2020467..44d9cdd29b 100644 --- a/move.py +++ b/move.py @@ -1139,6 +1139,16 @@ class Line(ModelSQL, ModelView): order_origin = _order_move_field('origin') order_move_state = _order_move_field('state') + def get_rec_name(self, name): + if self.debit > self.credit: + return self.account.rec_name + else: + return '(%s)' % self.account.rec_name + + @classmethod + def search_rec_name(cls, name, clause): + return [('account.rec_name',) + tuple(clause[1:])] + @classmethod def query_get(cls, table): '''