Skip to content

Commit f30155d

Browse files
committed
[IMP] real_estate: apply Odoo coding guidelines to naming conventions
In this tutorial, Renamed model and view files to follow standard Odoo naming (<main_model>.py, <model>_views.xml, etc.). Updated class names to use CamelCase as per convention. Adjusted method names to match Odoo patterns e.g., _compute_, _check_, action_). Ensured XML IDs and view names follow Odoo's structured naming scheme. Cleaned up import orders and variable names for readability and consistency.
1 parent d337c6c commit f30155d

File tree

7 files changed

+23
-24
lines changed

7 files changed

+23
-24
lines changed

estate_gasa/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'views/estate_property_offer_views.xml',
1414
'views/estate_property_type_views.xml',
1515
'views/estate_tag_views.xml',
16-
'views/estate_menus.xml',
1716
'views/inherited_model.xml',
17+
'views/estate_menus.xml',
1818
],
1919
}

estate_gasa/views/estate_menus.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
3-
<menuitem id="estate_menu_root" name="Estate" />
3+
<menuitem id="estate_menu_root" string="Estate" />
44

55
<!-- Submenu: Advertisements-->
6-
<menuitem id="estate_menu_properties" name="Application" parent="estate_menu_root" />
7-
<menuitem id="estate_menu_property_action" name="Properties" action="action_estate_property"
6+
<menuitem id="estate_menu_properties" string="Application" parent="estate_menu_root" />
7+
<menuitem id="estate_menu_property_action" string="Properties" action="estate_property_action"
88
parent="estate_menu_properties" />
99

1010
<!-- Submenu: Settings -->
11-
<menuitem id="estate_menu_settings" name="Settings" parent="estate_menu_root" />
12-
<menuitem id="estate_menu_property_type" name="Property Types"
13-
action="action_estate_property_type" parent="estate_menu_settings" />
14-
<menuitem id="estate_menu_property_tag" name="Property Tags"
15-
parent="estate_menu_settings" action="action_estate_property_tag" />
11+
<menuitem id="estate_menu_settings" string="Settings" parent="estate_menu_root" />
12+
<menuitem id="estate_menu_property_type" string="Property Types"
13+
action="estate_property_type_action" parent="estate_menu_settings" />
14+
<menuitem id="estate_menu_property_tag" string="Property Tags"
15+
parent="estate_menu_settings" action="estate_property_tag_action" />
1616
</odoo>

estate_gasa/views/estate_property_offer_views.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<odoo>
2-
<record id="view_tree_estate_property_offer" model="ir.ui.view">
2+
<record id="estate_property_offer_view_list" model="ir.ui.view">
33
<field name="name">estate.property.offer.list</field>
44
<field name="model">estate.property.offer</field>
55
<field name="arch" type="xml">
@@ -13,7 +13,7 @@
1313
</field>
1414
</record>
1515

16-
<record id="view_estate_property_offer_form" model="ir.ui.view">
16+
<record id="estate_property_offer_view_form" model="ir.ui.view">
1717
<field name="name">estate.property.offer.form</field>
1818
<field name="model">estate.property.offer</field>
1919
<field name="arch" type="xml">
@@ -29,7 +29,7 @@
2929
</form>
3030
</field>
3131
</record>
32-
<record id="action_estate_property_offer" model="ir.actions.act_window">
32+
<record id="estate_property_offer_action" model="ir.actions.act_window">
3333
<field name="name">Offers</field>
3434
<field name="res_model">estate.property.offer</field>
3535
<field name="view_mode">list,form</field>

estate_gasa/views/estate_property_type_views.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<odoo>
2-
<record id="view_estate_property_type_form" model="ir.ui.view">
2+
<record id="estate_property_type_view_form" model="ir.ui.view">
33
<field name="name">estate.property.type.form</field>
44
<field name="model">estate.property.type</field>
55
<field name="arch" type="xml">
66
<form string="Property Type">
77
<sheet>
88
<group>
99
<field name="name" />
10-
<!-- <field name="sequence" /> -->
1110
</group>
1211
<notebook>
1312
<page string="Properties">
@@ -21,7 +20,7 @@
2120
</page>
2221
</notebook>
2322
<div class="oe_button_box" name="button_box">
24-
<button name="%(action_estate_property_offer)d"
23+
<button name="%(estate_property_offer_action)d"
2524
type="action"
2625
icon="fa-list"
2726
string="Offers"
@@ -35,7 +34,7 @@
3534
</field>
3635
</record>
3736

38-
<record id="action_estate_property_type" model="ir.actions.act_window">
37+
<record id="estate_property_type_action" model="ir.actions.act_window">
3938
<field name="name">Property Types</field>
4039
<field name="res_model">estate.property.type</field>
4140
<field name="view_mode">list,form</field>

estate_gasa/views/estate_property_views.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
3-
<record id="view_form_estate_property" model="ir.ui.view">
3+
<record id="estate_property_view_form" model="ir.ui.view">
44
<field name="name">estate.property.form</field>
55
<field name="model">estate.property</field>
66
<field name="arch" type="xml">
@@ -96,7 +96,7 @@
9696
</field>
9797
</record>
9898

99-
<record id="view_tree_estate_property" model="ir.ui.view">
99+
<record id="estate_property_view_list" model="ir.ui.view">
100100
<field name="name">estate.property.lists</field>
101101
<field name="model">estate.property</field>
102102
<field name="arch" type="xml">
@@ -118,7 +118,7 @@
118118
</list>
119119
</field>
120120
</record>
121-
<record id="view_estate_property_search" model="ir.ui.view">
121+
<record id="estate_property_search" model="ir.ui.view">
122122
<field name="name">estate.property.tree</field>
123123
<field name="model">estate.property</field>
124124
<field name="arch" type="xml">
@@ -137,7 +137,7 @@
137137
</search>
138138
</field>
139139
</record>
140-
<record id="action_estate_property" model="ir.actions.act_window">
140+
<record id="estate_property_action" model="ir.actions.act_window">
141141
<field name="name">Real Estate</field>
142142
<field name="res_model">estate.property</field>
143143
<field name="view_mode">list,form</field>

estate_gasa/views/estate_tag_views.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
3-
<record id="view_tree_estate_property_tag" model="ir.ui.view">
4-
<field name="name">estate.property.tag.tree</field>
3+
<record id="estate_property_tag_view_list" model="ir.ui.view">
4+
<field name="name">estate.property.tag.list</field>
55
<field name="model">estate.property.tag</field>
66
<field name="arch" type="xml">
77
<list string="Tags" editable="bottom">
@@ -12,7 +12,7 @@
1212
</field>
1313
</record>
1414

15-
<record id="action_estate_property_tag" model="ir.actions.act_window">
15+
<record id="estate_property_tag_action" model="ir.actions.act_window">
1616
<field name="name">Property Tags</field>
1717
<field name="res_model">estate.property.tag</field>
1818
<field name="view_mode">list,form</field>

estate_gasa/views/inherited_model.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<odoo>
33
<record id="res_users_view_form_inherit_property_tab" model="ir.ui.view">
4-
<field name="name">res.users.view.form.inherit.estate.property</field>
4+
<field name="name">res.users.form.inherit.estate.property</field>
55
<field name="model">res.users</field>
66
<field name="inherit_id" ref="base.view_users_form" />
77
<field name="arch" type="xml">

0 commit comments

Comments
 (0)