1
# -*- coding: utf-8 -*-
2
##############################################################################
4
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
5
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
7
# All other contributions are (C) by their respective contributors
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the GNU Affero 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
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
# GNU Affero General Public License for more details.
21
# You should have received a copy of the GNU Affero General Public License
22
# along with this program. If not, see <http://www.gnu.org/licenses/>.
24
##############################################################################
27
This module contains a single "wizard" for confirming manual
31
from openerp.osv import orm, fields
32
from openerp import netsvc
35
class payment_manual(orm.TransientModel):
36
_name = 'payment.manual'
37
_description = 'Send payment order(s) manually'
40
'payment_order_ids': fields.many2many('payment.order',
41
'wiz_manual_payorders_rel', 'wizard_id', 'payment_order_id',
42
'Payment orders', readonly=True),
45
def create(self, cr, uid, vals, context=None):
46
payment_order_ids = context.get('active_ids', [])
48
'payment_order_ids': [[6, 0, payment_order_ids]],
50
return super(payment_manual, self).create(cr, uid,
51
vals, context=context)
53
def button_ok(self, cr, uid, ids, context=None):
54
wf_service = netsvc.LocalService('workflow')
55
for wiz in self.browse(cr, uid, ids, context=context):
56
for order_id in wiz.payment_order_ids:
57
wf_service.trg_validate(
58
uid, 'payment.order', order_id.id, 'done', cr)
59
return {'type': 'ir.actions.act_window_close'}