2
# -*- encoding: utf-8 -*-
3
###########################################################################
4
# Module Writen to OpenERP, Open Source Management Solution
5
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
7
###############Credits######################################################
8
# Coded by: Vauxoo C.A.
9
# Planified by: Nhomar Hernandez
10
# Audited by: Vauxoo C.A.
11
#############################################################################
12
# This program is free software: you can redistribute it and/or modify
13
# it under the terms of the GNU Affero General Public License as published by
14
# the Free Software Foundation, either version 3 of the License, or
15
# (at your option) any later version.
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU Affero General Public License for more details.
22
# You should have received a copy of the GNU Affero General Public License
23
# along with this program. If not, see <http://www.gnu.org/licenses/>.
24
################################################################################
27
from osv import fields, osv
28
import decimal_precision as dp
29
from tools.translate import _
32
class account_invoice(osv.osv):
34
_inherit = 'account.invoice'
37
def action_number(self, cr, uid, ids, context=None):
39
Modified to witholding vat validate
41
wf_service = netsvc.LocalService("workflow")
42
res = super(account_invoice, self).action_number(cr, uid, ids, context=context)
43
iva_line_obj = self.pool.get('account.wh.iva.line')
44
iva_obj = self.pool.get('account.wh.iva')
45
invo_brw = self.browse(cr,uid,ids,context=context)[0]
46
if invo_brw.cancel_true:
48
if invo_brw.wh_iva_id:
49
iva_line_obj.load_taxes(cr, uid, [i.id for i in invo_brw.wh_iva_id.wh_lines], context=context)
50
wf_service.trg_validate(uid, 'account.wh.iva',invo_brw.wh_iva_id.id, 'wh_iva_confirmed', cr)
51
wf_service.trg_validate(uid, 'account.wh.iva',invo_brw.wh_iva_id.id, 'wh_iva_done', cr)
56
def invoice_cancel(self,cr,uid,ids,context=None):
61
res = super(account_invoice, self).invoice_cancel(cr, uid, ids, context=context)
65
def check_iva(self, cr, uid, ids, context=None):
68
invo_brw = self.browse(cr,uid,ids[0],context=context)
69
if invo_brw.wh_iva_id: