Skip to content

Commit

Permalink
[FIX] base: The partner's type can't be set to 'contact' when the nam…
Browse files Browse the repository at this point in the history
…e is null.
  • Loading branch information
anhbtit authored and phamgiang2510 committed Jul 2, 2024
1 parent 853f6bb commit bfa129c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions openupgrade_scripts/scripts/base/17.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,13 @@ def _update_partner_private_type(cr):
openupgrade.logged_query(
cr,
"""
UPDATE res_partner
SET type = 'contact'
WHERE type = 'private'
UPDATE res_partner
SET type = CASE
WHEN name IS NOT NULL THEN 'contact'
WHEN name IS NULL THEN 'other'
ELSE type
END
WHERE type = 'private';
""",
)

Expand Down

0 comments on commit bfa129c

Please sign in to comment.