Skip to content

Commit

Permalink
[REF] website_portal_address: Black python code
Browse files Browse the repository at this point in the history
  • Loading branch information
mathben committed Mar 8, 2020
1 parent 60b126c commit 0c6d3b6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
4 changes: 1 addition & 3 deletions website_portal_address/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
Odoo Community Association (OCA)""",
"website": "http://www.serpentcs.com",
"license": "AGPL-3",
"depends": [
"website_portal_contact",
],
"depends": ["website_portal_contact",],
"data": [
"security/ir.rule.csv",
"views/assets.xml",
Expand Down
42 changes: 27 additions & 15 deletions website_portal_address/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,40 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from openerp.http import request, route
from openerp.addons.website_portal_contact.controllers.main \
import WebsiteAccount as PortalController
from openerp.addons.website_portal_contact.controllers.main import (
WebsiteAccount as PortalController,
)


class WebsiteAccount(PortalController):

@route("/my/contacts/<model('res.partner'):contact>", auth="user",
website=True)
@route(
"/my/contacts/<model('res.partner'):contact>",
auth="user",
website=True,
)
def portal_my_contacts_read(self, contact):
values = self._prepare_portal_layout_values()
values.update({
"state_id": request.env['res.country.state'].sudo().search([]),
"country_id": request.env['res.country'].sudo().search([]),
"contact": contact,
"fields": self._contacts_fields(),
})
values.update(
{
"state_id": request.env["res.country.state"].sudo().search([]),
"country_id": request.env["res.country"].sudo().search([]),
"contact": contact,
"fields": self._contacts_fields(),
}
)
return request.website.render(
"website_portal_contact.contacts_followup", values)
"website_portal_contact.contacts_followup", values
)

def _contacts_fields(self):
res = super(WebsiteAccount, self)._contacts_fields()
res += ['type', 'street', 'street2',
'city', 'zip',
'country_id', 'state_id']
res += [
"type",
"street",
"street2",
"city",
"zip",
"country_id",
"state_id",
]
return res

0 comments on commit 0c6d3b6

Please sign in to comment.