Commit Graph
113 Commits
Author SHA1 Message Date
fja-odoo 04138cc3ad [FIX] website_form: remove dynamic values on save
This fix was not forward ported when introduced: #50745

closes odoo/odoo#68980

X-original-commit: 3e5130d90127d9634c48e5301e96ddcad9b66e17
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-08 14:38:25 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00
Romain Derie 8fcf930a6b [IMP] web_editor, website, *: introduce popover as edit system for links
*: website_form

This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.

It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860

closes odoo/odoo#64756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 09:49:45 +00:00
Samuel Degueldre be05ac7e2b [IMP] web_editor, website_form: introduce m2m UserValueWidget
This commit introduces a many2many as a standalone, reusable
UserValueWidget. This widget is built on top of the ListUserValueWidget
which was until now only used in website form that had to be updated to
allow more generic use of the widget.

Part of https://github.com/odoo/odoo/pull/67832
task-2274732
2021-03-25 09:26:53 +00:00
xO-Tx a06282903d [FIX] website_form: add support for redirection to anchors on submit
Part of https://github.com/odoo/odoo/pull/62206
task-2381305

X-original-commit: 49943014b0d16e2fed31d4601f76c471252e24c6
2021-03-04 16:25:12 +00:00
xO-Tx 6c8fea3c1e [FIX] website_form, *: allow to update buttons using link dialog
*: web_editor, website_mass_mailing

When we double click a link/button, a link dialog appears
to update the target properties, and since the current link dialog
can only handle anchor targets, using it on buttons leads to some
inconsistencies :

- visible href options for button & url required to save changes.
- missing preview when button style changed.
...

The goal of this commit is to add a fix (with minimum of code) on
summernote linkdialog to handle button elements using the same logic as
anchor nodes.

Also, update website form test tour to test those new changes.

Part of https://github.com/odoo/odoo/pull/62206
task-2381305

X-original-commit: 19fbbdc0327482b5d70bdbcf17c2a5a950327d63
2021-03-04 16:22:08 +00:00
qsm-odoo 25173a4c29 [FIX] website_form, *: remove "Shown on mobile" opt for hidden fields
*: website

Part of https://github.com/odoo/odoo/pull/47949
task-2011583
2021-02-26 14:40:49 +00:00
qsm-odoo 8f4c51df24 [IMP] website_form: allow to format form field descriptions
Part of https://github.com/odoo/odoo/pull/47949
task-2011583
2021-02-26 14:40:49 +00:00
fja-odoo 0447f177ad [IMP] website_form: allow to add description to field
It is now possible to add a description to any field.

Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
2021-02-26 14:40:49 +00:00
fja-odoo 9ea276ae2f [IMP] website_form, *: allow form default input value
* = web_editor

Add support for default values on website form

Compatible fields are: textarea, text, number, date, datetime, unique
checkox, multiple checkboxes, radio buttons, select.

Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
2021-02-26 14:40:49 +00:00
fja-odooandqsm-odoo 9304f8fa7b [REF] web_editor, *: make form list a UserValueWidget
* = website_form

The form we-list is now a generic UserValueWidget.

Part of: https://github.com/odoo/odoo/pull/47949
task-2011583

Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-02-26 13:51:13 +00:00
fja-odoo 3a972e6a0e [REF] website_form: make placeholder use selectAttribute
Have the placeholder of website_form use the new selectAttribute method

Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
2021-02-26 13:51:13 +00:00
qsm-odoo 4b2f5975fa [FIX] website_form: fix norecaptcha behavior
Adapt [1] to be a bit more robust.

[1]: https://github.com/odoo/odoo/commit/eb9373522628fa01c3503fa802ded23adc1cbe1f

closes odoo/odoo#66508

X-original-commit: 028ae76f3b53132ae5c1510a4285cc21fc120c76
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-18 20:29:14 +00:00
Nasreddin (bon) 3f1a31c498 [FIX] website_sale, *: display error message in "Extra Info" step
*: google_recaptcha, website_form

Issue

        - Install 'Ecommerce' module
        - In settings, fill the "reCAPTCHA: Easy on Humans, Hard
          on Bots" option with random wrong site key and secret key
        - Open your ecommerce (go to /shop )
        - Add any product to cart and and open cart
        - Activate "Customize -> Extra Step Option"
        - Process to "Extra Info" step
        - Click on next

        Stuck at this step since next button does not react.

Cause

        There is an error due to re-captcha feature that
        does not allowed to go to next step.

        The second issue is that the error is not displayed
        because missing message area in form.

Solution

        Do not check recaptcha if 's_website_form_no_recaptcha' class
        present in form.
        Add span 's_website_form_result' to display error messages.
        Replace 'public' by 'site' in error message to fit google
        'field' name.

opw-2456098

closes odoo/odoo#66493

X-original-commit: eb9373522628fa01c3503fa802ded23adc1cbe1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 16:09:24 +00:00
qsm-odoo 5ab2771d30 [FIX] website_form: adapt editor list widget design
The design was not properly adapted to the last changes before the 14.0
release and still contained some invalid properties. Now the list inputs
match the design of the normal inputs.

closes odoo/odoo#64400

X-original-commit: fe102c04c0526cb7aa547f146974cdfb80629723
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12 12:03:30 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
Antoine Guenet 364d412fe5 [FIX] website_form: allow edition of success message
closes odoo/odoo#63269

X-original-commit: 89f417cf81aa3cb0b025c2e7560858b885707da2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 17:57:25 +00:00
Nicolas Bayet 3fa7894106 [IMP] web_editor: withDomMutations
1) Replace editor function that change the editor internal structure
   with a new mechansim that does it automatically by observing dom
   mutations. Welcome wysiwyg.withDomMutations.

2) Add a mechanism to reuse the active editor execution context
   when a wysiwyg.execCommand or wysiwyg.withDomMutations is called
   inside itself.

   Example:

   await wysiwyg.execCommand(async ()=> {
      ...
      await wysiwyg.execCommand(()=>{...})
      await wysiwyg.withDomMutations(()=>{...})
   })

closes odoo/odoo#63237

X-original-commit: fe7056ccb450c9767693671e8d980a6aebacd6ab
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 15:32:36 +00:00
Achraf (abz) 61ae6a6ca1 [FIX] survey, web, web_editor, website, website_form: Prevent invalid date stock.picking
What are the steps to reproduce your issue?

1. Install "stock"
2. Go to Inventory/Inventory Overview/Internal Transfer
3. Create new record and set manually a date with year < 1000 like "0008-10-10 18:35:00"
4. Save
What is currently happening?

An error arises when saving the record, and it is then no longer
possible to reopen the records or any view containing it.
This also prevents us from correcting the date to no longer have the error
Why is this happening?

The root cause is an inconsistency in `strftime` for years < 1000 [1, 2]. To take it into
account, a zero-padding is needed in the DateTime parser.
How to fix the bug?

The missing padding is added.

However, such dates lead to problematic behaviors in Python:

```
DT_FORMAT = "%Y-%m-%d %H:%M:%S"
new_date = "0008-02-05 18:10:10"
datetime.strptime(
    datetime.strptime(
        new_date, DT_FORMAT
    ).strftime(DT_FORMAT),
    DT_FORMAT
)
```

This raises:
```
ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S'
```

