From: Ludovic CHEVALIER Date: Fri, 10 Mar 2017 17:17:26 +0000 (+0100) Subject: [PYTHON] +override move line date coming from cash out and cash in operation by cash... X-Git-Url: http://git.cyclocoop.org/data/%24%7Bnav_urls/portal/%40%20%27entree_nom_pseudo_1%27%20=%3E%20%27%28Your%20name%20or%20alias%29%27%2C%20%27entree_nom_pseudo_2%27%20=%3E%20%27Name%20or%20alias%27%2C%20%27entree_nom_site%27%20=%3E%20%27Name%20of%20your%20site%27%2C-%27entree_nom_site_2%27%20=%3E%20%27Name%20of%20the%20author/%27s%20site%27%2C%20%27entree_nom_site_2%27%20=%3E%20%27Name%20of%20the%20author%C3%A2%C2%80%C2%99s%20site%27%2C%20%27entree_nouveau_passe%27%20=%3E%20%27New%20password%27%2C%20%27entree_passe_ldap%27%20=%3E%20%27Password%27%2C%20%27entree_port_annuaire%27%20=%3E%20%27Port%20number%20of%20the%20directory%27%2C%40%40%20-175%2C7%20%20175%2C7%20%40%40%20Do%20not%20submit%20this%20import%20request.%3Cp%3EFor%20more%20information%2C%20please%20see%20%3Ca%20href=?a=commitdiff_plain;h=c6d0feed1a1f5c23d6a8dc40e43e2a267c34850f;p=burette%2Fnrt_point_of_sale.git [PYTHON] +override move line date coming from cash out and cash in operation by cash statement date --- diff --git a/__init__.py b/__init__.py index ff4d6b5..2ed05af 100644 --- a/__init__.py +++ b/__init__.py @@ -24,5 +24,6 @@ ############################################################################## import account_cash_statement import point_of_sale +import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/__openerp__.py b/__openerp__.py index 09a6f7a..52de818 100644 --- a/__openerp__.py +++ b/__openerp__.py @@ -33,6 +33,7 @@ 'author': 'L\'Heureux Cyclage', 'website': 'http://www.heureux-cyclage.org', 'depends': [ + 'account', 'point_of_sale', ], 'init_xml': [], diff --git a/wizard/__init__.py b/wizard/__init__.py new file mode 100644 index 0000000..2060243 --- /dev/null +++ b/wizard/__init__.py @@ -0,0 +1,28 @@ +# -*- 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 . +# +############################################################################## + +import pos_box + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/wizard/pos_box.py b/wizard/pos_box.py new file mode 100644 index 0000000..eb20d21 --- /dev/null +++ b/wizard/pos_box.py @@ -0,0 +1,49 @@ +# -*- 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 orm +import pdb + +class CashBoxIn(orm.TransientModel): + _inherit = 'cash.box.in' + + def _compute_values_for_statement_line(self, cr, uid, box, record, context=None): + """Add statement date as date for cash in move line""" + res = super(CashBoxIn, self)._compute_values_for_statement_line(cr, uid, box, record, context=context) + res['date'] = record.date + return res + +class CashBoxOut(orm.TransientModel): + _inherit = 'cash.box.out' + + def _compute_values_for_statement_line(self, cr, uid, box, record, context=None): + """Add statement date as date for cash out move line""" + res = super(CashBoxOut, self)._compute_values_for_statement_line(cr, uid, box, record, context=context) + res['date'] = record.date + return res + + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: