Files
project_v19/survey_multi_company/controllers/__pycache__/main.cpython-312.pyc
T

25 lines
2.1 KiB
Plaintext
Raw Normal View History

2026-07-01 14:41:49 +07:00
Ë
*DDj9ãó&ddlmZGdde«Zy)é)ÚSurveycó$eZdZdZdˆfd„ ZˆxZS)ÚSurveyMultiCompanyuêOverride survey controller to enforce correct company context.
In multi-company environments, a public/portal user accessing a survey
URL has no explicit active company in their session. Odoo therefore
defaults to the user's *first* allowed company, which may differ from
the company that owns the survey. This can cause:
* Wrong ir.rule evaluation → AccessError or empty recordsets
* Company-specific fields (currency, fiscal position, …) resolved
against the wrong company
* Sequence/numbering pulled from the wrong company
The fix is straightforward: after the parent resolves the survey and
answer sudo records, we call .with_company() on both of them so that
the rest of the survey flow runs in the correct company context.
Compatible with Odoo 19.0 Community where _get_access_data() still
receives (survey_token, answer_token, ensure_token=True) and returns a
dict with at minimum the keys 'survey_sudo' and 'answer_sudo'.
cóøt||||¬«}|jd«}|rS|jrG|j}|j |«|d<|jd«}|r|j |«|d<|S)N)Ú ensure_tokenÚ survey_sudoÚ answer_sudo)ÚsuperÚ_get_access_dataÚgetÚ
company_idÚ with_company) ÚselfÚ survey_tokenÚ answer_tokenrÚdatarÚtarget_companyr Ú __class__s €ú:/mnt/extra-addons/survey_multi_company/controllers/main.pyr z#SurveyMultiCompany._get_access_datas„ø€Ü‰wÑ ˜,°\ð
ˆð—h‘h˜}Ó Ù ˜;×(×3ˆNØ"-×":Ñ":¸>Ó"JˆDÑ ØŸ(™( 1ˆØ&1×&>Ñ&>¸~Ó&Nˆ ó)T)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r Ú
__classcell__)rs@rrrsø„ñ÷* ñ rrN)Ú#odoo.addons.survey.controllers.mainrr©rrú<module>rsðõ