X-Git-Url: http://git.cyclocoop.org/?p=burette%2Faccount_move_line_nofilters.git;a=blobdiff_plain;f=account_move_line.py;fp=account_move_line.py;h=af4f4703cfb1fdd4d98178999e892a21fa4c0c2d;hp=0000000000000000000000000000000000000000;hb=131c191883185d215c2006368ee9ae072670f011;hpb=60fe8f028e01ad50a439141da9e6d125dd5eff94 diff --git a/account_move_line.py b/account_move_line.py new file mode 100644 index 0000000..af4f470 --- /dev/null +++ b/account_move_line.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Account Move Lines without filters module for OpenERP, Having no +# pre-selected period and journal when listing account move lines +# Copyright (C) 2015 L'Heureux Cyclage () +# Ludovic CHEVALIER +# +# This file is a part of Account Move Lines without filters +# +# Account Move Lines without filters 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. +# +# Account Move Lines without filters 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 . +# +############################################################################## +from openerp.osv import osv + + +class account_move_line(osv.osv): + _inherit = 'account.move.line' + + def _default_get(self, cr, uid, fields, context=None): + """Override this function to set period_id and journal_id to false.""" + data = super(account_move_line, self)._default_get(cr, uid, fields, context=None) + data['period_id'] = False + data['journal_id'] = False + return data + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: