2010-01-18 12:52:11 +00:00
|
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
|
##############################################################################
|
2010-03-16 14:03:02 +00:00
|
|
|
|
#
|
2010-01-18 12:52:11 +00:00
|
|
|
|
# OpenERP, Open Source Management Solution
|
|
|
|
|
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
|
|
|
|
#
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program 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 Affero General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
2010-03-16 14:03:02 +00:00
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-01-18 12:52:11 +00:00
|
|
|
|
#
|
|
|
|
|
##############################################################################
|
|
|
|
|
|
2010-03-16 05:35:49 +00:00
|
|
|
|
from osv import fields, osv
|
|
|
|
|
|
|
|
|
|
class lunch_order_confirm(osv.osv_memory):
|
|
|
|
|
"""
|
|
|
|
|
Confirm Lunch Order
|
|
|
|
|
"""
|
|
|
|
|
_name = "lunch.order.confirm"
|
|
|
|
|
_description = "confirm Order"
|
2010-03-17 10:43:25 +00:00
|
|
|
|
|
2010-03-16 05:35:49 +00:00
|
|
|
|
_columns = {
|
2010-08-13 12:20:05 +00:00
|
|
|
|
'confirm_cashbox':fields.many2one('lunch.cashbox', 'Name of box', required=True),
|
|
|
|
|
}
|
2010-03-16 14:03:02 +00:00
|
|
|
|
|
2010-11-19 13:48:01 +00:00
|
|
|
|
def confirm(self, cr, uid, ids, context=None):
|
2010-03-16 05:35:49 +00:00
|
|
|
|
"""
|
2010-03-16 14:03:02 +00:00
|
|
|
|
confirm Lunch Order.Create cashmoves in launch cashmoves when state is
|
2010-03-16 05:35:49 +00:00
|
|
|
|
confirm in lunch order.
|
2010-03-16 14:03:02 +00:00
|
|
|
|
@param cr: the current row, from the database cursor,
|
|
|
|
|
@param uid: the current user’s ID for security checks,
|
2010-03-16 05:35:49 +00:00
|
|
|
|
@param ids: List Lunch Order confirm’s IDs
|
2010-03-16 14:03:02 +00:00
|
|
|
|
@return: Dictionary {}.
|
2010-03-16 05:35:49 +00:00
|
|
|
|
"""
|
2010-11-23 07:05:05 +00:00
|
|
|
|
if context is None:
|
2010-11-19 13:48:01 +00:00
|
|
|
|
context = {}
|
2010-03-16 14:03:02 +00:00
|
|
|
|
data = context and context.get('active_ids', []) or []
|
2010-03-16 05:35:49 +00:00
|
|
|
|
order_ref = self.pool.get('lunch.order')
|
2010-03-17 10:43:25 +00:00
|
|
|
|
|
2011-02-28 11:08:58 +00:00
|
|
|
|
for confirm_obj in self.browse(cr, uid, ids, context=context):
|
2011-02-01 21:08:39 +00:00
|
|
|
|
order_ref.confirm(cr, uid, data, confirm_obj.confirm_cashbox.id, context)
|
2010-12-28 10:41:38 +00:00
|
|
|
|
return {'type': 'ir.actions.act_window_close'}
|
2010-03-16 05:35:49 +00:00
|
|
|
|
|
|
|
|
|
lunch_order_confirm()
|
2010-01-18 12:52:11 +00:00
|
|
|
|
|
|
|
|
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
|
|
|
|