Commit Graph
34 Commits
Author SHA1 Message Date
Víctor Martínez 8891f25872 [IMP] base_address_city: address field sync city_id.
`_address_fields` are used by `update_address` [1], which is in turn
called by `_fields_sync` and `_children_sync`.

This mechanism is in charge of synchronizing parent/children address fields
for contacts of type == "contact", as they don't really have an address of
their own. They simply copy the address of their parent.

Without this fix, an inconsistency is created between the value of city_id
and the value of the parent.

[1]: https://github.com/odoo/odoo/blob/20648ef21/odoo/addons/base/models/res_partner.py#L429

TT33047

closes odoo/odoo#80236

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-02 10:18:52 +00:00
John Laterre (jol) d4823e4067 [FIX] base_address_city: allow conservation of existing required attributes
Currently, the _fields_view_get_address() method replaces the field
'city' and all of its attributes.

That causes problems for attributes that are defined
in other previously installed modules.

This fix allows the 'required' attributes to be conserved.

closes odoo/odoo#79447

X-original-commit: 1ac8b5a40440e6c4fddc0e088064ea1a706d93ab
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: John Laterre <jol@odoo.com>
2021-11-05 18:59:44 +00:00
wan a0f38c6d97 [IMP] *: partner back2basics 15.0
Review the whole view generally

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:00 +00:00
Thibault Delavallée 2072de7504 [IMP] base_address_city: allow to search cities based on zip
When having cities with similar name it may quickly be difficult to find the
right one. Adding zip code to name search helps finding it more easily.

IN order to match this new _name_search we update name_get accordingly and
display the zip code between parenthesis.

Task ID-2525738

closes odoo/odoo#73359

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-07 09:40:01 +00:00
Achraf (abz) 86214d9b6e [FIX] base_address_city: Duplicate complete address on contact creation
What are the steps to reproduce your issue ?

    1. Install contacts in a db with demo data
    2. Create a contact with complete address
    3. Click on Add button (edit mode)

What is currently happening ?

    The address get copied but not completely (no zip code, state, street)

What are you expecting to happen ?

    The whole address have to be copied

How to fix the bug ?

    Don't call the onchange if the record is not yet created

opw-2415891

closes odoo/odoo#64071

X-original-commit: b731afa7918d9d69132af825c414d902aa57541e
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-01-05 11:37:09 +00:00
Jorge Pinna Puissant d7af73dcb1 [FIX] base_address_city: avoid showing city and city_id field together
Before this commit, when the city_id field was set and then removed,
both city and city_id were shown, you would see 2 city fields in a weird
way.

opw-2312641

closes odoo/odoo#56896

X-original-commit: b381fb0b644cf3c94e798319ceecf5d6b97df9ad
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-09-01 14:02:17 +00:00
Josse Colpaert 64fec81143 [FIX] base_address_city: avoid showing city and city_id field together
Before, when city_id was not set, both city and city_id
were shown, so when you created a new partner, you would
see 2 city fields in a weird way.

Now, we only show both fields when city is set, but not city_id
That way, in case you have some old partners before the installation
of the module, it will still work.

opw-2178992

closes odoo/odoo#43871

X-original-commit: 0a2cf833f9935c44d09ff7c46513dbc37c57bfe8
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-23 17:10:03 +00:00
Swapnesh Shah d928580d23 [FIX] base_address_city: Add parent_id in view
Fixes https://github.com/odoo/odoo/issues/34405
base_address_city adds domain on existing fields which uses parent_id as field_name while it is not present in 'res_partner_view_form_private'

closes odoo/odoo#34498

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-07-01 18:57:06 +00:00
Christophe Simonis 4c61621efb [MERGE] forward port branch 11.0 up to 9a7e3c8b49 2019-04-08 17:45:00 +02:00
Jorge Pinna Puissant f666d78ff1 [FIX] base_address_city: city field without CSS class
Have the module 'City Addresses' installed.
Open a contact, with the city field and  the zip code field filled.

Before this commit, there is a display error, the city and the zip code
are bonded. This occurs because the 'City Addresses' module override all
views with the city field. In this override the city field don't had a
CSS class.

Now, the city and the zip code are display correctly.

opw-1958175

closes odoo/odoo#32455

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-05 11:56:22 +00:00
Christophe Simonis 9c6acbaaa0 [MERGE] forward port branch 11.0 up to e0b14bf9a7 2019-02-05 17:53:35 +01:00
Jorge Pinna Puissant 5ce38b7025 [FIX] base_address_city: lost information when creating Partner from Lead
Cherry pick of 0edd3ea5b4 in version 12.0

