Luc De Meyer (Noviat) has proposed merging lp:~luc-demeyer/account-financial-report/7.0-account_financial_report_webkit-first-special-fix into lp:account-financial-report.
Requested reviews: Account Report Core Editors (account-report-core-editor) For more details, see: https://code.launchpad.net/~luc-demeyer/account-financial-report/7.0-account_financial_report_webkit-first-special-fix/+merge/193717 Add support for customers who start to use OpenERP accounting after one of more years of using OpenERP for other purposes by changing the '_get_first_special_period' logic. New logic: First special period is first opening period since you can have years without opening period, e.g. OpenERP systems used initially for non-accounting purposes. -- https://code.launchpad.net/~luc-demeyer/account-financial-report/7.0-account_financial_report_webkit-first-special-fix/+merge/193717 Your team Account Report Core Editors is requested to review the proposed merge of lp:~luc-demeyer/account-financial-report/7.0-account_financial_report_webkit-first-special-fix into lp:account-financial-report.
=== modified file 'account_financial_report_webkit/report/common_partner_reports.py' --- account_financial_report_webkit/report/common_partner_reports.py 2013-05-07 06:56:51 +0000 +++ account_financial_report_webkit/report/common_partner_reports.py 2013-11-03 20:56:22 +0000 @@ -64,21 +64,9 @@ :return: browse record of the first special period. """ - move_line_obj = self.pool.get('account.move.line') - first_entry_id = move_line_obj.search( - self.cr, self.uid, [], order='date ASC', limit=1) - # it means there is no entry at all, that's unlikely to happen, but - # it may so - if not first_entry_id: - return - first_entry = move_line_obj.browse(self.cr, self.uid, first_entry_id[0]) - fiscalyear = first_entry.period_id.fiscalyear_id - special_periods = [period for period in fiscalyear.period_ids if period.special] - # so, we have no opening period on the first year, nothing to return - if not special_periods: - return - return min(special_periods, - key=lambda p: datetime.strptime(p.date_start, DEFAULT_SERVER_DATE_FORMAT)) + period_obj = self.pool.get('account.period') + first_special_period_id = period_obj.search(self.cr, self.uid, [('special', '=', True)], order='date_start ASC', limit=1) + return first_special_period_id and period_obj.browse(self.cr, self.uid, first_special_period_id[0]) or None def _get_period_range_from_start_period(self, start_period, include_opening=False, fiscalyear=False,
-- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp