Replace move_lines by a relate
review946002
This commit is contained in:
1 parent
e774332008
commit
010cf656c5
4 files changed
+13
-15
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Replace move_lines by a relate
|
||||
|
||||
Version 2.8.0 - 2013-04-22
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -197,5 +197,16 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<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>
|
||||
@@ -31,7 +31,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<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"/>
|
||||
|
||||
Reference in new issue
Block a user