Rename parent_id, child_ids into parent, childs

This commit is contained in:
Cédric Krier committed 2008-02-17 15:15:16 +01:00
1 parent b4a50d5894
commit 12996fe8d9
6 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -215,7 +215,7 @@ CREATE TABLE ir_module_category (
create_date timestamp without time zone,
write_date timestamp without time zone,
write_uid integer references res_user on delete set null,
parent_id integer REFERENCES ir_module_category ON DELETE SET NULL,
parent integer REFERENCES ir_module_category ON DELETE SET NULL,
name character varying(128) NOT NULL,
primary key(id)
);
+2 -2
View File
@@ -93,9 +93,9 @@ field,"ir.model.field,view_load",0,View Auto-Load,Vue auto-chargée,0
field,"ir.model,info",0,Information,Information,0
field,"ir.model,model",0,Object name,Nom de l'objet,0
field,"ir.model,name",0,Model name,Nom du modèle,0
field,"ir.module.category,child_ids",0,Parent Category,Catégorie parente,0
field,"ir.module.category,childs",0,Parent Category,Catégorie parente,0
field,"ir.module.category,name",0,Name,Nom,0
field,"ir.module.category,parent_id",0,Parent Category,Catégorie parente,0
field,"ir.module.category,parent",0,Parent Category,Catégorie parente,0
field,"ir.module.module,author",0,Author,Auteur,0
field,"ir.module.module,category_id",0,Category,Catégorie,0
field,"ir.module.module,demo",0,Demo data,Donnée de démonstration,0
1 type name res_id src value fuzzy
93 field ir.model,info 0 Information Information 0
94 field ir.model,model 0 Object name Nom de l'objet 0
95 field ir.model,name 0 Model name Nom du modèle 0
96 field ir.module.category,child_ids ir.module.category,childs 0 Parent Category Catégorie parente 0
97 field ir.module.category,name 0 Name Nom 0
98 field ir.module.category,parent_id ir.module.category,parent 0 Parent Category Catégorie parente 0
99 field ir.module.module,author 0 Author Auteur 0
100 field ir.module.module,category_id 0 Category Catégorie 0
101 field ir.module.module,demo 0 Demo data Donnée de démonstration 0
+3 -3
View File
@@ -8,10 +8,10 @@ class Category(OSV):
_description = __doc__
_columns = {
'name': fields.Char("Name", size=128, required=True),
'parent_id': fields.Many2One('ir.module.category',
'parent': fields.Many2One('ir.module.category',
'Parent Category', select=1),
'child_ids': fields.One2Many('ir.module.category',
'parent_id', 'Parent Category'),
'childs': fields.One2Many('ir.module.category',
'parent', 'Parent Category'),
}
_order = 'name'
+4 -4
View File
@@ -9,8 +9,8 @@
<form string="Module Category">
<label name="name"/>
<field name="name"/>
<label name="parent_id"/>
<field name="parent_id"/>
<label name="parent"/>
<field name="parent"/>
</form>
]]>
</field>
@@ -18,7 +18,7 @@
<record model="ir.ui.view" id="category_view_tree">
<field name="model">ir.module.category</field>
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="field_parent">childs</field>
<field name="arch" type="xml">
<![CDATA[
<tree string="Module Categories">
@@ -32,7 +32,7 @@
<field name="type">ir.action.act_window</field>
<field name="res_model">ir.module.category</field>
<field name="view_type">tree</field>
<field name="domain">[('parent_id', '=', False)]</field>
<field name="domain">[('parent', '=', False)]</field>
</record>
<record model="ir.action.act_window.view"
id="act_category_tree_view1">
+3 -3
View File
@@ -500,17 +500,17 @@ class Module(OSV):
if parent_id is not None:
category_ids = category_obj.search(cursor, user, [
('name', '=', categs[0]),
('parent_id', '=', parent_id),
('parent', '=', parent_id),
])
else:
category_ids = category_obj.search(cursor, user, [
('name', '=', categs[0]),
('parent_id', '=', False),
('parent', '=', False),
])
if not category_ids:
parent_id = category_obj.create(cursor, user, {
'name': categs[0],
'parent_id': parent_id,
'parent': parent_id,
})
else:
parent_id = category_ids[0]
+3 -3
View File
@@ -137,12 +137,12 @@ def init_db(cursor):
if p_id is not None:
cursor.execute('SELECT id ' \
'FROM ir_module_category ' \
'WHERE name = %s AND parent_id = %d',
'WHERE name = %s AND parent = %d',
(categs[0], p_id))
else:
cursor.execute('SELECT id ' \
'FROM ir_module_category ' \
'WHERE name = %s AND parent_id is NULL',
'WHERE name = %s AND parent is NULL',
(categs[0],))
c_id = cursor.fetchone()
if not c_id:
@@ -150,7 +150,7 @@ def init_db(cursor):
'SELECT NEXTVAL(\'ir_module_category_id_seq\')')
c_id = cursor.fetchone()[0]
cursor.execute('INSERT INTO ir_module_category ' \
'(id, name, parent_id) ' \
'(id, name, parent) ' \
'VALUES (%d, %s, %d)', (c_id, categs[0], p_id))
else:
c_id = c_id[0]