[PYTHON] +override move line date coming from cash out and cash in operation by cash...
[burette/nrt_point_of_sale.git] / wizard / pos_box.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
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>)
7 # Ludovic CHEVALIER
8 #
9 # This file is a part of Non-real time point of sale
10 #
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.
15 #
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.
20 #
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/>.
23 #
24 ##############################################################################
25
26 from openerp.osv import orm
27 import pdb
28
29 class CashBoxIn(orm.TransientModel):
30 _inherit = 'cash.box.in'
31
32 def _compute_values_for_statement_line(self, cr, uid, box, record, context=None):
33 """Add statement date as date for cash in move line"""
34 res = super(CashBoxIn, self)._compute_values_for_statement_line(cr, uid, box, record, context=context)
35 res['date'] = record.date
36 return res
37
38 class CashBoxOut(orm.TransientModel):
39 _inherit = 'cash.box.out'
40
41 def _compute_values_for_statement_line(self, cr, uid, box, record, context=None):
42 """Add statement date as date for cash out move line"""
43 res = super(CashBoxOut, self)._compute_values_for_statement_line(cr, uid, box, record, context=context)
44 res['date'] = record.date
45 return res
46
47
48
49 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: