Form Builder improvements:
- Field active
- Add search filter: Archived
- Remove search filters: Not Portal, Not Public
Fix formio.form
method _process_api_components
with res.partner
creation.
Add DEPRECATION warning: _process_api_components: partner creation will be removed from Odoo 18
Improve the installation (post_init_hook
) to auto install the latest stable formio.js (library) version from the GitHub tags API.
Instead of relying (using) the system parameter (ir.config_parameter
) formio.default_version
, which isn't reliable due to the GitHub tags API (30 limit) results and leaves no installed formio.js (library) version.
Improve the reset of installed formio.js versions (download and reinstall of formio.js assets).
This doesn't delete the formio.version record anymore, but replaces the formio.js assets.
Also, the default CSS assets (e.g. bootstrap CSS) are no longer deleted, so manual addition/repair is no longer necessary.
Fix random and unexplainable "ReverseProxy read errors" on webservers other than Nginx (e.g. Caddy, Traefik).
This only required to change /config
and /submission
endpoints from HTTP POST to GET request methods.
Improve Form form-view layout. Move submission fields to the right (group).
In Form (model, views) add field Submission Commercial Entity related to the Submission Partner.
Add endpoint /formio/public/form/new/current/<string:builder_public_current>
that allows to update the form builders (versioning) and keep them published when the state is "Current".
This required to add the formio.builder
model field current_uuid
, that is identical to all formio.builder
records with the same name.
(This is backported code from 17.0)
New feature to allow specific Form URL (query string) params from the form it's iframe src.
This is currently usable for the Scroll Into View feature.
We can provide the param scroll_into_view_selector
, eg to scroll (up) in an embedded wizard form when navigating pages.
Example:
<t t-call="formio.form_iframe">
<t t-set="formio_builder" t-value="formio_builder_object"/>
<t t-set="src" t-value="'/formio/portal/form/' + str(form.uuid)"/>
<t t-set="params" t-value="'scroll_into_view_selector=.progress-wizard'"/>
</t>
In the Form Builder form view, add (alert) info if the schema is empty.
The (alert) info text: Start building a form by clicking the button (fa-rocket) Form Builder
Technical/API change for the formio.form
methods _after_create
and _after_write
:
- Removed the
vals
argument because the respective caller methodscreate
andwrite
raised a Singleton Error uponcopy
.
This also simplifies thecreate
andwrite
methods. - Call the
_process_api_components
method per record iteration.
Add descriptions with recommended modules in the formio.builder.js.options
data.
Improve the Form Builder and Form button styling (colors).
Improvements for the formio.builder.js.options
:
- Add a wizard to merge other
formio.builder.js.options
record fieldvalue
. - Add default and tracking for
formio.builder.js.options
fieldvalue
.
Add a utils function json_loads()
:
Refactored the try/except
with json.loads()
and ast.literal_eval()
calls, to use the utils json_loads()
function.
Improvements and migration for the formio.builder.js.options
:
- Add
editForm
components and options informio_builder_js_options_default
. - Change
formio_builder_js_options_default
storage from Python Dict to JSON notation/syntax. - Migrate
formio.builder
records (field)formio_js_options
to merge the updatedformio_builder_js_options_default
. - Migrate
formio.builder.js.options.default
records to merge the updatedformio_builder_js_options_default
. - Improve the "Form Builder formio.js Options" form view (
view_formio_builder_js_options_form
): Addwidget='ace'
(mode: js
).
Form Builder view improvements:
- Don't show Auto-save badge if state is CURRENT.
- Switch Locked and Auto-save badge positions.
- Unlocked badge as warning.
In the Form Builder, show a "Locked" badge in case it is locked.
- Fix crashing forms due to 16.0.11.16 (Scroll Into View).
- Improvements for Scroll Into View feature.
- Backwards compatibilty fix for (component) onChange event.
Add configurable automatic scrolling, especially useful in long-page wizard forms after switching previous/next page.
This scrolls an element (CSS selector) into the visible area of the browser window.
The element (CSS selector) can be set in the Form Builder for portal and public forms.
Fix form formio.form
create, to set public_share
by its formio.builder``public
field.
This is still done (but not harmful) by _onchange_builder
which needs to be fixed or removed.
Fix ir.actions.server
model _constraint_unique_formio_ref
method:
ValueError: Expected singleton: ir.actions.server
Fix Form Builder with Autosave disabled to show the Save Form button when moving (ordering) components.
Improve the form (component) onChange API to apply Form options described in:
https://help.form.io/developers/form-development/form-renderer#form-renderer-options
Fix public /formio/public/form/<form_uuid>/config
endpoint.
Pass the formio.form
model object to methods _etl_odoo_config()
and _etl_odoo_data
.
In Form Builder, when Autosave is disabled, highlight a colored border when a manual saving is required.
Workaround for Safari 16.6 (AFAIK), with Columns in a Data Grid.
The Columns become too narrow and unusable in a Data Grid.
GitHub issue: formio/formio.js#5426
This workaround adds 1 CSS rule, which adds a width: 100%
to the
first <td/>
(column) targeted in a Data Grid table.
#formio_form_app table.datagrid-table tbody tr td:first-child {
width: 100%;
}
Fix form component "change" and "blur" (JS) APIs.
An overlay was always expected, but it is not enabled by default, resulting in no API execution!
Update system parameter formio.default_version
: 4.17.3
Hide field builder_id_domain
in formio.form
form view.
- Sidebar panel disappears for long forms. This reverts some (resizing) changes from 16.0.7.0.
- Show the "Auto-save" setting in the dock before State.
Possibility to redirect the (parent) window upon submit of an embedded public form.
The redirect occurs if the <iframe/>
has set:
- URL query-param
?embed
(any value allowed). - Following
sandbox
attribute with values (AFAIK):sandbox="allow-same-origin allow-scripts allow-top-navigation"
(Sizing weight/height is not covered here):
<iframe src="https://www.example.com/formio/public/form/new/some-UUID?embed=1"
sandbox="allow-same-origin allow-scripts allow-top-navigation"/>
Add Form component onBlur and onChange "Overlay timeout" (frontend) API.
Improvement for change in 16.0.8.3 (caching):
Allow certain URLs (routes) to accept query (params) string.
This ensures no WARNINGs ... called ignoring args ...
will appear in the Odoo server log.
Update system parameter formio.default_version
: 4.17.2
CSRF protection for forms. To protect the submit endpoints from abuse and spam.
This also removes the custom JSON-RPC implementation with XMLHttpRequest (XHR), which is still jQuery (to be replaced by native XHR soon).
Also removed several unused kwargs
from controller methods (arguments).
Fix public form submit endpoint.
Revert (accidentally) removed import
in public controller.
Fix UI rendering of a public (existing) form.
JS Console error: Uncaught ReferenceError: importPath is not defined
Fix sequence of form events and its async callback actions, by queue-ing the sequence of async callback actions into a Promise object.
This ensures the sequence of async callback actions will be resolved (executed) in the same order of the JS event stack.
Form improvement:
Avoid browser caching for Form assets files (CSS, JS).
Form Builder default Auto Save enabled.
Because Odoo also does.
Improvement:
Bypass any 'Administration/Access Rights' access error in the low-level method _get_builder_from_id
used with form creation etc.
Use sudo
in formio.form
method _get_builder_from_id
.
This is considered safe, because it's a low-level method.
Form UI overlay, to block user interaction while loading and upon wizard state and submission.
Advanced Form submit endpoint and response handling:
In the client/browser (JS), upon form submission return the form its submission_data
(JSON) in the response and write it to the (JS) formio.js form object.
This allows to update the form (data) by backend/server code from the submission_data
in the response.
Debug logging the /submit
endpoints, by enabling the new "Debug Mode" field in the Form Builder.
Some Python code (Black) formatting improvements.
Form Builder improvement:
Avoid browser caching for Form Builder assets files (CSS, JS).
Form Builder layout and styling improvements:
- Revert (accidental) removal of language buttons CSS.
- Improve spacing between language buttons and actions (save form button, auto-save message).
Form Builder improvements:
- Automatically resize the height.
- Auto-save or manual-save (switch) per Form Builder design.
- Remove the 'Fullscreen' mode (button), which causes resizer issue.
- Changes some from HTML (CSS) classes to ids.
Add current language (res.lang
) IETF code/tag to the form componentChange
payload.
Rename label of formio.form
field submission_data
, from Data
to Submission Data
.
Add formio.form
(Form) after_save_draft
method and execute it in the /submit
endpoints (backend, portal, public).
Still one Form loading regression (bug) in template formio_form_public_embed
.
Due to incomplete implementation of the new (loading) spinner implementation in v16.0.6.6.
Form loading on portal and public/website.
Due to incomplete implementation of the new (loading) spinner implementation in v16.0.6.6.
Put the form builder (loading) spinner in dedicated <div/>
which hides when the form builder has been rendered.
- Menu renaming: 'Forms' to 'Form Submissions'
- Put the form (loading) spinner in dedicated
<div/>
which hides when the form has been rendered.
Security fix / meaurement:
Deny update of submission_data
(field) upon form update, if the form has state 'Completed' or 'Cancelled'.
Updated Dutch translations (nl.po file).
Improvement for translations:\
- Add translate function in
formio.builder
model - Set language (IETF code) in payload of
customValidation
hook.
In Form Builder form-view, add group "main" in top of the notebook/page "formio_components_api".
Fix standalone form (formio.form
) record create, shouldn't set the res_id
.
This also results in a visible button to open the linked resource.
Changes:\
- Implement the formio.js
customValidation
hook, which XHR posts to the API / validation endpoint. - Some code reorder, cleanup and comments.
Fix regression due to 16.0.5.0
regarding formio.js version assets with ir_attachment.location
default or set to file
.
The (storage) location of the font files was wrong. It should be in the CSS assets directory, for correct (relative) resolving.
Ensure record rule(s) modifications are not reverted, so noupdate="1"
.
PR #243, with additional improvements.
Improve storing and serving frontend assets determined by the configurable ir_attachment.location
.
This supports particular Odoo instances with other storage mechanisms - eg S3 buckets, Azure files.
Additionally, this will work for a multi-node installation, with an instance other than the one that stores the files.
Add to Python eval context of ir.actions.server
code:
_logger
- logger objectos.getenv
- get (os) environment variable function
Fix and improve 'datetime' component localization and translations:\
- Fix and improve
patchRequireLibrary
(JS function) to gradually determine the arguments. - Fix and improve Form Builder
setLanguage
to localize datetime components.
Ensure external JavaScript libraries get loaded as expected by a common CDN.
This introduces the patchRequireLibrary
(JS function) which alters some library URLs the formio.js CDN
class fetches.
Currently the Flatpickr localizations URLs are altered.
Render a new portal form by the generic QWeb form template.
This ensures to apply any extra form builder config/settings.
Backwards formio.js compatibility fix:
Apply patchCDN
if there's an instantiated Formio.cdn
object.
Make formio.js CDN for hot-loaded dependencies configurable.
Make use of the formio.js CDN class to override the base URL for all 3rd party assets that are loaded on-the-fly by formio.js lib.
This includes for example ACE, CKEditor, Flatpickr, Quill etc.
The Cloudflare CDN is set as the default value.
They have a page about the GDPR: https://www.cloudflare.com/trust-hub/gdpr/
It's also possible to override the default value to a (paid) GDPR-aware CDN like KeyCDN.com or GlobalConnect.no and host the required files there,
or simply point it to the base URL of their Odoo install and ship the files.
This would require pinning the formio.js version, since different versions of the library need different dependencies.
Fix migration for version 16.0.3.1 - upgrade error:
UniqueViolation: duplicate key value violates unique constraint "ir_config_parameter_key_uniq"
Style (highlight) active language button.
The "Forms" Button in the Form Builder view.
Archive functionality for formio.js versions (also unarchive and search filter).
Wizard draft autosave mode.
This allows complex components to serialize their data on the form before submitting it.
Improve app/module installation, by downloading and installing a default formio.js library version after install.
Also log a warning in case an error (eg ConnectionError) occurs.
This solves the deprecation warning, regarding a domain that may not be returned by an onchange method.
Replace the _onchange_builder_id
method (implementation), by a new computed field builder_id_domain
and 2 new methods:
_compute_builder_domain
_get_builder_domain
.
This also affects the implementation replacement in additional modules which should be updated as well !
Eg: formio_crm
, formio_partner
, formio_purchase
, formio_sale
.
WARNING / UPDATE REQUIREMENT
Update all modules which implemented the _onchange_builder_id
method.
For the (Nova Code) Forms modules those are:
- formio_crm
- formio_partner
- formio_purchase
- formio_sale
2. Add new feature which allows Form Builders in "Draft" or "Obsolete" state to be choosen in a new Form in the backend.
The 2 setting fields are available in the Form Builder:
- Use Draft in Backend
- Use Obsolete in Backend
In the Form Builder, implement conditional warning (also extendable) in case there are integrated APIs.
This warns the Form Builder user about components being removed or updated, which could lead the API regression/breakage.
- Fix language determination (cascade) for public Form load by UUID.
- Add cascade delete on
formio_version_id
in modelformio.version.translation
.
Backend Forms layout improvements:
- Form resizing according to the Form Builder (setting) field
iFrame Resizer bodyMargin
.
Concerns the fieldname:iframe_resizer_body_margin
- Improve the form view (sheet) height and styling.
Update iframe-resizer v4.3.6 (JS library).
Add form/builder heightCalculationMethod 'taggedElement' targets in portal and public templates.
Change form 'heightCalculationMethod' from 'lowestElement' to 'taggedElement'.
This solves issues for components with dynamic height, eg the collapsible Edit Grid (type editgrid
).
Change form 'heightCalculationMethod' from 'grow' to 'lowestElement'.
Improvement to scale dynamically form height.
Remove formio.version
Many2many translations
field.
Refactoring done and migrated in 16.0.2.0.
Fix the formio.form
function _get_public_form_js_locales
(wrong argument), called in the config route/endpoint.
Enable a portal and/or public Form to redirect (page) to URL upon a Save Draft is Done.
This can be set in new fields in the Form Builder:
- Portal Save-Draft Done URL
- Public Save-Draft Done URL
Enhance the public Form access-check, by allowing custom implementation(s) configured by a new selection field public_access_rule_type
,
with current choice time_interval
Other public_access_rule_type
choices with a inheritted public_access
(method) check implementation can be implemented by modules and apps
Updating this module also executes a migration, which ensures existing form builders set the public_access_rule_type
field value to time_interval
.
Fix formio.js version (action/button) Download and install error:
ValueError: max() arg is an empty sequence
.
Initialize the translations sequence properly.
Improvements for Version Translations (model: formio.version.translation
):
- Compute and store origin (base translation, user added).
- Compute and show whether a copied (origin) base translation has been updated.
- Add sequence field. So translations can be ordered to ease admnistration and the translation override implementation.
Fix name_get
method (models: formio.translation
, formio.version.translation
)
Major improvements for translations:
- Specific Version Translations instead of linking (Many2many) to the available Base Translations.
- Translations (overrides) of formio.js source properties in the form builder.
Add noupdate=1
for the xmlid formio.version_dummy
data (record).
This prevents recreation when the dummy version has been archived (is inactive).
Fix the component data URL check in the Form JS (rendering) code.
Improve loading "Extra Assets" (js, css), by targetting before
or after
the core assets.
Form Builder: Disallow create and edit for field "formio.js version".
Form Builder Lock/Unlock buttons with primary color.
Fix portal /my page.
Improve Form Builder "Actions API" tab (layout and info).
Migrate (v15) datetime component localization and translations:
- Set
extra_assets
in controllers template vars. - Implement locales administration and passing to the (JS) frontend.
- Set default and update the datetime (flatpickr) locale by language chooser in a form.
Improvements for administration of "Extra Assets" (js, css) with link/relation to attachments.
Affected models: formio.extra.asset
, ir.attachment
.
Implement "Forms Ref" field on several models regarding assets and attachments:
formio.version.asset
, formio.extra.asset
, ir.attachment
This facilitates purposes like export/import tools.
Minor layout (width) fix in Form Builder Translations tab.
Improve form builder wizard save as draft: previous page, page clicked.
Fix deprecation warning in (http) controller send_fonts_file
, by using Werkzeug's implementation.
Initial release.