changeset 7f256813ee65 in modules/company:default
details: https://hg.tryton.org/modules/company?cmd=changeset;node=7f256813ee65
description:
        Reload the context after creating a company with the config wizard

        To get the new company set in the context, we must not fill the context 
with an
        empty company nor employee.

        issue9543
        review318451002
diffstat:

 company.py |  3 +++
 res.py     |  6 ------
 2 files changed, 3 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r 8d9323751b81 -r 7f256813ee65 company.py
--- a/company.py        Thu Sep 17 17:18:02 2020 +0200
+++ b/company.py        Mon Oct 12 12:57:49 2020 +0200
@@ -134,6 +134,9 @@
                 })
         return 'end'
 
+    def end(self):
+        return 'reload context'
+
 
 class CompanyReport(Report):
 
diff -r 8d9323751b81 -r 7f256813ee65 res.py
--- a/res.py    Thu Sep 17 17:18:02 2020 +0200
+++ b/res.py    Mon Oct 12 12:57:49 2020 +0200
@@ -114,12 +114,6 @@
                 res['main_company'] = user.main_company.id
                 res['main_company.rec_name'] = user.main_company.rec_name
             res['employees'] = [e.id for e in user.employees]
-        if user.employee:
-            res['employee'] = user.employee.id
-            res['employee.rec_name'] = user.employee.rec_name
-        if user.company:
-            res['company'] = user.company.id
-            res['company.rec_name'] = user.company.rec_name
         return res
 
     @classmethod

Reply via email to