Commit Graph

11 Commits

Author SHA1 Message Date
0020f35399 [FIX] survey_record_generation: questions without answer no longer empty fields
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>
2026-10-23 08:54:48 +00:00
bfe59096db [FIX] survey_record_generation: link to already created record at creation
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>
2026-10-23 08:54:48 +00:00
2835e2d2be [FIX] survey_record_generation: partner_id/email on survey.user_input could be wrong
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m48s
tests / test (pull_request) Successful in 1m8s
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>
2026-10-10 17:16:45 +02:00
aff1a6caae [IMP] survey_record_generation : new option update_existing_fields
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m32s
2026-04-09 15:14:49 +02:00
94d3bd72b1 [ADD] survey_record_generation : migrate from 16 to 18
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m30s
2026-03-25 17:56:22 +01:00
eced098fbb init 18.0 2026-03-24 14:42:53 +01:00
e1c2be8939 [IMP] survey_record_generation : fill up user_input.partner_id when creating a res.partner
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m34s
2026-01-13 12:32:07 +01:00
7183ff6f54 [IMP] survey_record_generation : add param ignore_if_mandatory_field_is_missing
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m38s
2025-11-13 17:44:44 +01:00
f709adbcec [IMP] survey_record_generation: feature be able to update existing record
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m38s
2025-11-03 17:38:01 +01:00
fd25c2b970 [IMP] survey_record_generation: first refacto of record creation
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m33s
2025-10-23 15:06:03 +02:00
7d638c4e92 [IMP] survey_record_generation : add tests on record creation
Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m37s
2025-10-15 19:20:39 +02:00