Reviewers: ,


Please review this at http://codereview.tryton.org/946002/

Affected files:
  M statement.py
  M statement.xml
  M view/statement_form.xml


Index: statement.py
===================================================================

--- a/statement.py
+++ b/statement.py
@@ -59,8 +59,6 @@
         ('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 @@
             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:

Index: statement.xml
===================================================================

--- a/statement.xml
+++ b/statement.xml
@@ -197,5 +197,16 @@
             <field name="group" ref="account.group_account_admin"/>
         </record>

+        <record model="ir.action.act_window" id="act_move_lines_form">
+            <field name="name">Move Lines</field>
+            <field name="res_model">account.move.line</field>
+ <field name="domain">[('origin.statement.id', '=', Eval('id'), 'account.statement.line')]</field>
+        </record>
+ <record model="ir.action.keyword" id="act_move_lines_form_keyword1">
+            <field name="keyword">form_relate</field>
+            <field name="model">account.statement,-1</field>
+            <field name="action" ref="act_move_lines_form"/>
+        </record>
+
     </data>
 </tryton>

Index: view/statement_form.xml
===================================================================

--- a/view/statement_form.xml
+++ b/view/statement_form.xml
@@ -31,7 +31,6 @@
         <page string="Other Info" id="info">
             <label name="company"/>
             <field name="company"/>
-            <field name="move_lines" colspan="4"/>
         </page>
     </notebook>
     <field name="currency_digits" colspan="4" invisible="1"/>



Reply via email to