1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
27
# l'interet d'avoir un wizard pour ca est de pouvoir imprimer les vignettes directement
28
def _invoice_labels(self,cr,uid,datas,context):
29
# service = netsvc.LocalService("object_proxy")
30
# invoice_id = service.execute(uid, 'huissier.vignettes', 'invoice', [datas['id']])
31
vign_obj = pooler.get_pool(cr.dbname).get('huissier.vignettes')
32
ids = vign_obj.invoice(cr, uid, datas['ids'],context)
34
print "Facturation finie"
37
def facture(self, cr, uid, data, context):
38
id_vignette = pooler.get_pool(cr.dbname).get('huissier.vignettes').browse(cr,uid,data['ids'])
39
inv_vignette= id_vignette[0].invoice_id.id or false
40
if not inv_vignette: return {}
42
'domain': str([('id', 'in', [inv_vignette])]),
43
'name': 'Factures de vignettes en attente',
45
'view_mode': 'tree,form',
46
'res_model': 'account.invoice',
48
'type': 'ir.actions.act_window'
52
class wizard_invoice_labels(wizard.interface):
55
'actions': [_invoice_labels],
56
'result': {'type': 'print', 'report':'huissier.labels', 'state': 'fin'}
60
'result':{'type':'action', 'action':facture, 'state':'end'}
63
wizard_invoice_labels('huissier.labels.invoice')
65
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: