-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] estate: updated controller, and
/properties
UI
- added pager (for pagination on the properties page) - added single property page(s) - added menu to the website.layout menus, to navigate to `/properties`
- Loading branch information
Showing
25 changed files
with
269 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from . import models | ||
from . import wizard | ||
from . import controllers | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ | |
'demo/estate_property_demo.xml', | ||
'demo/estate_property_offers_demo.xml', | ||
], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import property_web_view_controlller | ||
from . import property_web_view_controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from odoo import http | ||
from odoo.http import request | ||
|
||
|
||
class PropertyWebView(http.Controller): | ||
@http.route(["/properties", "/properties/page/<int:page>"], type="http", auth="public", website=True) | ||
def show_properties(self, page=1): | ||
step = 6 | ||
offset = (page - 1) * step | ||
|
||
properties = ( | ||
request.env["estate.property"].sudo().search( | ||
[ | ||
"&", | ||
("state", "in", ["new", "offer_received", "offer_accepted"]), | ||
("active", "=", True), | ||
], | ||
limit=step, | ||
offset=offset, | ||
) | ||
) | ||
|
||
total_properties = request.env["estate.property"].sudo().search_count( | ||
[ | ||
"&", | ||
("state", "in", ["new", "offer_received", "offer_accepted"]), | ||
("active", "=", True), | ||
] | ||
) | ||
|
||
pager = request.website.pager( | ||
url="/properties", total=total_properties, step=step, page=page | ||
) | ||
|
||
return request.render( | ||
"estate.estate_property_web_view", {"properties": properties, "pager": pager} | ||
) | ||
|
||
|
||
|
||
@http.route(["/property/<int:id>"], type="http", auth="public", website=True) | ||
def show_property_by_ID(self, id): | ||
property = request.env['estate.property'].sudo().search([('id', '=', id)]) | ||
|
||
if property: | ||
return request.render('estate.estate_property_web_view_single', { | ||
'property': property | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer, res_users | ||
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer, res_users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,4 +118,4 @@ | |
</xpath> | ||
</template> | ||
|
||
</odoo> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.