# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
parser.add_option("-c", "--config", dest="config", help="specify path to Tiny ERP config file")
group = optparse.OptionGroup(parser, "Database related options")
-group.add_option("--db_host", dest="db_host", help="specify the database host")
-group.add_option("--db_port", dest="db_port", help="specify the database port")
+group.add_option("--db_host", dest="db_host", help="specify the database host")
+group.add_option("--db_port", dest="db_port", help="specify the database port")
group.add_option("-d", "--database", dest="db_name", help="specify the database name")
group.add_option("-r", "--db_user", dest="db_user", help="specify the database user name")
-group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
+group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
parser.add_option_group(group)
options = optparse.Values()
res_id = 'res.partner,%d' % partner['id']
cr.execute(
"insert into ir_property(name, value, res_id, company_id, fields_id) "\
- "values(%s, %s, %s, %d, %d)",
+ "values(%s, %s, %s, %d, %d)",
('property_payment_term', value, res_id, company_id, fields_id))
# remove the field
reg_reports_ids = ','.join([str(id) for (id,) in registered_reports])
for report in reports_wh_duplicates:
- cr.execute("select id from ir_act_report_xml where model=%s and report_name=%s and id NOT IN ("+reg_reports_ids+")", (report['model'], report['report_name']))
+ cr.execute("select id from ir_act_report_xml where model=%s and report_name=%s and id not in ("+reg_reports_ids+")", (report['model'], report['report_name']))
(id,) = cr.fetchone()
cr.execute("delete from ir_act_report_xml where id=%d", (id,))
cr.execute("delete from ir_values where value='ir.actions.report.xml,%d'", (id,))
# this removes all transitions which are not registered in ir_model_data
-cr.execute("delete from wkf_transition where id NOT IN (select res_id from ir_model_data where model='workflow.transition')")
+cr.execute("delete from wkf_transition where id not in (select res_id from ir_model_data where model='workflow.transition')")
cr.commit()
# -------------------------------- #
# remove old menu #
# --------------- #
-cr.execute("delete from ir_ui_menu where (id NOT IN (select parent_id from ir_ui_menu where parent_id is not null)) and (id not in (select res_id from ir_values where model='ir.ui.menu'))")
+cr.execute("delete from ir_ui_menu where (id not in (select parent_id from ir_ui_menu where parent_id is not null)) and (id not in (select res_id from ir_values where model='ir.ui.menu'))")
cr.commit()
# --------------- #
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
parser.add_option("-c", "--config", dest="config", help="specify path to Tiny ERP config file")
group = optparse.OptionGroup(parser, "Database related options")
-group.add_option("--db_host", dest="db_host", help="specify the database host")
-group.add_option("--db_port", dest="db_port", help="specify the database port")
+group.add_option("--db_host", dest="db_host", help="specify the database host")
+group.add_option("--db_port", dest="db_port", help="specify the database port")
group.add_option("-d", "--database", dest="db_name", help="specify the database name")
group.add_option("-r", "--db_user", dest="db_user", help="specify the database user name")
-group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
+group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
parser.add_option_group(group)
options = optparse.Values()
# --------------- #
while True:
- cr.execute("select id from ir_ui_menu where (id NOT IN (select parent_id from ir_ui_menu where parent_id is not null)) and (id NOT IN (select res_id from ir_values where model='ir.ui.menu'))")
+ cr.execute("select id from ir_ui_menu where (id not in (select parent_id from ir_ui_menu where parent_id is not null)) and (id not in (select res_id from ir_values where model='ir.ui.menu'))")
if not cr.rowcount:
break
- cr.execute("delete from ir_ui_menu where (id NOT IN (select parent_id from ir_ui_menu where parent_id is not null)) and (id NOT IN (select res_id from ir_values where model='ir.ui.menu'))")
+ cr.execute("delete from ir_ui_menu where (id not in (select parent_id from ir_ui_menu where parent_id is not null)) and (id not in (select res_id from ir_values where model='ir.ui.menu'))")
cr.commit()
# ----------------------------------------- #
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# 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/>.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
parser.add_option("-c", "--config", dest="config", help="specify path to Tiny ERP config file")
group = optparse.OptionGroup(parser, "Database related options")
-group.add_option("--db_host", dest="db_host", help="specify the database host")
-group.add_option("--db_port", dest="db_port", help="specify the database port")
+group.add_option("--db_host", dest="db_host", help="specify the database host")
+group.add_option("--db_port", dest="db_port", help="specify the database port")
group.add_option("-d", "--database", dest="db_name", help="specify the database name")
group.add_option("-r", "--db_user", dest="db_user", help="specify the database user name")
-group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
+group.add_option("-w", "--db_password", dest="db_password", help="specify the database password")
parser.add_option_group(group)
options = optparse.Values()
]
if copy:
commands.insert(
- 2,
+ 2,
"UPDATE %s SET %s=temp_column::%s" % (table, column, new_type))
for command in commands:
# --------------- #
while True:
- cr.execute("select id from ir_ui_menu where id NOT IN (select parent_id from ir_ui_menu where parent_id is not null) and id NOT IN (select res_id from ir_model_data where model='ir.ui.menu')")
+ cr.execute("select id from ir_ui_menu where id not in (select parent_id from ir_ui_menu where parent_id is not null) and id not in (select res_id from ir_model_data where model='ir.ui.menu')")
if not cr.rowcount:
break
- cr.execute("delete from ir_ui_menu where id NOT IN (select parent_id from ir_ui_menu where parent_id is not null) and id NOT IN (select res_id from ir_model_data where model='ir.ui.menu')")
+ cr.execute("delete from ir_ui_menu where id not in (select parent_id from ir_ui_menu where parent_id is not null) and id not in (select res_id from ir_model_data where model='ir.ui.menu')")
cr.commit()
# ----------------------------------------------------- #
res2 = cr.fetchone()
cr.execute('SELECT id from res_country where code = %s', (c[0],))
ids = ','.join(map(lambda x: str(x[0]), cr.fetchall()))
- cr.execute('UPDATE res_partner_address set country_id = %d where country_id IN ('+ids+')', (res2[0],))
+ cr.execute('UPDATE res_partner_address set country_id = %d where country_id in ('+ids+')', (res2[0],))
cr.execute('DELETE FROM res_country WHERE code = %s and id <> %d', (c[0], res2[0],))
cr.commit()