Skip to content

Commit 2c0b30a

Browse files
[CLN] Addressing Clean Code comments for Estate Module. Added newlines to the end of files. Improved the readability of manifest. renamed model classes to follow the pascal casing.
1 parent 1a772bd commit 2c0b30a

File tree

8 files changed

+17
-14
lines changed

8 files changed

+17
-14
lines changed

estate/__manifest__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
2-
"name": "real estate",
3-
"description": "real estate renting management system",
2+
"name": "Real Estate",
3+
"description": "Real Estate Management System",
44
"category": "Tutorials",
55
"version": "1.1",
66
"application": True,
7-
"data": ["security/ir.model.access.csv", "views/views.xml", "views/menus.xml"],
8-
"author": "OMKHA",
7+
"data": [
8+
"security/ir.model.access.csv",
9+
"views/views.xml",
10+
"views/menus.xml"
11+
],
12+
"author": "Odoo S.A.",
913
"license": "LGPL-3",
1014
}

estate/models/building_type_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from odoo import models, fields
22

33

4-
class building_type_model(models.Model):
4+
class BuildingType(models.Model):
55
_name = "estate.building_type"
66
_description = "Building Type Model"
77

estate/models/buildings_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from datetime import timedelta
44

55

6-
class buildings_model(models.Model):
6+
class Building(models.Model):
77
_name = "estate.buildings"
88
_description = "Buildings Model"
99

estate/models/offers_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from datetime import timedelta
44

55

6-
class offers_model(models.Model):
6+
class Offer(models.Model):
77
_name = "estate.offers"
88
_description = "Offers Model"
99

estate/models/tags_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from odoo import models, fields
22

33

4-
class building_tags_model(models.Model):
4+
class BuildingTag(models.Model):
55
_name = "estate.building_tags"
66
_description = "Building Tags Model"
77

estate/security/ir.model.access.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
22
access_first_model,access_first_model,model_estate_buildings,base.group_user,1,1,1,1
33
access_building_type_model,access_building_type_model,model_estate_building_type,base.group_user,1,1,1,1
44
access_building_tags_model,access_building_tags_model,model_estate_building_tags,base.group_user,1,1,1,1
5-
access_offers_model,access_offers_model,model_estate_offers,base.group_user,1,1,1,1
5+
access_offers_model,access_offers_model,model_estate_offers,base.group_user,1,1,1,1

estate/views/menus.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<menuitem id="test_model_menu_action" action="some_model_action_1"/>
66
</menuitem>
77
</menuitem>
8-
</odoo>
8+
</odoo>

estate/views/views.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
<field name="partner_id"/>
6969
<field name="date_deadline"/>
7070
<field name="validity"/>
71-
<button name="action_accept_offer" type="object" string="" icon="fa-check"/>
72-
<button name="action_refuse_offer" type="object" string="" icon="fa-times"/>
71+
<button name="action_accept_offer" type="object" string="Accept" icon="fa-check"/>
72+
<button name="action_refuse_offer" type="object" string="Refuse" icon="fa-times"/>
7373
</list>
7474
</field>
7575
<group>
@@ -90,11 +90,10 @@
9090
<field name="name"/>
9191
<field name="value"/>
9292
<separator/>
93-
<filter string="Available" name="Available" domain="['|', ('state', '=', 'new' ), ('state', '=', 'offer received')]"/>
93+
<filter string="Available" name="Available" domain="[('state', 'in', ['new', 'offer_received'])]"/>
9494
<filter string="postcode" name="postcode" context="{'group_by':'post_code'}"/>
9595
</search>
9696

9797
</field>
9898
</record>
99-
10099
</odoo>

0 commit comments

Comments
 (0)