[IMP] creating a new db by running the server with -i module -d DB

bzr revid: fp@tinyerp.com-20100912105126-kw7lk1uzapvwdcwh
This commit is contained in:
Fabien Pinckaers 2010-09-12 12:51:26 +02:00
parent e5f3fd07e2
commit eff67ab23d
3 changed files with 4 additions and 43 deletions

View File

@ -1,20 +0,0 @@
# -*- coding: utf8 -*-
__name__ = "ir.property: Rename column value to value_reference"
def migrate(cr, version):
rename_column(cr, 'ir_property', 'value', 'value_reference')
def column_exists(cr, table, column):
cr.execute("SELECT count(1)"
" FROM pg_class c, pg_attribute a"
" WHERE c.relname=%s"
" AND c.oid=a.attrelid"
" AND a.attname=%s",
(table, column))
return cr.fetchone()[0] != 0
def rename_column(cr, table, old, new):
if column_exists(cr, table, old) and not column_exists(cr, table, new):
cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % (table, old, new))

View File

@ -1,16 +0,0 @@
# -*- coding: utf8 -*-
__name__ = "res.partner.address: change type of 'function' field many2one to char"
def migrate(cr, version):
change_column_type(cr,'res_partner_address')
def change_column_type(cr,table):
cr.execute('SELECT id, name FROM res_partner_function')
all_function = cr.fetchall()
cr.execute('ALTER TABLE %s ADD COLUMN temp_function VARCHAR(64)' % table)
for fn in all_function:
cr.execute("UPDATE %s SET temp_function = '%s' WHERE function = %s" % (table,fn[1],fn[0]))
cr.execute("ALTER TABLE %s DROP COLUMN function CASCADE" % table)
cr.execute("ALTER TABLE %s RENAME COLUMN temp_function TO function" % table)

View File

@ -11,9 +11,6 @@
<menuitem id="menu_config_address_book" name="Address Book" parent="menu_base_config" sequence="2"
groups="group_system"/>
<!-- <menuitem id="menu_config_crm_address_contact" name="Contacts" parent="menu_config_address_book" sequence="4"-->
<!-- groups="group_system"/>-->
<!--
=====================
Partner Address
@ -52,11 +49,12 @@
<tree string="Partner Addresses">
<field name="partner_id"/>
<field name="name"/>
<field name="type"/>
<field name="street"/>
<field name="phone"/>
<field name="email"/>
<field name="zip"/>
<field name="city"/>
<field name="country_id"/>
<field name="type"/>
</tree>
</field>
</record>
@ -235,10 +233,9 @@
<field name="name"/>
<field name="ref" groups="base.group_extended"/>
<field name="phone"/>
<field name="email"/>
<field name="city"/>
<field name="country"/>
<field name="email"/>
<field name="lang"/>
<field name="user_id"/>
</tree>
</field>