Skip to content

Conversation

@simahawk
Copy link

@simahawk simahawk commented Feb 7, 2025

Module already avail in v14 as uninstalled.
Here's a backport from v16 of all the improvements + adaptations for v14.

**Attributes become fields**

All attributes that configure a form are now odoo fields.
Fields that are just for configuration/behavior
(meaning that shouldn't be consider in form rendering)
must have the flag `form_tech=True`.

Default configuration can be set by overriding fields' defaults.
For instance, to declare the model::

    form_model_name = fields.Char(default="res.partner")

or to declare which fields to use::

    form_model_fields = Serialized(default=("name", "country_id"))

Same story for widgets.

**Fields lookup API change**

`form_fields()` and `form_fieldsets()` are not available anymore.

You must use `form.form_fields_get()` and `form.form_fieldsets_get`.
When the transaction is rolled back due to an pg error
use a new env to be able to inject the status message
otherwise a dead request will be used.
You can now use form_widget={...} field attribute
to provide your own widget for the form.
Centralize lookup for attributes via private api
Allows forms to customize the html name of each widget.
Very handy in case you want to combine multiple forms together.
Transform  inputs to list of dict values
Before this change the session was not stored at all on the filesystem
Form fields have precedence over model fields.
However, it's handy to override just few params
instead of the whole field.
Form fields can now be hidden via ´form_hidden' attr.
Ivorra78 and others added 13 commits February 7, 2025 09:30
Currently translated at 100.0% (128 of 128 strings)

Translation: website-cms-16.0/website-cms-16.0-cms_form
Translate-URL: https://translation.odoo-community.org/projects/website-cms-16-0/website-cms-16-0-cms_form/es/
Handy to force redirect down the stack.
Currently translated at 100.0% (128 of 128 strings)

Translation: website-cms-16.0/website-cms-16.0-cms_form
Translate-URL: https://translation.odoo-community.org/projects/website-cms-16-0/website-cms-16-0-cms_form/it/
Currently translated at 35.1% (45 of 128 strings)

Translation: website-cms-16.0/website-cms-16.0-cms_form
Translate-URL: https://translation.odoo-community.org/projects/website-cms-16-0/website-cms-16-0-cms_form/ca/
These tests require some adaptations for the ``mock`` lib version
that is now working properly w/ py3.6 used in the OCA build.
@github-actions
Copy link

github-actions bot commented Jul 6, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 6, 2025
@simahawk simahawk removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 9, 2025
@github-actions
Copy link

github-actions bot commented Nov 9, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 9, 2025
@github-actions github-actions bot closed this Dec 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants