Name:
[IMP] viin_brain,viin_web_editor: Brain core UI polish wave — runtime bug + a11y/responsive
State:
Killed
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#37
Committer:
David Tran
Committer Email:
davidtran.hp@gmail.com
Commit:
576fe611e78e6f80246f0356ff5f8e8836a52eac
Description:
[FIX] viin_brain: share dialog crash/no-link + friendly link-to-record picker
Two UX/runtime issues found in review:
1. Share dialog (share_dialog):
- Toggling "Public link" threw "Cannot read properties of undefined
(reading 'state')" — the CheckBox onChange was wired as
`onChange="(val) => onToggleLink(val)"`, an unbound inline arrow that
OWL invoked without the component as `this`. Use `onChange.bind` so the
handler keeps its component binding.
- "Save settings" created the link but the public URL never appeared: the
URL block is gated on `state.enabled`, which onSave never set. Saving a
share link now sets `state.enabled = true` so the URL + Copy show.
2. Link-to-record (link_record_dialog): replaced the raw "model:id" text box
(e.g. "res.partner:42" — meaningless to end users) with Odoo's native
friendly pickers — ModelSelector ("Document type", model display names) +
RecordSelector ("Document", record-name autocomplete). Optional admin
whitelist via _brain_default_linkable_models; empty = all models (Odoo
reference-field default). Output contract unchanged (onConfirm "model:id").
Handlers passed with `.bind` to avoid the same unbound-`this` class of bug.
Verified in a live Odoo 17 instance: share toggle no longer crashes and the
URL shows after save; the link dialog renders the model→record friendly chain;
the Brain form-sidebar (Brain Pages stat + Brain Note + BRAIN rail) renders
correctly on chatter forms (res.partner) — issue #3 was blocked by #2, not a bug.
Branch:
17.0
Instance ID:
0
Age:
Up-time:
Not finished