# Support structured address

**URL:** https://discuss.tryton.org/t/support-structured-address/8238
**Category:** Feature
**Created:** [January 24, 2025, 11:52pm UTC](https://discuss.tryton.org/t/support-structured-address/8238 "2025-01-24T23:52:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [January 24, 2025, 11:52pm UTC](https://discuss.tryton.org/t/support-structured-address/8238/1 "2025-01-24T23:52:50Z")

</div>

## Rational

There are needs to have structured addresses like [SEPA will use in the future a structured address instead of their current schema (#13190) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/13190)

## Proposal

Using libraries like [deepparse](https://deepparse.org/) or [libpostal](https://pypi.org/project/pylibpostal) is not really a solution because we need to provide complete control to the user over the data stored and also those libraries are complexe to install and heavy to run.  
I propose to convert the `street` into a `Function` fields and to store unstructured data as `street_unstructured`. The `Function` will compute the `street` content based on the structured data (if provided) using the address format of the country otherwise it uses the unstructured data.  
The structured data will be `street_name`, `building_name` (from `name`), `building_number`, `unit_number`, `floor_number` and `room_number`. But also `post_box`, `private_bag` and `post_office`.  
The current format data will be extended using [https://www.upu.int/en/Postal-Solutions/Programmes-Services/Addressing-Solutions](https://www.upu.int/en/Postal-Solutions/Programmes-Services/Addressing-Solutions)

## Implementation

- [Add structured address (!2161) · Merge requests · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/merge_requests/2161)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [January 24, 2025, 11:53pm UTC](https://discuss.tryton.org/t/support-structured-address/8238/2 "2025-01-24T23:53:27Z")

</div>

Please check the countries for which you now the rule of postal address format.

---

<div class="post-metadata">

### Author: ![acaubet](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/acaubet/32/1493_2.png) [@acaubet](https://discuss.tryton.org/u/acaubet)
#### Post date: [June 4, 2026, 11:38am UTC](https://discuss.tryton.org/t/support-structured-address/8238/3 "2026-06-04T11:38:05Z")

</div>

One concern I have is the edit flow.  
If the user enters the structured components first, `street` is generated from them. But if the user then edits that generated `street`, the structured values are cleared and the address becomes unstructured again.  
That behavior is technically consistent, but it is not obvious to users. I think `street` should be read-only whenever structured fields are used, and only act as a preview of the formatted address.  
Otherwise, it is too easy to lose the structured data by editing the rendered string.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 4, 2026, 3:10pm UTC](https://discuss.tryton.org/t/support-structured-address/8238/4 "2026-06-04T15:10:26Z")

</div>

> [@acaubet](#):
>
> I think `street` should be read-only whenever structured fields are used

And this is what has been implemented one year ago.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [June 15, 2026, 6:00am UTC](https://discuss.tryton.org/t/support-structured-address/8238/5 "2026-06-15T06:00:07Z")

</div>

This topic was automatically closed after 10 days. New replies are no longer allowed.
