Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] cms_form: port from v13 as not installable #144

Merged
merged 155 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
276bb8b
[ADD] cms_form
simahawk May 29, 2017
c7e908b
Make cms_form* uninstallable
simahawk Oct 2, 2017
bd63938
[MIG][10.0] cms_form
simahawk Oct 2, 2017
5e81e6d
[fix] TMP FIX for v10 ir_qweb issue (addresses #odoo/issues/16641)
simahawk Oct 2, 2017
4cc8519
Make cms_form installable!
simahawk Oct 4, 2017
ddf158b
[MIG][11.0] cms_form
simahawk Jan 19, 2018
05c05f6
[DEL] cms_form: drop ir_ui_view patch for v10
simahawk Jan 19, 2018
66888d7
[REF] cms_form: refactor test models setup
simahawk Jan 19, 2018
cea487b
[fix] cms_form: fields get dynamic non stored fields
simahawk Jan 20, 2018
d093dda
[MIG][11] cms_form: include fix for navbar odoo/odoo/pull/22384
simahawk Feb 3, 2018
111e019
[IMP] cms_form: ease m2o select option override
simahawk Feb 3, 2018
573d9d5
[IMP] cms_form: base test case `get_form`
simahawk Feb 4, 2018
d28fe2e
cms_form: fix some permission issues
simahawk Feb 8, 2018
28b96c7
cms_form: fix master_slave.js change trigger on load
simahawk Feb 8, 2018
137de79
Fix global JS lint
simahawk Feb 9, 2018
7b3a95c
cms_form: fix x2m widget load default value empty
simahawk Mar 2, 2018
47442f5
cms_form: fix x2m widget value comparison
simahawk Mar 2, 2018
439eb56
cms_form: bump 11.0.1.0.2
simahawk Mar 20, 2018
af9f492
Form controller: main_object defaults to empty recordset
simahawk Mar 21, 2018
86e8c35
cms_form: bump 11.0.1.0.3
simahawk Mar 21, 2018
b4557c3
cms_form: add fieldsets support
simahawk Feb 28, 2018
a735b3a
cms_form: ease override of JSON info
simahawk Mar 1, 2018
b95d552
cms_form: bump 11.0.1.0.4 (and add changelog)
simahawk Mar 23, 2018
01ea69a
cms_form widget: fix json params rendering
simahawk Mar 22, 2018
8067394
cms_form date widget: allow custom default today
simahawk Mar 22, 2018
163c8c2
cms_form search: fix date search w/ empty value
simahawk Mar 22, 2018
4da91ec
cms_form: add multi value widget for search forms
simahawk Mar 22, 2018
2b30976
cms_form: add vertical fields option
simahawk Mar 22, 2018
4a98cbc
Fix fieldset support for search forms
simahawk Mar 23, 2018
fc0997e
Delegate field wrapper class computation to form
simahawk Mar 23, 2018
0f3a822
Bump cms_form 11.0.1.1.0
simahawk Mar 26, 2018
6296ff6
cms_form: fix date widget default today only if empty
simahawk Mar 26, 2018
27a6f09
Bump `cms_form` 11.0.1.1.1
simahawk Mar 26, 2018
6dd5e7a
cms_form: move `check_permission` to form
simahawk Mar 29, 2018
001459f
cms_form: fix handling of forms w/ no form_model
simahawk Mar 29, 2018
478ecef
cms_form: improve custom attributes override
simahawk Mar 29, 2018
f8c0873
Form controller: better HTTP status for redirect and no cache
simahawk Mar 30, 2018
bb1308e
cms_form: create/write use a copy of values
simahawk Apr 3, 2018
3513857
cms_form: form_get_widget pass keyword args to ease customization
simahawk Apr 3, 2018
a5d8f24
cms_form: add `lock copy paste` option
simahawk Apr 3, 2018
b6f456d
cms_form: support multiple values for same field
simahawk Apr 3, 2018
3f7916c
cms_form: add error msg block for validation errors
simahawk Apr 3, 2018
020d0c6
cms_form: fix required attr on boolean widget
simahawk Apr 3, 2018
8a6691f
Bump `cms_form` 11.0.1.2.0
simahawk Apr 9, 2018
c5c70a4
cms_form: add fake_session helper for tests
simahawk Apr 9, 2018
f9e2045
cms_form: make test on validation error defensive
simahawk Apr 10, 2018
3e3ab86
cms_form: fix search form regression on permission check
simahawk Apr 13, 2018
b073a2c
Bump `cms_form` 11.0.1.2.1
simahawk Apr 13, 2018
cef2bcf
cms_form: add wizard support
simahawk Feb 24, 2018
c6fbced
Bump `cms_form` 11.0.1.3.0
simahawk Apr 17, 2018
49334e8
Wizard: ease customization of stored values
simahawk Apr 19, 2018
3ab013b
Bump cms_form 11.0.1.3.1
simahawk Apr 22, 2018
68f2139
Fix `fake_session` helper in form tests common
simahawk Apr 22, 2018
9732de6
Add `cms_info`
simahawk Mar 4, 2018
b4c38cb
Form mixin: use permission checks from `cms_info`
simahawk Apr 22, 2018
63ef342
Search form: pass `pager` as render value
simahawk Apr 23, 2018
ece08bb
cms_form: add request marshallers and tests
simahawk Apr 27, 2018
60aae5a
cms_form: include wizard name in form wrapper klass
simahawk Apr 27, 2018
69eae10
Fix wizard rendering tests
simahawk Apr 27, 2018
149c5b6
Bump cms_form 11.0.1.4.0
simahawk Apr 27, 2018
759e3ab
cms_form: add sphinx doc
simahawk Apr 29, 2018
a7f7ad7
Bump cms_form 11.0.1.4.1
simahawk Apr 29, 2018
b68a799
cms_form: update docs [ci skip]
simahawk Apr 29, 2018
f01c31f
cms_form: search form support quick domain rules
simahawk May 11, 2018
1c8f64f
cms_form: use safe default for pager url
simahawk May 11, 2018
69f893b
Bump cms_form 11.0.1.4.2
simahawk May 31, 2018
af67a06
cms_form widgets: fix missing `required` attribute
simahawk Jun 12, 2018
0f1fe27
cms_form: cleanup controller render values
simahawk Jun 12, 2018
cb65e45
cms_form: be defensive on error block render
simahawk Jun 12, 2018
3d261e7
Fix RST linting
simahawk Jun 28, 2018
e9d6762
[UPD] Update cms_form.pot
oca-travis Jun 28, 2018
e86c6ba
[11.0] cms_form: do not use empty strings in search domain
grindtildeath Jun 29, 2018
653e894
Bump cms_form 11.0.1.4.3
simahawk Jul 4, 2018
90bf872
Search form: fix default URL py3 compat
simahawk Jul 4, 2018
d3effd2
Bump cms_form 11.0.1.4.4
simahawk Jul 4, 2018
e909afb
[UPD] Update cms_form.pot
oca-travis Jul 4, 2018
58c1c48
cms_form: handle hidden input automatically
simahawk Jul 6, 2018
07ea8df
Bump cms_form 11.0.1.5.0
simahawk Jul 6, 2018
ba1b3a0
[UPD] Update cms_form.pot
oca-travis Jul 6, 2018
de3cc9b
cms_form: fix regression fields ordering + hidden
simahawk Jul 9, 2018
46f3159
Bump cms_form 11.0.1.5.1
simahawk Jul 9, 2018
6ae12dc
cms_form: selection widget to handle integer values
simahawk Jul 11, 2018
b89ea65
cms_form: fix ordering w/ `groups` protected fields
simahawk Jul 11, 2018
1297533
Bump cms_form 11.0.1.5.2
simahawk Jul 12, 2018
6e38fcd
cms_form: fix `safe_to_date` to make form extractor happy
simahawk Jul 17, 2018
6930c67
cms_form: hidden input respect field type value
simahawk Jul 18, 2018
5dfc79c
cms_form: test `get_widget`
simahawk Jul 21, 2018
b2b7681
cms_form: test css klass methods
simahawk Jul 21, 2018
25ff5e8
cms_form: test field wrapper rendering
simahawk Jul 22, 2018
6861134
cms_form: test `get_form` reusable
simahawk Jul 22, 2018
e7a29ee
cms_form: sort out base test case classes
simahawk Jul 22, 2018
a870586
cms_form: add basic tests for widget
simahawk Jul 22, 2018
776c2ef
cms_form: add test for char widget
simahawk Jul 23, 2018
fae80f2
cms_form: add test for hidden widget
simahawk Jul 24, 2018
78314e0
cms_form: add :float marshaller
simahawk Jul 24, 2018
3437477
cms_form: input hidden support cast to float
simahawk Jul 24, 2018
0b8364e
cms_form: test conversion of no value
simahawk Jul 24, 2018
c5d392a
PEP8
simahawk Jul 24, 2018
b07961e
cms_form: allow to skip HttpCase on demand
simahawk Jul 24, 2018
9f5c94b
cms_form: test fieldsets rendering
simahawk Jul 24, 2018
6a20833
cms_form: fixup tests imports
simahawk Jul 25, 2018
86a96d2
Bump cms_form 11.0.1.6.0
simahawk Jul 25, 2018
f822cf5
cms_form: fix JS indentation date_widget.js
simahawk Aug 7, 2018
47dff54
cms_form: date widget JS datepicker options custom
simahawk Aug 7, 2018
3be5f8d
Bump cms_form 11.0.1.6.1
simahawk Aug 7, 2018
5e89a20
Fix cms_form RST
simahawk Aug 8, 2018
32b68d2
cms_account_form: test coverage 100%
simahawk Aug 5, 2018
36ab63e
cms_form: fix default today on date widget
simahawk Aug 21, 2018
8f0f56a
Bump cms_form 11.0.1.6.2
simahawk Aug 21, 2018
c5ff82f
Added translation using Weblate (French)
grindtildeath Oct 12, 2018
85c4766
Translated using Weblate (French)
grindtildeath Oct 12, 2018
47eb1d2
Update translation files
oca-transbot Dec 9, 2018
a70f62e
cms_form: split widget models to sep files
simahawk Jan 12, 2019
4698baa
cms_form: fix binary widget ignore none values
simahawk Jan 12, 2019
59af2c8
cms_form: widgets test cov 100%
simahawk Jan 12, 2019
fa8de30
cms_form: x2many widget test cov + fix value handling
simahawk Jan 13, 2019
e2c067c
cms_form: binary widget test cov + fix value handling
simahawk Jan 13, 2019
50ef626
cms_form: utils test cov 100%
simahawk Jan 13, 2019
1290a54
cms_form: cms.form.mixin test cov 100%
simahawk Jan 13, 2019
cd9c5a7
cms_form: fix selection widget w/ non-Selection field
simahawk Jan 16, 2019
261e5dd
[REF] cms_form: date widget use snippet animation
simahawk Jan 16, 2019
2b8428c
Bump cms_form 11.0.1.6.3
simahawk Jan 18, 2019
f4e472d
cms_form: go ahead w/ test cov 100%
simahawk Jan 21, 2019
a22d8df
[REF] cms.form.widget.date: use BS datepicker, handle lang
simahawk Jan 16, 2019
82f9fee
[UPD] Update cms_form.pot
oca-travis May 3, 2019
5003ab6
Update translation files
oca-transbot May 3, 2019
adb988f
[ADD] PoC for ajaxifying forms
hbrunn Jun 28, 2019
d27778d
[UPD] Update cms_form.pot
oca-travis Aug 15, 2019
ea5ac59
cms_form 11.0.1.7.0
OCA-git-bot Aug 15, 2019
f2b1c70
[FIX] cms_form. Ajax requests should also allow public user.
NL66278 Aug 22, 2019
2bbc38c
cms_form 11.0.1.7.1
OCA-git-bot Aug 23, 2019
0f1e0d1
Update translation files
oca-transbot Nov 19, 2019
19f7696
Fix possible XSS attack on user input
Nooka10 Dec 17, 2019
ee00966
cms_form 11.0.1.7.2
OCA-git-bot Mar 9, 2020
2436502
cms_form: jump to v13, make uninstallable
simahawk May 16, 2021
4269d60
[REF] cms_form: Black python code
simahawk Apr 18, 2020
20d9d6a
[MIG] cms_form: Migration to 13.0
simahawk Apr 18, 2020
b771686
cms_form: apply pre-commit
simahawk Apr 25, 2020
11617b4
cms_form: msic fixes for v13
simahawk Apr 25, 2020
93174ea
cms_form: marshaller escape optional
simahawk Apr 26, 2020
82b5220
cms_form: marshaller escape test + use html.escape
simahawk Apr 26, 2020
f0de4df
cms_form: refactor tests w/ odoo-test-helper
simahawk May 14, 2021
5a78b81
cms_form: fix copyright year
simahawk May 14, 2021
17db08c
cms_form: fix tabs for BS4
simahawk May 17, 2021
7cf7e8e
Set maintainer on cms*
simahawk Aug 23, 2021
9f1ac17
[UPD] Update cms_form.pot
oca-travis Aug 23, 2021
721f91b
cms_form 13.0.1.0.1
OCA-git-bot Aug 23, 2021
6993951
Added translation using Weblate (Catalan)
Noel000 Feb 15, 2022
870aa2a
Translated using Weblate (Catalan)
Noel000 Feb 15, 2022
bfa896d
Translated using Weblate (Catalan)
Noel000 Apr 13, 2022
3c49386
Update translation files
weblate Oct 9, 2023
cbfd5e6
Added translation using Weblate (Italian)
mymage Nov 13, 2023
7e769f9
Translated using Weblate (Italian)
mymage Nov 13, 2023
ada9b69
cms_form: not installable
simahawk Feb 7, 2025
fb82421
cms_form*: add website to manifest
simahawk Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^cms_form_example/|
^cms_form/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
Expand Down
343 changes: 343 additions & 0 deletions cms_form/CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
=========
CHANGELOG
=========

11.0.1.6.3 (2019-01-18)
=======================

**Fixes**

* binary widget test cov + fix value handling
* x2many widget test cov + fix value handling
* fix selection widget w/ non-Selection field
* cms.form.mixin test cov 100%
* utils test cov 100%
* widgets test cov 100%


11.0.1.6.2 (2018-08-21)
=======================

**Fixes**

* Date widget JS datepicker default date regression

Make sure we use today date unless specified otherwise.


11.0.1.6.1 (2018-08-07)
=======================

**Fixes**

* Date widget JS datepicker options custom

You can now override all the options of the datepicker via `data`.
For instance::

def form_get_widget(self, fname, field, **kw):
"""Customize datepicker."""
if fname == 'date':
kw['data'] = {
'minDate': '2018-01-01'
}
return super().form_get_widget(fname, field, **kw)


11.0.1.6.0 (2018-07-25)
=======================

**Improvements**

* Add `:float` marshaller

You can now use `$foo:float` as field name to cast value to float.

* Hidden input respect field type value

Hidden input values pass through requests as chars.
This means that any m2o or selection field with integer/float values
won't be really happy on create/write.

Now we rely on request marshallers to convert those values
to correct values based on field type.

NOTE: this is the preliminary step for adopting marshallers
for all field types/widgets when needed.


**Fixes**

* Fix `safe_to_date` to make form extractor happy

Form extractor ignores non required fields if their values is `None`.
In the case of the date field, the util was returning `False`
even if the value was not submitted, leading to an ORM error
whenever the missing field was required.

Now we return `None` and let the extractor deal with proper values
and validation.

**Coverage**

* Test field wrapper rendering
* Test css klass methods
* Test `get_widget`
* Test conversion of no value
* Test fieldsets rendering

Make sure fieldsets are not rendered if they have no fields.

* Allow to skip HttpCase on demand

Super-useful when you use pytest which does not support them.

* Add basic tests for widget
* Add test for hidden widget
* Add test for char widget


11.0.1.5.2 (2018-07-12)
=======================

**Fixes**

* Fix ordering w/ `groups` protected fields

If `groups` attribute was assigned to a field
it made fields ordering crash as the field is not there
when groups are not satisfied

* Fix selection widget to handle integer values

`fields.Selection` can hold both strings and integer values.
Till the value was not converted automatically
and using selection fields w/ integer values was a bit complex
as you had to convert it yourself or use a str selection field.

Now the widget inspects selection options
and converts request value accordingly.


11.0.1.5.1 (2018-07-09)
=======================

**Fixes**

* Fix regression fields ordering + hidden

When calling `form_fields` w/ hidden=True/False
the order of the fields was not respected anymore.

This a regression from commit 56b37ca


11.0.1.5.0 (2018-07-06)
=======================

**Improvements**

* Handle hidden input automatically

You can now specify `_form_fields_hidden = ('foo', )`
to get hidden inputs. All fields declared here
will be rendered as `<input type="hidden" />`.


11.0.1.4.4 (2018-07-04)
=======================

**Fixes**

* Search form: fix default URL py3 compat


11.0.1.4.3 (2018-07-04)
=======================

**Fixes**

* Be defensive on error block render (do not fail if none)
* Widgets: fix missing `required` attribute
* Search form: discard empty strings in search domain
* Cleanup controller render values

When you submit a form and there's an error Odoo will give you back
all submitted values into `kw` but:

1. we don't need them since all values are encapsulated
into form.form_render_values
and are already accessible on each widget

2. this can break website rendering because you might have fields
w/ a name that overrides a rendering value not related to a form.
Most common example: field named `website` will override
odoo record for current website.


11.0.1.4.2 (2018-05-31)
=======================

**Improvements**

* Search form: use safe default for pager url
* Search form: support quick domain rules via `_form_search_domain_rules`


11.0.1.4.1 (2018-04-29)
=======================

**Docs**

* Move documentation from README to `doc` folder


11.0.1.4.0 (2018-04-27)
=======================

**Improvements**

* Include wizard name in form wrapper klass
* Add request marshallers and tests
* Search form: pass `pager` as render value

This change is to facilitate templates that need a pager
to generate page metadata (like links prev/next).

A good use case is the SEO friendly `website_canonical_url`.

* Rely on `cms_info` for permission and URLs


**Fixes**

* Fix `fake_session` helper in form tests common


11.0.1.3.1 (2018-04-22)
=======================

**Improvements**

* Wizard: ease customization of stored values

To customize stored values you can override `_prepare_step_values_to_store`


11.0.1.3.0 (2018-04-17)
=======================

**Improvements**

* Add wizard support to easily create custom wizards


11.0.1.2.1 (2018-04-13)
=======================

**Fixes**

* Fix search form regression on permission check

In 32a662e I've moved permission check from controller to form
but I missed the bypass for search forms.


11.0.1.2.0 (2018-04-09)
=======================

**Improvements**

* Add error msg block for validation errors right below field
* Support multiple values for same field

In the input markup you can set the field name as `$fname:list`.

This will make the form transform submitted values as a list.

Example::

<input name="foo:list" type="checkbox" value="1" />
<input name="foo:list" type="checkbox" value="2" />
<input name="foo:list" type="checkbox" value="3" />

Will be translated to: `{'foo': [1, 2, 3]}`


* Add `lock copy paste` option

You can now pass `lock_copy_paste` to widget init via `css_klass` arg
to set an input/text w/ copy/paste disabled.

Example::

def form_get_widget(self, fname, field, **kw):
"""Disable copy paste on `foo`."""
if fname == 'foo':
kw['css_klass'] = 'lock_copy_paste'
return super().form_get_widget(fname, field, **kw)


* `form_get_widget` pass keyword args to ease customization
* Form controller: better HTTP status for redirect (303) and no cache
* Improve custom attributes override
* Move `check_permission` to form

You can now customize permission check on each form.
Before this change you had to override the controller to gain control on it.


**Fixes**

* Fix required attr on boolean widget (was not considered)
* `_form_create` + `_form_write` use a copy of values to avoid pollution by Odoo
* Fix handling of forms w/ no form_model
(some code blocks were relying on `form_model` to be there)


11.0.1.1.1 (2018-03-26)
=======================

**Fixes**

* Fix date widget: default today only if empty


11.0.1.1.0 (2018-03-26)
=======================

**Improvements**

* Delegate field wrapper class computation to form
* Add vertical fields option
* Add multi value widget for search forms
* Improve date widget: allow custom default today

**Fixes**

* Fix fieldset support for search forms
* Fix date search w/ empty value
* Fix json params rendering on widgets


11.0.1.0.4 (2018-03-23)
=======================

**Improvements**

* Ease override of JSON info
* Add fieldsets support
* cms_form_example: add fieldsets forms


11.0.1.0.3 (2018-03-21)
=======================

**Improvements**

* Form controller: main_object defaults to empty recordset

**Fixes**

* Fix x2m widget value comparison
* Fix x2m widget load default value empt^^
Loading