Commit Graph
176 Commits
Author SHA1 Message Date
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9ea1351334 [REF] *: BS5: Migrate forms and inputs
- BS5 uses native inputs instead of pseudo-element for some
  input like checkbox, radio, ...
  in BS5 input checkbox don't have "virtual visual" checkbox anymore
  (::before), so we remove the relative's rules

- removed `.custom-control` class

- `form-switch` use a new layout system in BS5 we adapt the code to
  match the Bootstrap approach (inline SVG).

- In tests, we don't check the exact value of the background as it
  change in community/enterprise, and it's difficult to check the value
  of an SVG.

- Overflow in progressbar is now hidden.
  -> we had to restore it.

- In BS5 margins in forms/inputs has been changed
  -> we had to restore it (e.g. 'mb-3')

- .form-group, .form-row, .form-inline
> Dropped form-specific layout classes for our grid system.
> Use our grid and utilities instead of .form-group, .form-row,
> or .form-inline.

- .input-group-append and .input-group-prepend
> Dropped .input-group-append and .input-group-prepend.
> You can now just add buttons and .input-group-text as direct
> children of the input groups.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#forms

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Benoit Socias 53c748b682 [FIX] website_mail: adjust the visibility of the (un)subscribe buttons
Before this commit the visibility of the blog (un)subscribe/(un)follow
buttons was behaving inconsistently because of a combination of specific
CSS based on data values and the adding and removal of d-none classes.

After this commit the visibility of the buttons is using only the CSS
mechanism based on data values. Also adjusted the alignment of the email
text input and its attached button (aligned in both blog & forum).

Fixes https://github.com/odoo/odoo/issues/62714

closes odoo/odoo#63001

X-original-commit: 486c445d2200d3805ffac30e84ff35a7a61bf0b7
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-12-08 10:41:42 +00:00
Thibault Delavallée 5649fc88e8 [REF] {website_}mail: move and replace published field of mail.message to is_internal
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

Website mail defines a website_published field allowing to publish / unpublish
comments on the frontend of some modules. This field has several drawbacks :

  * it is used only for front-end people (portal, public) and has no real
    effect in chatter / classic discussions;
  * it is used only in some advanced front-end module and is not available
    in portal by default;
  * its naming is not really correct as it is not linked to fields coming
    from the website_published mixin and its behavior is not really
    the same;
  * its use is a bit duplicated with internal flag coming from subtype
    allowing to hide messages related to an internal subtype;
  * there are overrides of standard mail.message methods just to handle
    this flag;

In this commit we change that field by an is_internal flag directly on
mail.message model itself. It tells if share people (customers, share users)
are allowed to read the message. This field can be given through posting
API or set manually using widgets. It is also used in access rights custom
methods and managed like the internal flag of subtypes.

Mailgateway was already using an internal flag for internal note replies. It
is renamed to is_internal and propagated as it is now a standard field. It
also eases code understanding.

Portal is updated to allow managing the flag directly. It means customer portal
now natively allows to moderate customer comments without any need of website
modules.

Rating is updated accordingly. An is_internal field is added, replacing the
related on website published.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
sri-odoo da3cb117ea [IMP] website_mail: allow two different designs for the follow button
Part of https://github.com/odoo/odoo/pull/35749
task-2024197
2019-10-01 16:39:05 +00:00
Thibault Delavallée 241453aaec [MOV] website_mail: rename portal related files
PURPOSE

Fix frontend rating and clean a bit module organization

SPECIFICATIONS

In order to ease understanding of portal chatter dependencies let us name
files according to guidelines. In this commit we rename a bit files in
website mail to understand which widgets and portal parts are impacted by
website mail bridge module.

Assets are also moved in their own file to ease module discovering.

LINKS

Task 2057301
PR #35870
2019-08-21 12:50:51 +00:00
Jeremy Kersten 1c5ffe1737 [REF] website_forum: mass moderation, modern UI bs4 and clean type
Now forum only allow to post message of type 'question'.
New 'modern' UI with Bootstrap 4
New moderation modal for bulk spam

Co-authored-by: qha <qha@odoo.com>
Co-authored-by: qsm <qsm@odoo.com>
Co-authored-by: jke <jke@odoo.com>

Thanks to @qha-odoo for UI
Thanks to @qsm-odoo for reviewSsss

closes odoo/odoo#29235
2018-12-06 20:49:42 +00:00
qsm-odoo b437808f66 [REF] *: BS4, adapt input-group structure
The input-group-addon class has been replaced by a combination of the
input-group-text and the input-group-append/prepend classes. The
input-group-btn class is replaced by the input-group-append/prepend
classes.
2018-07-27 12:36:54 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
qsm-odoo b04dec4025 [REF] *: rename all LESS files to SCSS
This is a simple renaming without adaptation.
2018-04-18 15:59:15 +02:00
Jérome Maes 3cfd64f63f [MOV] portal,website_mail: move chatter frontend to portal
This split responsiblilies :
- portal provides basic chatter for portal document, and
website documents (slides, blog, ...).
- website_mail provides comments moderation (unpublished mail
message)
- website_rating integrate rating when posting comments
2017-08-16 14:56:40 +02:00
Jérome Maes d79678fdd5 [IMP] website_mail: make the frontend chatter lazy
Message are now fetched and display using javascript
to optimize performance.
Also the chatter is completely rewrite : add pager,
filter possiblity, ...

