X-Git-Url: http://git.cyclocoop.org/?p=burette%2Fnrt_point_of_sale.git;a=blobdiff_plain;f=account_cash_statement.py;fp=account_cash_statement.py;h=c4155e377692dc76a4e48afed5e1173ebd83d202;hp=0000000000000000000000000000000000000000;hb=805e36cb5fd89d7d74c50ddd6e2e66e46248e2b6;hpb=72fe25042c12a865510836739a83b7ab68c336c9 diff --git a/account_cash_statement.py b/account_cash_statement.py new file mode 100644 index 0000000..c4155e3 --- /dev/null +++ b/account_cash_statement.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Non-real time point of sale module for OpenERP, Permit user to record his +# sales in point of sale interface in non-real time. +# Copyright (C) 2016 L'Heureux Cyclage () +# Ludovic CHEVALIER +# +# This file is a part of Non-real time point of sale +# +# Non-real time point of sale 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. +# +# Non-real time point of sale 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 +from openerp.osv import orm +from openerp.osv import fields + + +class account_cash_statement(orm.Model): + _inherit = 'account.bank.statement' + + def button_confirm_cash(self, cr, uid, ids, context=None): + """ + Put same closing date for account_bank_statement as pos session start_at date. + """ + self.pool.get('pos.session') + res = super(account_cash_statement, self).button_confirm_cash(cr, uid, ids, context=context) + for statement in self.browse(cr, uid, ids, context=context): + if statement.pos_session_id: + return self.write(cr, uid, [statement.id], {'closing_date': statement.pos_session_id.start_at}, context=context) + return res + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: