diff --git a/CHANGELOG b/CHANGELOG
index 84cd58c742..d947607d2c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,5 @@
+* Replace move_lines by a relate
+
Version 2.8.0 - 2013-04-22
* Bug fixes (see mercurial logs for details)
diff --git a/statement.py b/statement.py
index cf62a792fc..7233a52264 100644
--- a/statement.py
+++ b/statement.py
@@ -59,8 +59,6 @@ class Statement(Workflow, ModelSQL, ModelView):
('cancel', 'Canceled'),
('posted', 'Posted'),
], 'State', readonly=True, select=True)
- move_lines = fields.Function(fields.One2Many('account.move.line',
- None, 'Move Lines'), 'get_move_lines')
@classmethod
def __setup__(cls):
@@ -189,18 +187,6 @@ class Statement(Workflow, ModelSQL, ModelView):
return [('id', 'in', [s.id for s in statements])]
return [('journal',) + tuple(clause[1:])]
- def get_move_lines(self, name):
- '''
- Return the move lines that have been generated by the statement.
- '''
- move_lines = []
- for line in self.lines:
- if not line.move:
- continue
- for move_line in line.move.lines:
- move_lines.append(move_line.id)
- return move_lines
-
def get_end_balance(self, name):
end_balance = self.start_balance
for line in self.lines:
diff --git a/statement.xml b/statement.xml
index b2de6e2786..76b7688950 100644
--- a/statement.xml
+++ b/statement.xml
@@ -197,5 +197,16 @@ this repository contains the full copyright notices and license terms. -->
+
+ Move Lines
+ account.move.line
+ [('origin.statement.id', '=', Eval('id'), 'account.statement.line')]
+
+
+ form_relate
+ account.statement,-1
+
+
+
diff --git a/view/statement_form.xml b/view/statement_form.xml
index a9c082544e..9f2aadba44 100644
--- a/view/statement_form.xml
+++ b/view/statement_form.xml
@@ -31,7 +31,6 @@ this repository contains the full copyright notices and license terms. -->
-