Skip to content

Commit

Permalink
Merge PR #519 into 10.0
Browse files Browse the repository at this point in the history
Signed-off-by NL66278
  • Loading branch information
OCA-git-bot committed Dec 3, 2019
2 parents c9393a2 + 15af0fa commit 0b3ec8e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions partner_address_street3/model/partner.py
Expand Up @@ -2,8 +2,8 @@
# © 2014-2016 Camptocamp SA
# @author: Nicolas Bessi
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models, fields, api
import re
from odoo import api, fields, models


class ResPartner(models.Model):
Expand All @@ -17,3 +17,11 @@ def _address_fields(self):
fields = super(ResPartner, self)._address_fields()
fields.append('street3')
return fields

@api.multi
def _display_address(self, without_company=False):
"""Remove empty lines which can happen when street3 field is empty."""
res = super(ResPartner, self)._display_address(
without_company=without_company)
res = re.sub(r'\n{2,}', r'\n', res)
return res

0 comments on commit 0b3ec8e

Please sign in to comment.