From 0f304fb23e424d176ea456a60d8772d11978308c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 3 Jul 2008 20:43:02 +0200 Subject: [PATCH] Add company_id to fiscalyear search and fix guidelines --- statement.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/statement.py b/statement.py index e9d4616e56..f63d08e04e 100644 --- a/statement.py +++ b/statement.py @@ -160,22 +160,22 @@ class Line(OSV): def create_move(self, cursor, user, line, context=None): move_obj = self.pool.get('account.move') period_obj = self.pool.get('account.period') - period = period_obj.find(cursor, user, date=line.date, - context=context) + period_id = period_obj.find(cursor, user, + line.statement.journal.company.id, date=line.date, + context=context) - move_lines = self.get_move_lines( - cursor, user, line, context=context) + move_lines = self.get_move_lines(cursor, user, line, context=context) move_id = move_obj.create( - cursor, user, - {'name': line.date, - 'period': period, - 'journal': line.statement.journal.journal.id, - 'date': line.date, - 'lines': [('create', x) for x in move_lines], - }, - context=context) - self.write( - cursor, user, line.id, {'move': move_id}, context=context) + cursor, user, { + 'name': line.date, + 'period': period_id, + 'journal': line.statement.journal.journal.id, + 'date': line.date, + 'lines': [('create', x) for x in move_lines], + }, context=context) + self.write(cursor, user, line.id, { + 'move': move_id, + }, context=context) def post_move(self, cursor, user, lines, context=None): move_obj = self.pool.get('account.move')