This commit is mainly technical: posting feature does
not change. Only the display with pager is new.
The goal is also to prepare frontend chatter for a
better integration with rating widget.

The mail.thread mixin is extended to manage the field
website_message_ids (display all messages that can be
seen on frontend by user (employee or not).

When fetching or posting message, a check is done to see
if we need to do it as sudo(). website_mail implement posting
messages with token or sha_in (using in website_quote).
The same verification is now done when fetching messages, via
'_special_access_object' method.
2017-06-30 11:06:32 +02:00
Olivier Dony 3979a4f4c6 [REM] website_mail: remove sha_in based message_post
The _message_post_helper() method historically allowed
passing a `sha_in` signature to let an unauthenticated
user post a message on a record.

This option is unused and an alternative is preferred:
passing a `token` value that matches the value of a
given field of the record.

In light of the increasingly grim future of SHA-1
as a cryptographic hash function, we consider it
better to entirely remove this specific option.

It has been unused for a while, and a simple
alternative exists.

As a temporary measure, the feature was also
deactivated in 10.0 at 2cffcfd860
2017-02-25 04:05:26 +01:00
Jeremy Kersten 6571597b42 [IMP] website_project_issue: allow to see attachment from object in portal.
Before this commit, only attachment linked to a message_ids was visible.
So when you open the ticket, you don't have the 'main' attachments
2017-02-24 08:51:26 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Raphael Collet ffdafd3f8a [REM] most uses of _model (useless in most cases) 2016-08-16 09:55:46 +02:00
Christophe Simonis e4500d06fc [MERGE] forward port of branch saas-10 up to 57944db 2016-05-26 16:55:37 +02:00
Yannick Tivisse 0ac4a55132 [IMP] website_mail: Display the message.atttachment_ids on message_thread 2016-05-25 12:38:14 +02:00
Christophe Simonis f43b206970 [MERGE] forward port of branch saas-10 up to d35d8c3 2016-05-24 16:59:37 +02:00
Martin Trigaux bb51431653 [FIX] website_mail: publications of internal notes
On the font-end view of project.issue, only the messages of type `note` were
display. This excluded the messages recieved via email which makes hard to
understand a conversation (e.g. a customer does not sees his own answers).

Instead, only filter out the notifications (change of states, responsible...)

opw-677426
2016-05-24 15:26:22 +02:00
Keyur Gajjar d672d8aa86 [MOVE] website_mail: file renaming according to new api 2016-04-13 11:20:05 +02:00
Goffin Simon 1b5c2ced45 [FIX] website_mail: internal mail messages
The portal user and the public user don't have to see the internal mail messages
linked to a quotation.

opw:672373
2016-03-30 11:30:14 +02:00
Jérome Maes 22631a152a [FIX] mail, website_mail : special controller for message author avatar
Previous commit (3304b31938) was not performant enough for AL, so got special autorization to make a particular controller for mail.message author avatar. Avatar of message is avaiblable if current user has 'read' access right to the document. Otherwise the default avatar is one white pixel.
2015-10-06 09:43:46 +02:00
Jérome Maes 3304b31938 [FIX] im_livechat, website_mail : message author avatar visible
To display author avatar to public user, using the /web/image url with res.partner returns the placeholder since public doesn't have access. Using the url on mail.message will display the avatar according to the access right defined on res_model/res_id of mail.message. However this executes mush query to fetch the avatar image (1 per message, against 1 per partner).

Maybe this wasn't a bug, but since it is a regression, this deserves to be fixed ...
2015-10-01 12:41:18 +02:00
Christophe Simonis 7636b510a2 [ADD] *: CSRF protection in forms and routes
* make CSRF protection the default on all non-SAFE methods
  note: there currently is no way to call a CSRF-protected endpoint
  without a form-encoded entity-body as that's the only place we get the
  CSRF token from.
* simple CSRF token generation: just use the HMAC'd session id, no
  generating a new random token per session then HMAC it
* use constant-time equal function to avoid timing attacks
* assert that a database secret is configured before hashing/validating
  the CSRF token
* opt-out database manager from CSRF: The super-admin password serves
  the purpose of a CSRF token in the database manager screens.
  There is no request database to obtain the
  secret and generate a CSRF token.
2015-10-01 01:36:50 +02:00
Jérome Maes 6bba311d8c [FIX] website_mail : force login to post comment
Transform POST param into GET param when redirecting to login page can cause security issues. Now, instead of displaying textarea (even if public user) and the redirect to login page keeping written comment, we display the login button with a redirection to the page to comment.
The redirection happen before commenting, avoiding to remenber param such comment text, rating, ...

To post a comment, the user must:
- be connected
- have a token
- or have a sha_sign
2015-09-25 16:03:49 +02:00
Jérome Maes c436c56148 Revert "[FIX] website_mail, website_sale : redirect to login page to post comment"
This reverts commit 7974bf5441.
2015-09-25 16:03:40 +02:00
Jérome Maes 7974bf5441 [FIX] website_mail, website_sale : redirect to login page to post comment
Add 'force_display' param for the frontend chatter to allow public user to see the textarea. When submitting his comment, he will be redirect to login page (like it was before generic chatter) in both mode (json and post mode). This required changing the error handeling of json mode : when a login is required, the user switch to post mode to allow http redirect, keeping its submitted params (rating, comment, ...).
2015-09-23 13:06:25 +02:00
Jérome Maes 9cc25d1c38 [IMP] website_mail : widgetize the Frontend Chatter. Prepare to include rating feature with posting mail.message 2015-08-27 09:36:35 +02:00
Christophe Matthieu 6baf611df1 [IMP] web: create generic controller '/web/content' and '/web/image'
Replace deprecate controllers like /web/binary/image, /web/binary/saveas...
Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21 22:06:52 +02:00
Damien Bouvy ad081b0da1 [IMP] website_mail: generic chatter implementation
A new generic chatter template is available in website_mail
This template allows access rights escalation when some kind of token or uuid
is available on the model or if you use the object_shasign function in the
main controller of website_maill to generate a cryptographic signature to allow
commenting on any object.

To use this chatter, you need to make a t-call to website_maill.thread in your
template after having set the following variables:
- chatter_object: the browserecord of the mail_thread object (mandatory)
- token: if you use a token system  (optional)
- token_field: name of the field that stores the token on your object  (optional)
- sha_in: if you use a shasign to allow public comment  (optional)
- nosubscribe: set False if you want the partner to be set as follower of the object  (optional)
- message_type, subtype: see message_post in mail_thread.py
2015-08-07 01:47:06 +02:00
Christophe Matthieu 05daa152dc [IMP] mass_mailing: move code from website_mail to mass_mailing and use web_editor 2015-07-10 17:00:12 +02:00
Pankaj Joshi 98d0e3cc4b [IMP] updated icon classes which are renamed in font-awesome v4.2 and removed useless icon-* classes of old font-awesome 2015-06-08 12:52:29 +02:00
Olivier Dony 26abbf676d [FIX] website_mail: remove unused alert div, fixes look of input-group-btn
Bootstrap's CSS depends on the input-group-btn
element being the first/last child of its parent.
This was not the case because of the invisible
and useless alert.
2015-03-27 17:23:04 +01:00
Christophe Matthieu 421693d952 [FIX] website_mail: text block: padding at 0, it is not aligned with texts in other blocks 2015-03-23 12:25:05 +01:00
Christophe Matthieu 70c30fe5b1 [IMP] website_mail: improved template designer, added support for background color, font color and convert class to inline style in mail designer, changed snippet according to new format, added theme selector in mail_designer, added font-awesome support (convert in image) in mail snippets 2015-02-12 11:58:13 +01:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Christophe Simonis 1d3f8eba87 [MERGE] forward port of branch 8.0 up to 591e329 2014-12-02 16:18:08 +01:00
Ravi Gohil 1fe6e8172d [IMP] website_mail: mailing editor buttons
Button "Save and continue" was wrongly named as it worked only once the template
is not in edit mode (so already saved).
Hide the button to only get it in readonly mode and rename it for better
understanding of its purpose. (opw 614563)
2014-12-01 11:45:43 +01:00
Christophe Simonis 4b6c948be5 [MERGE] forward port of branch 8.0 up to ed92589 2014-10-23 17:14:35 +02:00
David Monjoie bf3251fd0a [IMP] website_mail: actually render the html body of the template instead of escaping it 2014-10-23 11:26:43 +02:00
Ajay Patel 606e29c733 [FIX] website_mail: "save and continue" button 2014-10-06 10:46:35 +02:00
Christophe Simonis 709c9868de [MERGE] forward port of branch 8.0 up to e883193 2014-10-01 19:18:14 +02:00
Denis Ledoux a0625b3384 [FIX] website_mail: t-field replace by t-esc as html_sanitize applied on the field 2014-09-29 15:03:13 +02:00
Denis Ledoux 03af44babe [FIX] website_mail: sanitize email templates when displaying templates selection
In cases the templates is not html syntax valid
2014-09-29 14:57:36 +02:00
Christophe Matthieu 6048e883e8 [FIX] snippets: use the new API to define dropzone 2014-09-19 12:13:32 +02:00
Christophe Matthieu 1f964d2693 [FIX] website_mail: can't be edit the mail template, javascript must be added into the asset 2014-09-19 11:47:49 +02:00
Fabien Meghazi 8d08e06758 [FIX] Bundlification remains (Fixes #2463) 2014-09-17 14:50:12 +02:00