Before this commit the add field actions are in the middle of the editor
top options
After this commit the add field actions are in front of the editor top
options
task-2367124
closesodoo/odoo#60996
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Reseting the field should just be done through the form element's reset
method to let the browser do it properly, otherwise the browser may
validate the applied values (and for example mark the required field
as wrong (making them red)).
task-2312878
closesodoo/odoo#61200
X-original-commit: 7676fc069d8b6458d0fc1f8eafe087ce553743f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Behavior prior to the commit:
A user can double click the "Send" button when submitting a form on the
website. Because the event handler is removed on the first click, the
second submission uses the browser default behavior and posts the form
to an incorrect URL, resulting in a 404 error for the user.
Behavior after the commit:
The button is disabled after the first click.
Note:
Using `.attr('disabled')` is sufficient both to disable the button and
to give the disabled visual on all browsers since IE9, but we keep
`.addClass('disabled')` and `.off()` for cases where the clickable is not a
`button` but a link.
opw-2356402
closesodoo/odoo#61111
X-original-commit: 0eed92da709dba843a7f2f82aee772313e3d4630
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
Issue
- Install "Website" app
- Go to "Contact us" page on website
- Edit Page, then click on submit button to
edit form style
- Alter 'Recipient Email' then save
- Edit Page and click on submit button
'Recipient Email' have default value.
Cause
If a field is required, the default value is set without
checking if a value is already set.
Solution
Set current value if available, else default value.
opw-2361169
closesodoo/odoo#60457
X-original-commit: e29d2818abf0e7902feb26c9e0b4809c9a3351c6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Issue: Add dynamic carousel in the page, then change the footer template,
then reply "Yes, I want to save & reload", then the page is broken because
the new class and data attributes are not saved.
closesodoo/odoo#60077
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit the clickable zone of a checkbox in the editor was
all the width of the panel.
After this commit, the clickable zone is only the label width + the
checkbox width. Also, the active and hover states of the label have been
removed to not confuse the user.
task-2312878
closesodoo/odoo#59406
X-original-commit: 61ffe97d03deae0aee72568311c453d1cd3470c8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, buttons to remove checkboxes and buttons to
re-order checkboxes were styled like button.
After this commit, buttons are just icons. We also improve a little
bit the design of the checkbox list (add space between elements and a
light border between items in the checkbox list).
task-2312878
closesodoo/odoo#58181
X-original-commit: 0253b01632a30adfe071aa090a875fb3915e1962
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When we send dates with website_form, if the language of the website is
eg. in arabic we will send moment.js arabic dates that can't be parsed
by the server.
This also happens with norwegian and any language which doesn't use
ascii numbers or textual format of month or days (and possibly RTL
language).
With this changeset, if we detect we are in a use case where this matter
(an existing field and a date format that will fail) the date will be sent
as odoo server format.
Expected change:
- what worked still work with or without server restart
- what didn't work works after server restart
- special case such as "english" with custom format in res.language
containing textual month might now not work with code update without
server restart (probability of this is low).
opw-2326882
closes#57042closesodoo/odoo#57217
Note: the saas-13.5 version always force isoformat for existing fields
X-original-commit: f50f32ea656df62d16f0aeba1247fc3b2d394e5d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When multiple date (or datetime) pickers are added to a website form,
the uniqueId value is used to differenciate them thanks to 694af9a19a.
It works well in a lot of case (eg. when adding several field at the
same time, or by change because other code consume uniqueId) but in this
scenario:
- add a date field on a form
- save
- add a date field on a form
it is possible have the second field targetting the first one because
they have the same `'datepicket'+uniqueId()` ID. This happens because
uniqueId is reset at each page opening.
found when working on opw-2326882
closes#57092closesodoo/odoo#57110
X-original-commit: 75ad994a628ef0d994b44cf6e25fd5340c3ecafd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, user could not selecta a date before year 1900.
This was an historical limitation due to python < 3.2 that didn't
support dates before 1900.
After this commit, user can select any date, user can select any
date from 01/01/0001.
taskID: 2166761
Fixes#41788Closes#43055closesodoo/odoo#51406
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
*: web, mass_mailing, website, website_form, website_sale
New CSS design of the editor (step 1/x).
This work is unfortunately far from perfect but is a first step towards
what we want. In particular, much CSS linked to elements that are meant
to be removed/moved in the upcoming weeks was done in a huge rush but
will thus hopefully be removed/reviewed before the 14.0 release.
As the design is now far more complex including gradients and other
"complex" elements, it was also very difficult to keep a design based on
css-variable so this system was removed, which means that the editor now
appears the same everywhere (backend, frontend, ...). The original goal
of this system was to have an adapted style for backend, frontend and
website visitors. Unfortunately, the current result was a very good
frontend editor design, a not-so-good backend editor design (for mass
mailing at least) and a totally unadapted design for the website
visitors. Making this perfect will be achievable by loading different
assets for those 3 areas and hopefully those assets will only differ by
the values of editor scss variables.
Part of https://github.com/odoo/odoo/pull/53930
task-2157252
*= website_hr_recruitment, website_sale, website_crm
Adding 2 new types of fields: tel, url
email, url and tel type can now be applied on existing char fields.
task-2213083
closesodoo/odoo#50891
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Issue
When using the website editor in Safari browser, an error occurs
when dropping the form builder thumbnail into the editor.
Step to Reproduce
- Install website and web_editor applications
- Use Safari browser
- Got to Website
- Click on Edit
- Drag and drop the From Builder thumbnail from the left panel
into the editor
Cause
The javascript function Node.insertBefore(newNode, referenceNode) needs to
be called on referenceNode's immediate parent.
Using DocumentFragment.querySelector(':first-child')
returns the first child of the first element in the fragment which triggers
this issue. The reason why Chrome accepts and handles this correctly
remains a mistery to me ;o)
Solution
Call Node.insertBefore() method on the immediate parent of the
node the insertion has to be performed before.
So use .childNodes[0] instead of .querySelector(':first-child').
task-2271745
closesodoo/odoo#52520
X-original-commit: dd9ce45c09f8f2181eb48639c0e3ea6617260510
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* = base_setup, website_form, website_sale, website_crm,
crm_iap_lead_website, website_hr_recruitment, website_mass_mailing
Integrate reCaptchaV3 on website_form submit and website_mass_mailing
subscription.
You can now use ReCaptchaV3 to add reCaptcha verification in any module
using google_recaptcha.
Also added a better error management on the form with custom messages.
task-2217980
closesodoo/odoo#48466
Related: odoo/enterprise#9649
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* = mass_mailing, web_editor, website_crm, website_event, website_form,
website_forum, website_hr_recruitment, website_mail_channel,
website_mass_mailing, website_sale, website_slides
When an outdated snippet's option are activated we display a warning
in the left panel that inform the user about the potential
malfunctions.
To do so the snippet's template key is added to the snippet as
data-snippet.
If a snippet is "t-call" inside another snippet, it will need to use
t-snippet-call instead of t-call to have the key on himself.
Those unique keys are used on snippet selection to retrieve the
snippet's version in the left panel and compare it with the currently
selected snippet's version. Versions are describe with data-vcss,
data-vjs and data-vxml. If a snippet's key is not in the left panel we
consider that snippet as outdated.
Added some tests to ensure that t-snippet and t-snippet-call really have
their template key as data-snippet
Adapted the views to the data-snippet changes adding
data-snippet="tmpl_key".
Part of: https://github.com/odoo/odoo/pull/44569
task-2189669
closesodoo/odoo#50254
X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since Bootstrap 4, a popover object does not have an `option` attribute,
as it has been renamed to `config` instead.
This occurrence must have been missed out when we migrated.
closesodoo/odoo#48911
X-original-commit: 662dd304d5a46a028ce74864076361865d759080
Signed-off-by: fja-odoo <fja-odoo@users.noreply.github.com>
* = website_hr_recruitment
The hidden fields containing form infos have options activated on them
because of the class s_website_form_field. When a saved snippet is
dropped the snippet editor tries to activate them. They should not have
any options.
closesodoo/odoo#46660
X-original-commit: 14d2283e739282f82828e0ba3792f9f1126d0033
Related: odoo/enterprise#8956
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The original existing fields could be altered once retrieved from the
database. Now we make a copy once we use them to prevent any alteration.
part of: https://github.com/odoo/odoo/pull/45280
task-2196797
X-original-commit: 2951c288ff839ccdf1740cac84dece96823eed8f
UniqueId was not set correctly on multipleInputs
part of: https://github.com/odoo/odoo/pull/45280
task-2196797
X-original-commit: 387b8d698ffd599693fe9feaa9be87e19e3549ab
* = website_crm, website_hr_recruitment, website_sale
It is now possible to change the position of the submit button via
the left panel. Indeed switching to a non-horizontal form left the
submit button aligned with the labels which thus appeared broken.
Part of https://github.com/odoo/odoo/pull/44907
task-2191409
X-original-commit: 60b4c8d04006736be573189accd0dccaafafa651
* = website_crm, website_hr_recruitment, website_sale
Changing label position on existing field was replacing the label with
the default one.
Redirection message was not updating the overlay
Going from show message to redirect without hidding the mesage made the
form d-none
When a select field's label's position was changed the select was not
editable anymore.
Some other miscellaneous fixes
task-2191409
closesodoo/odoo#44911
X-original-commit: 3cf87cc1cb179598cecb736728378e330d3b2e22
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* website_form
Some technical explanations:
The method became async because the `setTarget` call which was in there
became `async` since it performed an UI update. As this method being
async is a problem with some snippets, it is best to keep it synchronous
for now. For this, the UI update in `setTarget` is removed and becomes
the responsibility of the caller. Nothing relied on it except one code,
which is solved by calling `onFocus` before the UI update which occurs
on focus, as it is already the case in master.
closesodoo/odoo#44850
X-original-commit: 53bba0660237abbcadc9675fd89ec94a2a31e130
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor, website_crm, website_form_project,
website_hr_recruitment, website_sale
The form builder is now using the left panel option system. Many new
options are introduced to build better forms more quickly.
The tests are now running with the new website_form implementation.
Part of: https://github.com/odoo/odoo/pull/42189
task-2092425
closesodoo/odoo#42189
Related: odoo/enterprise#7365
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In a website form, when "Email cc" field is added,
an i icon will be displayed besides the field label to
guide user about multiple email addresses support.
task-2074045
closesodoo/odoo#37116
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- install website and crm
- install a second language and translate website
- go to website > create a new page > add a form builder
> create a new opportunity > add a new custom field (selection or m2m)
Previous behavior:
default fields and some messages are not translatable
Current behavior:
more fields are translatable
opw-2168786
closesodoo/odoo#43224
X-original-commit: 2b1359f2d2f85772c98988be5714f31163b70a23
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit fixes the following points:
- While dropping a form builder, the default action is now set to
'Send an email' instead of first available action.
- Titles of the forms which previously were readonly, are now editable.
- When sending an email, the 'reply-to' address is now set from the
email field provided in the form, instead of the catchall mail.
- Hitting 'Send' button for 'Send an email' option now immediately
sends the mail instead of putting it in the queue.
task-2082970
closesodoo/odoo#42515
X-original-commit: 7ada68cc91fde1b6eff151549808a20e85cb5bf7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Issue
- Install CRM & Website
- Edit the website contact form
- Add "Expected revenue" field
Traceback
Cause
Monetary fields are not handled by the form builder
Solution
Add the monetary field in the form builder core
OPW-2150986
closesodoo/odoo#41558
X-original-commit: 6c27c3abf4907e1faac670ea8ef006992ec96063
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the rendering of inner content of the left panel
options was handled through _buildXXXElement methods in the options
widgets. Now they are handled through sub-widgets which also handle
the user events.
Each sub-widget is notified with the string value it should hold
according to the snippet option target and methods. Each sub-widget
notifies a string value following user interactions, which snippet
options can use to adapt their target through their option methods.
The current sub-widgets introduced by this commit are (others will
follow):
1) we-button
2) we-checkbox
3) we-input
4) we-select (typically containing multiple we-button widgets)
5) we-multi (typically containing multiple we-input widget)
Following this commit only 3 standard option methods remain, which can
be used with any meaningful widget:
1) selectClass
-> Same as before + handle the old 'toggleClass' method when used with
a checkbox-like widget.
2) selectStyle
-> Same as old setStyle, introduced recently (simply renamed)
3) selectDataAttribute
-> Handle both old selectDataAttribute and setDataAttribute, introduced
recently
The parameters these methods received are now:
- previewMode: same as before
- widgetValue: the string value the widget currently holds
- params: additional parameters (mainly dataset of the related xml)
+ params.possibleValues (all the possible values for the method,
meaninful for a select or a checkbox)
+ params.defaultValue (the value that the widget would give if it
even holds no value)
When defining a method in XML, the given value is the default value.
e.g. data-select-style="34px" data-css-property="margin-top"
-> if set on any widget, allows to retrieve a value from the user to
customize the margin-top, the default value being 34px.
-> if used with a we-input, allow to retrieve any value and an empty
value will be equal to 34px
-> if used on a checkbox, allow to toggle between no value and 34px.
-> ...
Hopefully, detailed documentation about all of this will follow. Code
documentation should already be helpful.
Last note: the _updateUI method (replacing the old _setActive) is now
async (so does all the functions calling it). In particular, the _select
method is now async.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
In 13.0 odoo/odoo@6404233bb0 adds a new website_form_key field that was
not taken into account when creating a form from website studio.
This would cause that when editing the form, we would not see it in the
list of form type, and so think it was doing another action that the
current one. And if saved that could cause an issue because the form is
now for doing something else and no way to change it back.
With this changeset, we get back to what was before 13.0 and display a
model in the "Change Form Parameters" modal even if it has no associated
form in the registry (through a website_form_key).
opw-2118567
closes#40533closesodoo/odoo#40578
X-original-commit: 6337a04b73e8030b13d5338cee8c045006c21eae
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit copies design of the last form-field and automatically applies
it on the newly added field to ease the designing.
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
If user changes the form-parameters (like targetted model), it removes
all the existing fields without any warning and re-renders a new form
according to changed parameters.
This commit improves above behavior to prevent accidental loss of a well
designed form. Now when user changes form parameters, a warging will be
shown to user before re-rendering the form if the model is not same.
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
This commit implements following changes:
- aligns radio / checkboxes with their label
- adds an option on radio buttons and checkboxes to
display them horizontally or vertically
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
This commit focuses the first form input on the opened modal (or footer
button in case there's no form input).
This behavior will enable users to navigate through the modal using
keyboard right away (without having to click on input).
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
Co-authored-by: Dharmraj Jhala <dja@odoo.com>
By default, the name of a file input field is 'Custom File Upload'.
If there are two fields with the same name, then they both end up in
self.form_fields with the name 'Custom File Upload[0]', and their values
are concatenated, which are file objects. So the concatenation of two
files is a String, ('[object File],[object File]'), because JavaScript.
(And if you don't like it you don't like the web nor human progress.)
The resulting bug is that instead of adding attachments to the created
record, it adds the string message to the notes.
Adding the outer loop index disambiguates the names, so that all
attachments are created as intended.
opw 2092653
closesodoo/odoo#39674
X-original-commit: 5df3f662dc9f7e3030a899a6f4196245083ad415
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
* website_form
To support old theme options, a hack had to be made to allow access to
left panel UI. This will be improved in master.
Part of https://github.com/odoo/odoo/pull/38495
task-2083198
X-original-commit: 5ac6a7a5dbd2af1190d0d027d0239dd1cfc257b0
-Import a subscription with end date beyond 200 in the future (ex: 2500-01-01).
-Open the subscription and click the Edit button.
Before this commit:
A stacktrace appears indicating that a date is not valid. It's not possible to
edit the subscription.
After this commit:
The maxDate of the date picker has been increased to 31/12/9999, allowing the
user to edit subscriptions whose end date is that far in the future.
A test `toggle datepicker far in the future` for this case has been created.
closesodoo/odoo#38527
Opw: 2079696
X-original-commit: 32b6131c04fef7a542a0ccbdb924d177627bfe38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The modal of the website_form snippet was broken. Now it uses Dialog.
Hidden inputs were not aligned with there labels.
task-2078138
closesodoo/odoo#37545
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
* website_form
Now, the snippets options are still displayed in the left panel but all
the parent options are also shown (and do not require to toggle them
anymore). On hovering them, the overlay style is turned in preview mode
(even for the sticky one) allowing to see which part of the DOM the
option is editing.
Part of https://github.com/odoo/odoo/pull/36515