As of today there was no reported business cases where dates with year < 1000 would be
necessary. Therefore, we limit the range to years >= 1000.
[1] https://bugs.python.org/issue13305
[2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior

opw-2408260

closes odoo/odoo#62889

X-original-commit: b873bda1e560bc49ab707aa238fdc962f23bc1e4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-04 13:35:47 +00:00
IEL 1051b28970 [FIX] web_editor, website_form: speed up and robustify form editing
STEPS:
* open website page with a form (e.g. /contactus)
* click edit
* slow down connection speed
* click fast between form input lines or change order of the lines

BEFORE:
* 7 svg files are requested every click
* get_authorized_fields is called every click
* random error "'classList' of undefined" in SelectUserValueWidget::close
* random similar errors when a method is called before initialization

AFTER:
* svg and get_authorized_fields are requested once
* random errors are no reproduced or it's hard to do it
* performance of switching between inputs doesn't depend on connection
speed (though, still not instant)

WHY:
* about changing in SelectUserValueWidget::close: posible reason why
this.menuTogglerEl may be undefined is because method start is async
* the other updates just implement caching

---

opw-2368928

closes odoo/odoo#62115

X-original-commit: 710784da1f02d45cbe898da426ba7e2ac63dc711
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-22 13:58:44 +00:00
Benoit Socias 91419a811a [IMP] web_editor, website_form: put add action in front of other options
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

closes odoo/odoo#60996

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-03 07:24:46 +00:00
qsm-odoo 265d8ce9d2 [FIX] website_form: fix form values reset on Firefox
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

closes odoo/odoo#61200

X-original-commit: 7676fc069d8b6458d0fc1f8eafe087ce553743f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02 16:37:27 +00:00
Nicolas Galler a14a8e47fe [FIX] website_form: prevent double clicking send
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

closes odoo/odoo#61111

X-original-commit: 0eed92da709dba843a7f2f82aee772313e3d4630
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-31 21:47:16 +00:00
Nasreddin (bon) 9a42f49b70 [FIX] website_form: Required hidden field is not saved
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

closes odoo/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>
2020-10-21 13:50:28 +00:00
Gorash 5418f93903 [FIX] web_editor: need to build the snippet before commit it into vDom
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.

closes odoo/odoo#60077

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-16 14:09:49 +00:00
6d6f42f489 [REF] website: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:11 +00:00
qsm-odoo cfd63a2b35 [FIX] web_editor: reduce clickable area of checkboxes in editor panel
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

closes odoo/odoo#59406

X-original-commit: 61ffe97d03deae0aee72568311c453d1cd3470c8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-07 12:10:31 +00:00
Benjamin Vray 1b2ac52969 [FIX] website_form: layout issue on multi checkboxes options
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

closes odoo/odoo#58181

X-original-commit: 0253b01632a30adfe071aa090a875fb3915e1962
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-22 09:19:05 +00:00
Nicolas Lempereur 512a13f94c [FIX] website_form: lang arabic for date/datetime
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 #57042

closes odoo/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>
2020-09-08 07:26:36 +00:00
Nicolas Lempereur bd125e0b72 [FIX] website_form: have several date picker
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 #57092

closes odoo/odoo#57110

X-original-commit: 75ad994a628ef0d994b44cf6e25fd5340c3ecafd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-09-04 15:35:03 +00:00
6aa6c321a6 [IMP] web: remove min date limitation of year 1900
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 #41788
Closes #43055

closes odoo/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>
2020-07-28 14:02:10 +00:00
qsm-odoo d23a9c1954 [IMP] web_editor, *: introduce new "button group" editor widget
*: website, website_form

Basically work just as a we-select but with a different design.

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
qsm-odoo f16113a06e [IMP] web_editor, *: review the editor design CSS
*: 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
2020-07-14 14:43:16 +00:00
Benjamin Vray ee2555546f [IMP] website, *: redesign the contact us and the thank you page
task-2266756

closes odoo/odoo#52162

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-06-18 11:16:46 +00:00
fja-odoo 315346ad28 [IMP] website_form, *: add field type to form
*= 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

closes odoo/odoo#50891

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-06-08 14:47:58 +00:00
Laurent Stukkens (LTU) 94bb547afe [FIX] website_form: prevent error on drop thumbnail in editor in Safari
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

closes odoo/odoo#52520

X-original-commit: dd9ce45c09f8f2181eb48639c0e3ea6617260510
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-06-05 13:33:35 +00:00
fja-odoo 5411486134 [IMP] google_recaptcha, *: integrate recaptchaV3
* = 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

closes odoo/odoo#48466

Related: odoo/enterprise#9649
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-06-05 10:58:50 +00:00
fja-odoo 11c60739e4 [IMP] website, *: warn user about outdated blocks
* = 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

closes odoo/odoo#50254

X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-27 16:36:31 +00:00
Paul Morelle a768937a39 [FIX] website_form: adapt to Bootstrap new API
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.

closes odoo/odoo#48911

X-original-commit: 662dd304d5a46a028ce74864076361865d759080
Signed-off-by: fja-odoo <fja-odoo@users.noreply.github.com>
2020-04-02 16:06:12 +00:00
fja-odoo f07b5b9d74 [IMP] website_form: add/rename form options
Add a height option on textarea
Rename some fields
Add margin on default form

part of: https://github.com/odoo/odoo/pull/45397

task-2197008
2020-03-06 16:25:34 +00:00
fja-odoo 3959f30d73 [FIX] website_form,*: fix d-none field no options
* = 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.

closes odoo/odoo#46660

X-original-commit: 14d2283e739282f82828e0ba3792f9f1126d0033
Related: odoo/enterprise#8956
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-03-02 15:18:29 +00:00
fja-odoo ef1169c4b0 [FIX] website_form: fix existing fields alteration
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
2020-02-13 16:53:15 +00:00
fja-odoo e546d7695c [FIX] website_form: fix multiInput's unique id
UniqueId was not set correctly on multipleInputs

part of: https://github.com/odoo/odoo/pull/45280

task-2196797

X-original-commit: 387b8d698ffd599693fe9feaa9be87e19e3549ab
2020-02-13 16:53:14 +00:00
fja-odoo 1262648486 [FIX] web_editor, website_form: fix submit btn edit
The edition of the submit button's text was broken.

Part of https://github.com/odoo/odoo/pull/44907

closes odoo/odoo#45124

X-original-commit: 85966ac29b53d9e1c2ad1efb2c35ab13c9baae89
Related: odoo/enterprise#8360
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-11 17:35:07 +00:00
fja-odoo 07bb2e4591 [FIX] website_form, *: add submit btn position option
* = 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
2020-02-11 17:35:06 +00:00
fja-odoo 67d9eafd2e [FIX] website_form, *: fix new website form
* = 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

closes odoo/odoo#44911

X-original-commit: 3cf87cc1cb179598cecb736728378e330d3b2e22
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-07 18:34:34 +00:00
qsm-odoo ef03b02af6 [FIX] web_editor, website, *: editor notify method must be synchronous
* 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.

closes odoo/odoo#44850

X-original-commit: 53bba0660237abbcadc9675fd89ec94a2a31e130
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-07 12:43:25 +00:00
fja-odoo 617eba9417 [IMP] website_form, *: entirely review s_website_form snippet
*: 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

closes odoo/odoo#42189

Related: odoo/enterprise#7365
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-05 16:13:25 +00:00
fja-odoo f434e02f3d [FIX] website_form: replace old and unused code
This widget was still calling deprecated methods.

task-2092425
2020-02-05 16:13:13 +00:00
fja-odoo e715265275 [REF] website_form: move s_website_form snippet to dedicated file
Follows: https://github.com/odoo/odoo/pull/42067

Part of: https://github.com/odoo/odoo/pull/42189
task-2092425
2020-02-05 16:12:50 +00:00