|
|
@ -27,7 +27,10 @@ class SurveySurvey(models.Model): |
|
|
|
} |
|
|
|
stat = dict((sid, default_vals) for sid in self.ids) |
|
|
|
UserInput = self.env["survey.user_input"] |
|
|
|
base_domain = [("survey_id", "in", self.ids)] |
|
|
|
base_domain = [ |
|
|
|
("survey_id", "in", self.ids), |
|
|
|
("invite_token", "!=", False), |
|
|
|
] |
|
|
|
|
|
|
|
read_group_res = UserInput._read_group( |
|
|
|
base_domain, |
|
|
@ -78,23 +81,15 @@ class SurveySurvey(models.Model): |
|
|
|
ctx = dict(self.env.context) |
|
|
|
search_done = ctx.get("search_default_completed", None) |
|
|
|
action = super(SurveySurvey, self).action_survey_user_input() |
|
|
|
if ctx.get("shared_only", False): |
|
|
|
domain = action.get("domain") or [] |
|
|
|
if isinstance(domain, str): |
|
|
|
domain = eval(domain) |
|
|
|
if len(domain) > 1: |
|
|
|
action["domain"] = AND( |
|
|
|
[[("invite_token", "!=", False)], normalize_domain(domain)] |
|
|
|
) |
|
|
|
else: |
|
|
|
action["domain"] = [("invite_token", "!=", False)] |
|
|
|
action["display_name"] += _(" (from sharing)") |
|
|
|
if ctx.get("search_default_shared_invite", False): |
|
|
|
action["display_name"] += _(" (shared)") |
|
|
|
if search_done is not None: |
|
|
|
act_ctx = action.get("context") or {} |
|
|
|
act_ctx = action.get("context") or dict() |
|
|
|
if isinstance(act_ctx, str): |
|
|
|
act_ctx = eval(act_ctx) |
|
|
|
if "search_default_completed" in act_ctx: |
|
|
|
if bool(act_ctx["search_default_completed"]) is not bool(search_done): |
|
|
|
act_ctx["search_default_completed"] = int(bool(search_done)) |
|
|
|
action["context"] = act_ctx |
|
|
|
if "search_default_completed" in act_ctx and bool( |
|
|
|
act_ctx["search_default_completed"] |
|
|
|
) is not bool(search_done): |
|
|
|
act_ctx["search_default_completed"] = int(bool(search_done)) |
|
|
|
action["context"] = act_ctx |
|
|
|
return action |