Have a Lead with the contact informations (Customer Name, Street,
Street 2, City, State, ZIP, Country) completed in the 'Followup' page.

Before this commit, when the base_adress_city module was installed, the
informations of the City, State and ZIP where lost when we try to create
a new Partner from the Lead.

Now, the informations are present in the Partner form; furthermore if
the country allows enforce cities, the information is also present in
the enforce city form.

OPW-1932018

closes #30644

closes odoo/odoo#30713
2019-01-31 07:43:33 +00:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Lucas Perais (lpe) 526bfca3af [FIX] base_address_city: correct view_get with address fields
Have a partner with children exceeding the limit of the kanban.
Edit,
Add a contact > save and quit
Save the partner

Before this commit, there was a traceback, because a check on parent_id was done to compute
the modifier readonly of the city fields in subviews

However, python onchange gets rid of parent_id because child_ids and parent_id are two faces of the same coin
And if that check were not done, we would end up in an infinite recursion

After this commit, there is no traceback, as we stop checking on parent_id in the case of paged subviews
(list and kanban) because we literally know there is one

OPW 1886320

closes odoo/odoo#27114
2018-11-14 08:33:23 +00:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +02:00
celm1990 caadeeee62 [FIX] base_address_city: avoid unexpected write trigger
This sets the field country_enforce_cities readonly in order to skip inverse field's write on contact creation.

Was PR #24686. Courtesy of Carlos Lopez
2018-06-14 09:39:28 +02:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
ougc27 935b6d6aab [FIX] base_address_city: add missing placeholder
for city and city_id fields
To be consistent with the other fields

Closes #23662
2018-03-15 08:59:06 +01:00
Fabien Pinckaers b341b5ca73 [IMP] Remove duplicate fields names 2018-01-07 19:28:03 +01:00
dbh 0f7930353d [IMP] base,base_address_city,base_setup: give warning if fields have same label to easily identify duplicate field string. 2018-01-04 17:56:52 +05:30
Martin Trigaux abf0e35522 [FIX] base_address_city: bad label name
Fixes  #21870
2018-01-02 17:48:25 +01:00
Christophe Simonis 6c2ab192ea [MERGE] forward port branch saas-16 up to 88a9980b0c 2017-10-10 16:49:59 +02:00
Christophe Simonis 446ff1baf8 [MERGE] forward port branch saas-15 up to b60a41ce14 2017-10-09 17:54:36 +02:00
Laurent Smet 165d13bdb5 [FIX] base_address_city: avoid city_id field duplication
In base/res_partner.py, _fields_view_get calls _fields_view_get_address that could calls again
_fields_view_get in case of address_view_id is specified. That leads to issue in base_address_city
because the _fields_view_get_address method will replace two times the city field and then, we get
a view with two city_id fields.

see #16870 for screenshots
2017-10-09 14:45:26 +02:00
Laurent Smet 13b25fedbf [FIX] base_address_city: revert 7dd344129e
-opw: 774206
2017-10-09 14:45:02 +02:00
Xavier Morel a5e21f69e7 [FIX] P3: view arch should be text-'encoded' XML 2017-08-20 23:25:54 +02:00
Christophe Simonis 780ae8a808 [MERGE] forward port branch saas-15 up to 10cb34bcac 2017-07-04 18:14:13 +02:00
Laurent Smet 7dd344129e [FIX] base_address_city: fix city field duplication (#17919)
In base/res_partner.py, _fields_view_get calls _fields_view_get_address that could calls again
_fields_view_get in case of address_view_id is specified. That leads to issue in base_address_city
because the _fields_view_get_address method will replace two times the city field and then, we get
a view with two city_id fields.

see https://github.com/odoo/odoo/pull/16870 for screenshots
2017-07-04 10:14:53 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
qdp-odoo 9dbe23e038 [FIX] base_address_city, base_address_extended: usability of res.partner form view
*street fields should be editable only if we modify the main partner address
*creating a res.city through the m2o should has default country and a domain
2017-01-13 18:27:37 +01:00
Christophe Simonis 53beafef4e [IMP] base_address_city: mixins limited to a single model are not mixins 2017-01-04 12:04:29 +01:00
qdp-odoo aecf89c0e0 [FIX] base_address_city: fish crash in crm as city_id is defined only on res.partner object 2017-01-04 11:35:56 +01:00
qdp-odoo c7542a9f15 [FIX] base_address_city: _fields_view_get() now working properly 2017-01-04 09:55:49 +01:00
qdp-odoo a14d6bb9ac [ADD] base_address_city: add a module to let the users choose through a list the city instead of a varchar field, when inputting addresses 2016-12-28 11:34:01 +01:00