Commit Graph
444 Commits
Author SHA1 Message Date
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
Nicolas Lempereur 36d4ff5c4c [FIX] website_form: binary work with website_crm_phone_validation
With this change, a binary field in a website form works when
website_crm_phone_validation (website_crm in 13.0) is installed.

The module website_crm_phone_validation would call `extract_data` method
to do some things, but when extract_data was called a second time to
really save data, the FileStorage werkzeug object would already consumed
and files would erroneously appear as empty.

opw-2191873

closes odoo/odoo#46241

X-original-commit: a168fe23cc6d9b817b44c189822952a1ee98d81d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-02-25 13:19:39 +00:00
Nicolas Lempereur 1bcab2f42e [FIX] website_form: binary field do not need _filename
When a binary field is added to studio, the system will try to write the
name to {binary_field_name}_filename: this works if the field was
created with studio but could not work eg. if just a binary field is
created manually.

opw-2191873
closes #45994

closes odoo/odoo#46164

X-original-commit: 13b65d878d5240f07b279045e30d53915d176a61
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-02-24 19:40:58 +00:00
fja-odoo 7248982280 [FIX] website_form: fix many2one_reference field
The many2one_reference is not a field that makes sense with the
form builder.

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

task-2196797

closes odoo/odoo#45339

X-original-commit: 3e61ca5008e19c36aacedf57836dbd4369607e45
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-13 16:53:15 +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
Martin Trigaux 0cc8610923 [I18N] export saas-12.3 source terms
closes odoo/odoo#45285

X-original-commit: bb281e98f52a2716f00d43a07446a08df698c1dd
Related: odoo/enterprise#8413
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-13 11:45:39 +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
qsm-odoo 346a7ca5d4 [FIX] website, *: quick review of new snippet thumbs
website_form, website_twitter

Part of https://github.com/odoo/odoo/pull/42937
task-2088157
2020-01-24 13:02:02 +00:00
qsm-odoo 5a4edc09d6 [IMP] website, *: prepare theme snippets addition in website
* website_blog, website_event, website_form, website_mail_channel,
  website_mass_mailing, website_sale, website_twitter

+ Reorganize the order.
+ Do not promote apps via snippets when they already are promoted via
  the "New" menu. Also do not promote apps in the same snippet section
  more than once.

Part of https://github.com/odoo/odoo/pull/42937
task-2088157
2020-01-24 13:02:01 +00:00
Kaushalya Mandaliya ded9d60986 [IMP] website_form: add info on email_cc field
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
closes odoo/odoo#37116

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-17 13:44:39 +00:00
Nicolas Martinelli 206b197cc9 [FIX] website_form: remove evaluated domains
- Install helpdesk_stock
- Publish the team Customer Care on the website
- Edit the ticket submission form
- Add the field 'Lot/Serial Number'

A crash occurs because of a malformed domain.

It happens because the domain is a string, and therefore should be
evaluated.

We remove the string domains since it won't be possible to evaluated
them in the website form anyway.

opw-2176144

closes odoo/odoo#43427

X-original-commit: abc85e176e337f61926d92cdf33680037af1dd96
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-16 15:12:21 +00:00
fja-odooandqsm-odoo 218e1cad61 [IMP] web_editor, *: allow saving of snippets
* website, mass_mailing, website_event, website_form,
  website_mass_mailing, website_sale

Now the user can save snippets to use them on other pages.

task-2120409

closes odoo/odoo#40408

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-01-16 14:29:04 +00:00
jerome hanke (jhk) 56588d126f [FIX] website: translation of some fields
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

closes odoo/odoo#43224

X-original-commit: 2b1359f2d2f85772c98988be5714f31163b70a23
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-13 15:26:07 +00:00
Prakash Prajapati a4c92c6aed [FIX] website_form: fix several issues when editing a form
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

closes odoo/odoo#42515

X-original-commit: 7ada68cc91fde1b6eff151549808a20e85cb5bf7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-30 17:06:39 +00:00
Jeremy Kersten 546f3cac3f [IMP] website: redo res config settings
task-2088625

closes odoo/odoo#40715

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-12-17 17:07:30 +00:00
Jeremy Kersten 7921616aea [IMP] website: allow to submit sitemap to Google
partial of opw-2123610
2019-12-16 11:07:19 +00:00
Yenthe666 7876af3ad0 [IMP] *: set name on page elements
page is an element that is often used for xpath

closes odoo/odoo#41718

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-16 15:10:24 +00:00
Martin Trigaux b5db1c61ee [I18N] *: export saas-13.1 source terms
Without demo data, for the odoo-master transifex project

closes odoo/odoo#41935

X-original-commit: dab7670b73506fb3a835695ee3bd735e0c5e5c2b
Related: odoo/enterprise#7287
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-16 12:49:55 +00:00
Martin Trigaux b7d91ba25b [I18N] *: remove es_AR translations
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía

closes odoo/odoo#41624

