account.analytic.line: fix on_change_unit_amount()
[odoo/odoo.git] / addons / lunch / wizard / lunch_order_confirm.py
1 # -*- encoding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
6 #
7 #    This program is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU Affero General Public License as
9 #    published by the Free Software Foundation, either version 3 of the
10 #    License, or (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU Affero General Public License for more details.
16 #
17 #    You should have received a copy of the GNU Affero General Public License
18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 #
20 ##############################################################################
21
22 from osv import fields, osv
23
24 class lunch_order_confirm(osv.osv_memory):
25     """
26     Confirm Lunch Order
27     """
28     _name = "lunch.order.confirm"
29     _description = "confirm Order"
30
31     _columns = {
32         'confirm_cashbox':fields.many2one('lunch.cashbox', 'Name of box', required=True),
33     }
34
35     def confirm(self, cr, uid, ids, context):
36         """
37         confirm Lunch Order.Create cashmoves in launch cashmoves when state is
38                         confirm in lunch order.
39         @param cr: the current row, from the database cursor,
40         @param uid: the current user’s ID for security checks,
41         @param ids: List  Lunch Order confirm’s IDs
42         @return: Dictionary {}.
43         """
44         data = context and context.get('active_ids', []) or []
45         order_ref = self.pool.get('lunch.order')
46
47         for confirm_obj in self.read(cr, uid, ids):
48             order_ref.confirm(cr, uid, data, confirm_obj['confirm_cashbox'], context)
49             return {}
50
51 lunch_order_confirm()
52
53 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
54