Remove sql injection problem

lp bug: https://launchpad.net/bugs/429327 fixed

bzr revid: hda@tinyerp.com-20091021072449-rc9usc422tb0kv2f
This commit is contained in:
HDA (OpenERP) 2009-10-21 12:54:49 +05:30
parent 251b6720ca
commit b7f6bc4c8e
46 changed files with 2027 additions and 1960 deletions

View File

@ -729,7 +729,7 @@ class account_move(osv.osv):
def _amount_compute(self, cr, uid, ids, name, args, context, where =''):
if not ids: return {}
cr.execute('select move_id,sum(debit) from account_move_line where move_id in ('+','.join(map(str,ids))+') group by move_id')
cr.execute('select move_id,sum(debit) from account_move_line where move_id in ('+','.join(map(str,map(int, ids)))+') group by move_id')
result = dict(cr.fetchall())
for id in ids:
result.setdefault(id, 0.0)

View File

@ -397,7 +397,7 @@ class account_invoice(osv.osv):
l.id \
from account_move_line l \
left join account_invoice i on (i.move_id=l.move_id) \
where i.id in ('+','.join(map(str,ids))+') and l.account_id=i.account_id')
where i.id in ('+','.join(map(str,map(int, ids)))+') and l.account_id=i.account_id')
res = map(lambda x: x[0], cr.fetchall())
return res

View File

@ -42,7 +42,7 @@ class account_move_line(osv.osv):
WHERE move_line_id = ml.id
AND po.state != 'cancel') as amount
FROM account_move_line ml
WHERE id in (%s)""" % (",".join(map(str, ids))))
WHERE id in (%s)""" % (",".join(map(str,map(int, ids)))))
r=dict(cr.fetchall())
return r

View File

@ -19,7 +19,6 @@
#
##############################################################################
{
'name': 'Analytic Journal Billing Rate',
'version': '1.0',

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#!/usr/bin/python
from common import *
from code39 import *

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 1996-2000 Tyler C. Sarna <tsarna@sarna.org>
# All rights reserved.

View File

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution

View File

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution

View File

@ -1,4 +1,4 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution

View File

@ -1,4 +1,3 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################
#
@ -21,7 +20,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
#!/usr/bin/python
"""
Tiny SXW2RML - The Open ERP's report engine

View File

@ -1,3 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
__name__ = "Change signs of old holiday requests"
def migrate(cr, version):

View File

@ -1,3 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
__name__ = "Convert the Holidays Per User limits into positive leave request"
def migrate(cr, version):

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# account_move_line.py
# l10n_ch

View File

@ -1,4 +1,4 @@
#
# -*- coding: utf-8 -*-
# bank.py
# l10n_ch
#

View File

@ -1,6 +1,3 @@
#!/usr/bin/python
#coding: latin-1
##############################################################################
@ -32,7 +29,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
#!/usr/bin/python
"""
Tiny SXW2RML - The Tiny ERP's report engine

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# __init__.py
#

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#
# config.py
#

View File

@ -1,3 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import unittest
import pooler
import netsvc