diff options
| author | Romain Derie <rde@odoo.com> | 2019-05-21 10:01:58 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2019-05-21 10:01:58 +0000 |
| commit | 90dec44a286c69f31b3fbcf3302f16fdf90d4a5d (patch) | |
| tree | 8bf049d0789e53d1148de23278a477a2e2f9f9c0 /addons/website/tests/test_get_current_website.py | |
| parent | 7b00776c6c59851a3de3d6e379f354671954d122 (diff) | |
[FIX] website: restore the add of website_id on user at signup
Since b5a12b4aac the website_id was not set anymore.
Indeed, before this commit website_id was the field from the inherits, thus
when writing on website_id from res.user, we would write on the partner field.
But with b5a12b4aac the website_id was explicitely overrided on res.users as a
related to res.partner (its inherits) with readonly=True.
Thus, writting website_id on res.users was not working anymore.
closes odoo/odoo#33521
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website/tests/test_get_current_website.py')
| -rw-r--r-- | addons/website/tests/test_get_current_website.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website/tests/test_get_current_website.py b/addons/website/tests/test_get_current_website.py index a71126cb484..57d85887b4d 100644 --- a/addons/website/tests/test_get_current_website.py +++ b/addons/website/tests/test_get_current_website.py @@ -112,3 +112,10 @@ class TestGetCurrentWebsite(TransactionCase): self.assertEqual(Website._get_current_website_id('site-1.com:81', False), website2.id) self.assertEqual(Website._get_current_website_id('site-1.com:82', False), website1.id) self.assertEqual(Website._get_current_website_id('site-1.com', False), website1.id) + + def test_02_signup_user_website_id(self): + website = self.env['website'].browse(1) + website.specific_user_account = True + + user = self.env['res.users'].create({'website_id': website.id, 'login': 'sad@mail.com', 'name': 'Hope Fully'}) + self.assertTrue(user.website_id == user.partner_id.website_id == website) |