X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-10 10:00:18 +00:00
Jason Van Malder 453e7ab3d5 [FIX] website_form: fix missing currency field in form builder
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

closes odoo/odoo#41558

X-original-commit: 6c27c3abf4907e1faac670ea8ef006992ec96063
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-12-09 09:58:36 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Yenthe666 78ae3da902 [IMP] *: set name element on main containers in configuration views
This will improve the extendibility of view inheritance

closes odoo/odoo#41398

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-09 10:38:59 +00:00
qsm-odoo b38253f400 [REF] web_editor, *: use widgets for left panel components
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
2019-12-01 15:49:57 +00:00
Fanny He 58b7907254 [FIX] website_form: link attachments to binary fields
If the name of a file input field is 'x_binary_input', before
commit 9be29371abcdfe57b1738484c5057ad81e76b00d (opw 2092653),
self.form_fields would have names of the form 'x_binary_input[i]'.
After this commit, they are of the form 'x_binary_input[i][j]'.
When calling extract_data, field_name would then be 'x_binary_input[i]'
instead of 'x_binary_input'. Therefore, the file would be considered as orphan
instead of being attached to x_binary_input.
We thus change the split so that it always returns 'x_binary_input'.

opw 2122624

closes odoo/odoo#41135

X-original-commit: 21ed2b971f66879fa3fa53dbd2c349ab39fa3fdb
Signed-off-by: fah-odoo <fah-odoo@users.noreply.github.com>
2019-11-29 10:55:09 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Nicolas Lempereur a855f47b3b [FIX] website_form: website form type in form parameters
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 #40533

closes odoo/odoo#40578

X-original-commit: 6337a04b73e8030b13d5338cee8c045006c21eae
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-20 16:28:58 +00:00
qsm-odoo 72a2f417ae [IMP] web_editor, *: introduce select & checkboxes for the left panel UI
* website, website_blog, website_form, website_sale

+ introduce default UI for snippet options
+ refactor style of icon buttons

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo 877e3c6bfa [FIX] website_form: add missing call to _super in snippet options
closes odoo/odoo#40200

X-original-commit: 424dfc913b2259862e6e6d7838844dfefd72a15c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-11-13 13:50:37 +00:00
Dharmraj Jhala 6882191b6f [IMP] website_form: apply layout to newly added field
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
2019-11-06 15:39:25 +00:00
Dharmraj Jhala 3a9b563306 [IMP] website_form: show warning while changing form parameters
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
2019-11-06 15:39:16 +00:00
Dharmraj Jhala 03425f1306 [IMP] website_form: add new 'email' type of field in custom fields
This commit adds possibility to add 'email' type of custom field using
form builder.

Part of https://github.com/odoo/odoo/pull/30595
task-1874350
2019-11-06 15:39:11 +00:00
Dharmraj Jhala 655bd95f6d [IMP] website_form: improve radio/checkbox behavior and layout
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
2019-11-06 15:39:03 +00:00
qsm-odooandDharmraj Jhala c755fb1257 [IMP] website_form: focus the first input / footer button of modal
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>
2019-11-06 15:38:49 +00:00
Nans Lefebvre 6901adbe98 [FIX] website_form: multiple input files with same name
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

closes odoo/odoo#39674

X-original-commit: 5df3f662dc9f7e3030a899a6f4196245083ad415
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-10-31 16:33:22 +00:00
Jeremy Kersten fef7ec7c97 [FIX] website,*: remove useless route from sitemap
preparation for cleaning of v13
task-2065018

closes odoo/odoo#39051

X-original-commit: 8a0fc6476c70a4126043de3b3efbd1096e41f968
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-18 14:59:02 +00:00
qsm-odoo f34fae25d1 [FIX] web_editor, *: expose access to all snippet options UI
* 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
2019-10-11 22:34:40 +00:00
fw-bot bc4b7c5036 [FIX] web: can't edit subscription with end date beyond 200 years in the future
-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.

closes odoo/odoo#38527

Opw: 2079696
X-original-commit: 32b6131c04fef7a542a0ccbdb924d177627bfe38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-11 16:12:34 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Martin Trigaux 42417956c0 [I18N] *: export 13.0 source terms
closes odoo/odoo#38028

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-07 07:55:34 +00:00
Odoo Translation Bot b6e7ed6c7b [I18N] Update translation terms from Transifex 2019-10-07 09:11:11 +02:00
fja-odooandqsm-odoo 75014ffba4 [FIX] website_form: fix website form snippet
The modal of the website_form snippet was broken. Now it uses Dialog.
Hidden inputs were not aligned with there labels.

task-2078138

closes odoo/odoo#37545

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-10-01 17:35:39 +00:00
Odoo Translation Bot 40deff7cbe [I18N] Update translation terms from Transifex 2019-10-01 21:21:46 +02:00
Odoo Translation Bot d7b8831ea8 [I18N] Update translation terms from Transifex 2019-09-29 01:22:33 +02:00