From ca6d495ebf489d4388bebdbc20dd410fb6324919 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 26 Feb 2019 12:18:18 +0000 Subject: [PATCH] [FIX] portal: portal share default get Before this commit, we used dict keys before they existed And made the share button crash After this commit, there is no crash OPW 1943301 closes odoo/odoo#31427 --- addons/portal/wizard/portal_share.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal/wizard/portal_share.py b/addons/portal/wizard/portal_share.py index 8474f2c810c..0da5ce44a7b 100644 --- a/addons/portal/wizard/portal_share.py +++ b/addons/portal/wizard/portal_share.py @@ -10,9 +10,9 @@ class PortalShare(models.TransientModel): @api.model def default_get(self, fields): result = super(PortalShare, self).default_get(fields) - record = self.env[result['res_model']].browse(result['res_id']) result['res_model'] = self._context.get('active_model') result['res_id'] = self._context.get('active_id') + record = self.env[result['res_model']].browse(result['res_id']) result['share_link'] = record.get_base_url() + record._get_share_url(redirect=True) return result