示例#1
0
#                       https://github.com/jmesteve
#                       <*****@*****.**>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw

class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type = None):
        super(rmlparser,self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])

report_sxw.report_sxw('report.preview.report.apaisado', 'res.company',
      'addons/base_extend/report/preview_report_apaisado.rml', parser=rmlparser, header='internal landscape')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#2
0
        currency_ids = currency_obj.search(self.cr, self.uid, [], context=self.context)
        currency_objects = currency_obj.browse(self.cr, self.uid, currency_ids, context=self.context)
        currencies = {}
        for currency in currency_objects:
            currencies[currency.id] = currency
            
        for account in accounts_dictionary.values():
            currency = company.currency_id
            if account['currency_id'] != None  and currencies[account['currency_id']]:
                currency = currencies[account['currency_id']]
            
            if form['display_account'] == 'movement':
                if not currency_obj.is_zero(self.cr, self.uid, currency, account['credit']) or not currency_obj.is_zero(self.cr, self.uid, currency, account['debit']) or not currency_obj.is_zero(self.cr, self.uid, currency, account['final_balance']):
                    result.append(account)
            elif form['display_account'] == 'not_zero':
                if not currency_obj.is_zero(self.cr, self.uid, currency, account['final_balance']):
                    result.append(account)
            else:
                result.append(account)
        
        levels = self.pool.get('account.balance.report.extend.level').read(self.cr, self.uid, form['levels'], ['value'], self.context)
        levels = [element['value'] for element in levels]  
        # Filter by display level
        result = [elem for elem in result if len(elem['code']) in levels]
        
        return sorted(result, key=lambda element: element['code'])

report_sxw.report_sxw('report.account_balance_extend.account.balance', 'account.account', 'addons_extra/account_balance_extend/report/account_balance.rml', parser=account_balance, header="internal")

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#3
0
#                       <*****@*****.**>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw

class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type = None):
        super(rmlparser,self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])

report_sxw.report_sxw('report.preview.report.shipping', 'res.company',
      'addons/base_extend/report/preview_report_shipping.rml', parser=rmlparser, header='shipping')


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#4
0
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw


class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type=None):
        super(rmlparser, self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])


report_sxw.report_sxw('report.preview.report.internal',
                      'res.company',
                      'addons/base_extend/report/preview_report_internal.rml',
                      parser=rmlparser,
                      header='internal')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#5
0
                        account['credit']) or not currency_obj.is_zero(
                            self.cr, self.uid, currency,
                            account['debit']) or not currency_obj.is_zero(
                                self.cr, self.uid, currency,
                                account['final_balance']):
                    result.append(account)
            elif form['display_account'] == 'not_zero':
                if not currency_obj.is_zero(self.cr, self.uid, currency,
                                            account['final_balance']):
                    result.append(account)
            else:
                result.append(account)

        levels = self.pool.get('account.balance.report.extend.level').read(
            self.cr, self.uid, form['levels'], ['value'], self.context)
        levels = [element['value'] for element in levels]
        # Filter by display level
        result = [elem for elem in result if len(elem['code']) in levels]

        return sorted(result, key=lambda element: element['code'])


report_sxw.report_sxw(
    'report.account_balance_extend.account.balance',
    'account.account',
    'addons_extra/account_balance_extend/report/account_balance.rml',
    parser=account_balance,
    header="internal")

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#6
0
            return self.pool.get('account.period').browse(
                self.cr, self.uid, data['form']['period_to']).date_stop
        return ''

    def get_filter(self, data):
        if data.get('form', False) and data['form'].get('filter', False):
            if data['form']['filter'] == 'filter_date':
                return 'filter_date'
            elif data['form']['filter'] == 'filter_period':
                return 'filter_period'
        return 'filter_no'

    def _get_sortby(self, data):
        # TODO: deprecated, to remove in trunk
        if self.sort_selection == 'date':
            return self._translate('Date')
        elif self.sort_selection == 'ref':
            return self._translate('Reference Number')
        return self._translate('Date')


report_sxw.report_sxw(
    'report.account.journal.period.print.extend',
    'account.journal.period',
    'addons_extra/account_journal_extend/report/account_journal.rml',
    parser=journal_print,
    header='internal')
#report_sxw.report_sxw('report.account.journal.period.print.sale.purchase', 'account.journal.period', 'addons/account/report/account_journal_sale_purchase.rml', parser=journal_print, header='external')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#7
0
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw


class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type=None):
        super(rmlparser, self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])


report_sxw.report_sxw('report.preview.report.shipping',
                      'res.company',
                      'addons/base_extend/report/preview_report_shipping.rml',
                      parser=rmlparser,
                      header='shipping')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#8
0
    def get_start_period(self, data):
        if data.get('form', False) and data['form'].get('period_from', False):
            return self.pool.get('account.period').browse(self.cr,self.uid,data['form']['period_from']).date_start
        return ''

    def get_end_period(self, data):
        if data.get('form', False) and data['form'].get('period_to', False):
            return self.pool.get('account.period').browse(self.cr, self.uid, data['form']['period_to']).date_stop
        return ''
    
    def get_filter(self, data):
        if data.get('form', False) and data['form'].get('filter', False):
            if data['form']['filter'] == 'filter_date':
                return 'filter_date'
            elif data['form']['filter'] == 'filter_period':
                return 'filter_period'
        return 'filter_no'

    def _get_sortby(self, data):
        # TODO: deprecated, to remove in trunk
        if self.sort_selection == 'date':
            return self._translate('Date')
        elif self.sort_selection == 'ref':
            return self._translate('Reference Number')
        return self._translate('Date')

report_sxw.report_sxw('report.account.journal.period.print.extend', 'account.journal.period', 'addons_extra/account_journal_extend/report/account_journal.rml', parser=journal_print, header='internal')
#report_sxw.report_sxw('report.account.journal.period.print.sale.purchase', 'account.journal.period', 'addons/account/report/account_journal_sale_purchase.rml', parser=journal_print, header='external')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#9
0
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw


class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type=None):
        super(rmlparser, self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])


report_sxw.report_sxw('report.preview.report.apaisado',
                      'res.company',
                      'addons/base_extend/report/preview_report_apaisado.rml',
                      parser=rmlparser,
                      header='internal landscape')

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
示例#10
0
#                       <*****@*****.**>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published
#    by the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.report import report_sxw as report_sxw_extend
from openerp.addons.report_extend.report import report_sxw

class rmlparser(report_sxw_extend.rml_parse):
    def set_context(self, objects, data, ids, report_type = None):
        super(rmlparser,self).set_context(objects, data, ids, report_type)
        self.setCompany(objects[0])

report_sxw.report_sxw('report.preview.report.internal', 'res.company',
      'addons/base_extend/report/preview_report_internal.rml', parser=rmlparser, header='internal')


# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: