When a question was not displayed (conditional question) or skipped, its
field was still given to create() with a None value. The field was then
emptied instead of keeping its default or computed value.
Since the link to an already created record is given at creation, this
also made sale.subscription.line price_unit equal to 0 when the "free
amount" question was not displayed, instead of the product price.
Fields without value are now left out of the values, which also allows
several conditional questions to fill up the same field (e.g. one list
of amounts per periodicity).
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
A NOT required "other_record" field was always set after the loop with a
write(), even when the linked record was already created. This late write
triggers the recomputation of stored computed fields depending on the
relation, overriding the values answered by the user.
E.g. with subscription_oca, sale.subscription.line price_unit depends on
sale_subscription_id.partner_id/pricelist_id: a free amount typed in a
numerical_box question (33) was replaced by the product price (20) when
the line was linked to its subscription.
Now the relation is given to create() when the linked record already
exists, so that the user's values are protected from recomputation. The
deferred write is kept for records created later.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Display "Multiple choice: only one answer" (simple_choice) survey
questions as a dropdown list instead of radio buttons, per question.
The native radios are kept (hidden by CSS) and still carry the answer:
the dropdown only clicks them, so validation, conditional questions,
"Other" comment, auto-submit and AJAX submit are handled natively.
In review / print mode, only the selected and correct answers are
displayed. Native rendering is kept when suggested answers contain
images.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
New version : 18.0.1.0.1
_mark_done() only set partner_id/email when it created a *new* res.partner.
If the answer already had a partner_id/email (e.g. inherited from the Odoo
user logged in when the /survey/start link was opened), that value was kept
even though the record creation matched or created a different, correct
contact from the participant's own answers.
Now we always sync partner_id/email to the res.partner actually matched or created
from the participant's answers.
Add a migration to relink partner_id/email on existing done submissions.
(cherry picked from commit 0d521278c7 from the branch 16.0)
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
* Show a stored file (after navigating back) the same way as a freshly
selected one: a "filename + Remove file" chip, input hidden until removal.
* Keep the stored file when a page is re-submitted without a new selection
(instead of overwriting it with a skipped answer).
* "Remove file" now sends a sentinel to actually delete the stored file,
so the removal persists across navigation.