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):
33
_inherit = 'account.invoice'
36
def action_number(self, cr, uid, ids, context=None):
38
Modified to witholding vat validate
40
wf_service = netsvc.LocalService("workflow")
41
res = super(account_invoice, self).action_number(cr, uid, ids, context=context)
42
iva_line_obj = self.pool.get('account.wh.iva.line')
43
iva_obj = self.pool.get('account.wh.iva')
44
invo_brw = self.browse(cr,uid,ids,context=context)[0]
45
if invo_brw.cancel_true:
46
if invo_brw.islr_wh_doc_id:
47
wf_service.trg_validate(uid, 'islr.wh.doc',invo_brw.islr_wh_doc_id.id, 'act_progress', cr)
48
wf_service.trg_validate(uid, 'islr.wh.doc',invo_brw.islr_wh_doc_id.id, 'act_done', cr)
55
def invoice_cancel(self,cr,uid,ids,context=None):
59
context.update({'islr':True})
60
res = super(account_invoice, self).invoice_cancel(cr, uid, ids, context=context)
66
def check_islr(self, cr, uid, ids, context=None):
69
invo_brw = self.browse(cr,uid,ids[0],context=context)
70
if invo_brw.islr_wh_doc_id: