Skip to content

Commit 36277c7

Browse files
committed
Merge PR #144 into 14.0
Signed-off-by simahawk
2 parents 838f341 + fb82421 commit 36277c7

File tree

92 files changed

+9377
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+9377
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exclude: |
22
(?x)
33
# NOT INSTALLABLE ADDONS
4-
^cms_form_example/|
4+
^cms_form/|
55
# END NOT INSTALLABLE ADDONS
66
# Files and folders generated by bots, to avoid loops
77
^setup/|/static/description/index\.html$|

cms_form/CHANGES.rst

Lines changed: 343 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,343 @@
1+
=========
2+
CHANGELOG
3+
=========
4+
5+
11.0.1.6.3 (2019-01-18)
6+
=======================
7+
8+
**Fixes**
9+
10+
* binary widget test cov + fix value handling
11+
* x2many widget test cov + fix value handling
12+
* fix selection widget w/ non-Selection field
13+
* cms.form.mixin test cov 100%
14+
* utils test cov 100%
15+
* widgets test cov 100%
16+
17+
18+
11.0.1.6.2 (2018-08-21)
19+
=======================
20+
21+
**Fixes**
22+
23+
* Date widget JS datepicker default date regression
24+
25+
Make sure we use today date unless specified otherwise.
26+
27+
28+
11.0.1.6.1 (2018-08-07)
29+
=======================
30+
31+
**Fixes**
32+
33+
* Date widget JS datepicker options custom
34+
35+
You can now override all the options of the datepicker via `data`.
36+
For instance::
37+
38+
def form_get_widget(self, fname, field, **kw):
39+
"""Customize datepicker."""
40+
if fname == 'date':
41+
kw['data'] = {
42+
'minDate': '2018-01-01'
43+
}
44+
return super().form_get_widget(fname, field, **kw)
45+
46+
47+
11.0.1.6.0 (2018-07-25)
48+
=======================
49+
50+
**Improvements**
51+
52+
* Add `:float` marshaller
53+
54+
You can now use `$foo:float` as field name to cast value to float.
55+
56+
* Hidden input respect field type value
57+
58+
Hidden input values pass through requests as chars.
59+
This means that any m2o or selection field with integer/float values
60+
won't be really happy on create/write.
61+
62+
Now we rely on request marshallers to convert those values
63+
to correct values based on field type.
64+
65+
NOTE: this is the preliminary step for adopting marshallers
66+
for all field types/widgets when needed.
67+
68+
69+
**Fixes**
70+
71+
* Fix `safe_to_date` to make form extractor happy
72+
73+
Form extractor ignores non required fields if their values is `None`.
74+
In the case of the date field, the util was returning `False`
75+
even if the value was not submitted, leading to an ORM error
76+
whenever the missing field was required.
77+
78+
Now we return `None` and let the extractor deal with proper values
79+
and validation.
80+
81+
**Coverage**
82+
83+
* Test field wrapper rendering
84+
* Test css klass methods
85+
* Test `get_widget`
86+
* Test conversion of no value
87+
* Test fieldsets rendering
88+
89+
Make sure fieldsets are not rendered if they have no fields.
90+
91+
* Allow to skip HttpCase on demand
92+
93+
Super-useful when you use pytest which does not support them.
94+
95+
* Add basic tests for widget
96+
* Add test for hidden widget
97+
* Add test for char widget
98+
99+
100+
11.0.1.5.2 (2018-07-12)
101+
=======================
102+
103+
**Fixes**
104+
105+
* Fix ordering w/ `groups` protected fields
106+
107+
If `groups` attribute was assigned to a field
108+
it made fields ordering crash as the field is not there
109+
when groups are not satisfied
110+
111+
* Fix selection widget to handle integer values
112+
113+
`fields.Selection` can hold both strings and integer values.
114+
Till the value was not converted automatically
115+
and using selection fields w/ integer values was a bit complex
116+
as you had to convert it yourself or use a str selection field.
117+
118+
Now the widget inspects selection options
119+
and converts request value accordingly.
120+
121+
122+
11.0.1.5.1 (2018-07-09)
123+
=======================
124+
125+
**Fixes**
126+
127+
* Fix regression fields ordering + hidden
128+
129+
When calling `form_fields` w/ hidden=True/False
130+
the order of the fields was not respected anymore.
131+
132+
This a regression from commit 56b37ca
133+
134+
135+
11.0.1.5.0 (2018-07-06)
136+
=======================
137+
138+
**Improvements**
139+
140+
* Handle hidden input automatically
141+
142+
You can now specify `_form_fields_hidden = ('foo', )`
143+
to get hidden inputs. All fields declared here
144+
will be rendered as `<input type="hidden" />`.
145+
146+
147+
11.0.1.4.4 (2018-07-04)
148+
=======================
149+
150+
**Fixes**
151+
152+
* Search form: fix default URL py3 compat
153+
154+
155+
11.0.1.4.3 (2018-07-04)
156+
=======================
157+
158+
**Fixes**
159+
160+
* Be defensive on error block render (do not fail if none)
161+
* Widgets: fix missing `required` attribute
162+
* Search form: discard empty strings in search domain
163+
* Cleanup controller render values
164+
165+
When you submit a form and there's an error Odoo will give you back
166+
all submitted values into `kw` but:
167+
168+
1. we don't need them since all values are encapsulated
169+
into form.form_render_values
170+
and are already accessible on each widget
171+
172+
2. this can break website rendering because you might have fields
173+
w/ a name that overrides a rendering value not related to a form.
174+
Most common example: field named `website` will override
175+
odoo record for current website.
176+
177+
178+
11.0.1.4.2 (2018-05-31)
179+
=======================
180+
181+
**Improvements**
182+
183+
* Search form: use safe default for pager url
184+
* Search form: support quick domain rules via `_form_search_domain_rules`
185+
186+
187+
11.0.1.4.1 (2018-04-29)
188+
=======================
189+
190+
**Docs**
191+
192+
* Move documentation from README to `doc` folder
193+
194+
195+
11.0.1.4.0 (2018-04-27)
196+
=======================
197+
198+
**Improvements**
199+
200+
* Include wizard name in form wrapper klass
201+
* Add request marshallers and tests
202+
* Search form: pass `pager` as render value
203+
204+
This change is to facilitate templates that need a pager
205+
to generate page metadata (like links prev/next).
206+
207+
A good use case is the SEO friendly `website_canonical_url`.
208+
209+
* Rely on `cms_info` for permission and URLs
210+
211+
212+
**Fixes**
213+
214+
* Fix `fake_session` helper in form tests common
215+
216+
217+
11.0.1.3.1 (2018-04-22)
218+
=======================
219+
220+
**Improvements**
221+
222+
* Wizard: ease customization of stored values
223+
224+
To customize stored values you can override `_prepare_step_values_to_store`
225+
226+
227+
11.0.1.3.0 (2018-04-17)
228+
=======================
229+
230+
**Improvements**
231+
232+
* Add wizard support to easily create custom wizards
233+
234+
235+
11.0.1.2.1 (2018-04-13)
236+
=======================
237+
238+
**Fixes**
239+
240+
* Fix search form regression on permission check
241+
242+
In 32a662e I've moved permission check from controller to form
243+
but I missed the bypass for search forms.
244+
245+
246+
11.0.1.2.0 (2018-04-09)
247+
=======================
248+
249+
**Improvements**
250+
251+
* Add error msg block for validation errors right below field
252+
* Support multiple values for same field
253+
254+
In the input markup you can set the field name as `$fname:list`.
255+
256+
This will make the form transform submitted values as a list.
257+
258+
Example::
259+
260+
<input name="foo:list" type="checkbox" value="1" />
261+
<input name="foo:list" type="checkbox" value="2" />
262+
<input name="foo:list" type="checkbox" value="3" />
263+
264+
Will be translated to: `{'foo': [1, 2, 3]}`
265+
266+
267+
* Add `lock copy paste` option
268+
269+
You can now pass `lock_copy_paste` to widget init via `css_klass` arg
270+
to set an input/text w/ copy/paste disabled.
271+
272+
Example::
273+
274+
def form_get_widget(self, fname, field, **kw):
275+
"""Disable copy paste on `foo`."""
276+
if fname == 'foo':
277+
kw['css_klass'] = 'lock_copy_paste'
278+
return super().form_get_widget(fname, field, **kw)
279+
280+
281+
* `form_get_widget` pass keyword args to ease customization
282+
* Form controller: better HTTP status for redirect (303) and no cache
283+
* Improve custom attributes override
284+
* Move `check_permission` to form
285+
286+
You can now customize permission check on each form.
287+
Before this change you had to override the controller to gain control on it.
288+
289+
290+
**Fixes**
291+
292+
* Fix required attr on boolean widget (was not considered)
293+
* `_form_create` + `_form_write` use a copy of values to avoid pollution by Odoo
294+
* Fix handling of forms w/ no form_model
295+
(some code blocks were relying on `form_model` to be there)
296+
297+
298+
11.0.1.1.1 (2018-03-26)
299+
=======================
300+
301+
**Fixes**
302+
303+
* Fix date widget: default today only if empty
304+
305+
306+
11.0.1.1.0 (2018-03-26)
307+
=======================
308+
309+
**Improvements**
310+
311+
* Delegate field wrapper class computation to form
312+
* Add vertical fields option
313+
* Add multi value widget for search forms
314+
* Improve date widget: allow custom default today
315+
316+
**Fixes**
317+
318+
* Fix fieldset support for search forms
319+
* Fix date search w/ empty value
320+
* Fix json params rendering on widgets
321+
322+
323+
11.0.1.0.4 (2018-03-23)
324+
=======================
325+
326+
**Improvements**
327+
328+
* Ease override of JSON info
329+
* Add fieldsets support
330+
* cms_form_example: add fieldsets forms
331+
332+
333+
11.0.1.0.3 (2018-03-21)
334+
=======================
335+
336+
**Improvements**
337+
338+
* Form controller: main_object defaults to empty recordset
339+
340+
**Fixes**
341+
342+
* Fix x2m widget value comparison
343+
* Fix x2m widget load default value empt^^

0 commit comments

Comments
 (0)