diff --git a/account_balance_line/__init__.py b/account_balance_line/__init__.py new file mode 100644 index 000000000..e05fd7715 --- /dev/null +++ b/account_balance_line/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Vincent Renaville (Camptocamp) +# Copyright 2010-2014 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import account_move_line # noqa diff --git a/account_balance_line/__openerp__.py b/account_balance_line/__openerp__.py new file mode 100644 index 000000000..cab71b749 --- /dev/null +++ b/account_balance_line/__openerp__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Vincent Renaville (Camptocamp) +# Copyright 2010-2014 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{'name' : 'Balance on lines', + 'summary': 'Display balance totals in move line view', + 'version' : '1.1', + 'author' : 'Camptocamp', + 'maintainter' : 'Camptocamp', + 'category': 'Accounting', + 'depends' : ['account'], + 'description': """ +Balance for a line +================== + +Add a balance total for grouped lines in move line view. + +Balance field will only be shown when move lines are grouped by account +or filtered by account. + +Contributors +------------ + +* Vincent revaville +* Yannick Vaucher +""", + 'website': 'http://www.camptocamp.com', + 'data': [ + 'account_move_line_view.xml', + ], + 'tests': [], + 'installable': True, + 'auto_install': False, + 'license': 'AGPL-3', + 'application': False, +} diff --git a/account_balance_line/account_move_line.py b/account_balance_line/account_move_line.py new file mode 100644 index 000000000..53c83271b --- /dev/null +++ b/account_balance_line/account_move_line.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Vincent Renaville (Camptocamp) +# Copyright 2010-2014 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero 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 Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from openerp.osv import osv, fields + + +class account_move_line(osv.Model): + _inherit = "account.move.line" + + def _line_balance(self, cr, uid, ids, field, arg, context=None): + res = {} + move_lines = self.read(cr, uid, ids, + ['debit', 'credit'], + context=context) + + for line in move_lines: + res[line['id']] = line['debit'] - line['credit'] + return res + + _columns = { + 'line_balance': fields.function( + _line_balance, method=True, + string='Balance', + store=True), + } diff --git a/account_balance_line/account_move_line_view.xml b/account_balance_line/account_move_line_view.xml new file mode 100644 index 000000000..22be69ccb --- /dev/null +++ b/account_balance_line/account_move_line_view.xml @@ -0,0 +1,30 @@ + + + + + + Journal Items add visibilty for balance + account.move.line + + + + {'invisible_balance': False} + + + {'group_by': 'account_id', 'invisible_balance': False} + + + + + + account_move_line_balance_custom + account.move.line + + + + + + + + + diff --git a/account_balance_line/i18n/account_balance_line.pot b/account_balance_line/i18n/account_balance_line.pot new file mode 100644 index 000000000..4330edce5 --- /dev/null +++ b/account_balance_line/i18n/account_balance_line.pot @@ -0,0 +1,53 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_balance_line +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-06-20 14:11+0000\n" +"PO-Revision-Date: 2014-06-20 14:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "Account" +msgstr "" + +#. module: account_balance_line +#: model:ir.model,name:account_balance_line.model_account_move_line +msgid "Entry lines" +msgstr "" + +#. module: account_balance_line +#: code:_description:0 +#, python-format +msgid "Journal Items" +msgstr "" + +#. module: account_balance_line +#: field:account.move.line,line_balance:0 +msgid "Balance" +msgstr "" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "Total Balance" +msgstr "" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "{'group_by': 'account_id', 'invisible_balance': False}" +msgstr "" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "{'invisible_balance': False}" +msgstr "" + diff --git a/account_balance_line/i18n/fr.po b/account_balance_line/i18n/fr.po new file mode 100644 index 000000000..31f766975 --- /dev/null +++ b/account_balance_line/i18n/fr.po @@ -0,0 +1,53 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_balance_line +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-06-20 14:11+0000\n" +"PO-Revision-Date: 2014-06-20 14:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "Account" +msgstr "Compte" + +#. module: account_balance_line +#: model:ir.model,name:account_balance_line.model_account_move_line +msgid "Entry lines" +msgstr "Lignes d'écriture" + +#. module: account_balance_line +#: code:_description:0 +#, python-format +msgid "Journal Items" +msgstr "Écritures comptables" + +#. module: account_balance_line +#: field:account.move.line,line_balance:0 +msgid "Balance" +msgstr "Balance" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "Total Balance" +msgstr "Balance Totale" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "{'group_by': 'account_id', 'invisible_balance': False}" +msgstr "" + +#. module: account_balance_line +#: view:account.move.line:0 +msgid "{'invisible_balance': False}" +msgstr "" +