1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # Non-real time point of sale module for OpenERP, Permit user to record his
5 # sales in point of sale interface in non-real time.
6 # Copyright (C) 2016 L'Heureux Cyclage (<http://www.heureux-cyclage>)
9 # This file is a part of Non-real time point of sale
11 # Non-real time point of sale is free software: you can redistribute it
12 # and/or modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation, either version 3 of the
14 # License, or (at your option) any later version.
16 # Non-real time point of sale is distributed in the hope that it will be
17 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 # Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 ##############################################################################
26 from openerp
.osv
import osv
27 from openerp
.osv
import orm
28 from openerp
.osv
import fields
31 class account_cash_statement(orm
.Model
):
32 _inherit
= 'account.bank.statement'
34 def button_confirm_cash(self
, cr
, uid
, ids
, context
=None):
36 Put same closing date for account_bank_statement as pos session start_at date.
38 self
.pool
.get('pos.session')
39 res
= super(account_cash_statement
, self
).button_confirm_cash(cr
, uid
, ids
, context
=context
)
40 for statement
in self
.browse(cr
, uid
, ids
, context
=context
):
41 if statement
.pos_session_id
:
42 return self
.write(cr
, uid
, [statement
.id], {'closing_date': statement
.pos_session_id
.start_at
}, context
=context
)
45 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: