Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.
Task ID 2071556
PR #38692
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal
SPECIFICATIONS
Now that website_rating is now portal_rating, let us update translations
files accordingly.
LINKS
Task ID 2071556
PR #38692
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal
SPECIFICATIONS
Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.
LINKS
Task ID 2071556
PR #38692
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
SPECIFICATIONS
In this commit we use the is_internal flag to correctly propagate it from
mail gateway and clean some parent check. In this commit some code is cleaned.
No functional change should occur with this commit.
LINKS
Task ID 2071556
PR #38692
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
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
SPECIFCIATIONS
Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.
LINKS
Task ID 2071556
PR #38692
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
SPECIFICATIONS
In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !
LINKS
Task ID 2071556
PR #38692
Currently discuss post (through mail or sms) does not allow the author
to be notified of its content, as
* he posted it and is therefore already updated;
* it could create email loops;
However with SMS one could easily try to send SMS to himself using the
sms composer that is different from the mail composer. In that case
just use the ``mail_notify_author`` context key allowing to bypass the
"no author notification" rule.
Task ID 2091685
PR #40650
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Bug
===
The file "public_root.js" try to load "/web/webclient/locale/en_US" with ajax.loadJS
we do not have the address to the Odoo server, so we try to load the file locally
but this file might not exist on the website which is using the widget
Fix
===
Overwrite ``ajax.loadJS`` and ignore ajax loading
(also printing a warning message in the JS console)
Task #2081146closesodoo/odoo#41177
X-original-commit: 50f8508ca8569acc538a2af6a3c1162d39f834cd
Signed-off-by: std-odoo <std-odoo@users.noreply.github.com>
Previously, when grouped by state, user was able to drag
and drop kanban boxes to alter the state of an unbuild, a
purchase requistion or work order. However the state should
be readlonly and could only be modify via public methods on
those objects. Those methods do additional required stuff than
just modifying the state.
task-2087309
closesodoo/odoo#40759
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Renames the file created by the build,
from "posbox.img" to "iotbox.img"
closesodoo/odoo#41190
X-original-commit: 3abe39e785d28d1e0b1a18eb9b98c1d341e5a116
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Kpartx did not erase the mapping correctly
Now we delete the mapping directly in "/dev/loopx"
X-original-commit: a33482ed703d162e79493b05a01e9724912b0385
Use case:
Plan a production of 10 units on 2 workorders. Produce 4 units of lot1.
Record the production and produce the 6 next ones with the same lot1. On
the second workorder, the suggested quantity is 4 and not 10.
This issue is due to the fact that we fill the next workorder quantity
only at the first production batch and we don't check that the same lot
can be used again.
This commit call the mathod to update the quantity on the next workorder
if the first lot is produced again.
closesodoo/odoo#41189
Opw: 2127665
X-original-commit: e15fc6ac994edabc8907c13295c883cff9320d10
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
After commit odoo/enterprise@8a38a60b1f
mobile tests didn't run correctly because of missing viewport META in HEAD.
This commit add the missing META. This META must be before all
JavaScript file to ensure that JavaScript also know that we work in
a viewport.
Note that "runbot" run tests in a chromium headless with a size screen
reduced and so it worked without this fix.
closesodoo/odoo#41183
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Managers could see only their sessions like other operators.
Now they can see all the sessions so they can check and help the operators.
task-2048498
closesodoo/odoo#41175
X-original-commit: 6ae791335a1986aa4cc72f7ed9aadd471c1774c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The field user_id was created twice in the model with the same values and options, only a different help message. This removes the duplicated one.
closesodoo/odoo#40542
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Configuring the non-root logger based on --log-level had the
side-effect (unclear whether it was intended or not as none of the
relevant commits really documented the idea) that log-level could
override log handlers being set on the root logger e.g. if
`log_handler = :INFO` is set in the config file, `--log-level=warn` on
the CLI will override it.
This could be replicated by swapping `pseudo_config` and `logconfig`,
*however* it would also make the sub-loggers override
differently (currently on an exact logger match log-handler overrides
log-level).
The ideal fix would likely be to sequence log-level from the
configuration file, log-handler from the configuration file, log-level
from the CLI and log-handler from the CLI. However that doesn't really
work with the current structure.
closesodoo/odoo#41180
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When printing the 'Picking Operations' report in case of a receipt,
lines are duplicated.
This is because we need to print the `move_line_nosuggest_ids` as
displayed in the view.
opw-2125049
closesodoo/odoo#41168
X-original-commit: eed3171f2f057223c3fbedd95ce6bcde2124f46c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
PURPOSE
Improve mail template preview wizard by improve its views and displaying
more rendered fields. It helps users knowing what will be sent to customers.
SPECIFICATIONS
Rename template model to mail_template_preview to better match the mail
template namespace.
Remove _inherit on mail.template and instead choose fields to compute
and display. Indeed lot of fields are unnecessary or badly computed.
Instead just add fields on the wizard that depends on mail template
and will be computed based on mail_template_id field of wizard.
Improve error management.
LINKS
Task 2085912
PR #38708
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently when rendering a template crashes, error is not easy to
understand as it is hidden in a generic message. Purpose of this commit is to
improve this message to indicate why the template fails to build (only the
first error encountered).
Task 2085912
PR #38708
Purpose of this commit is to improve livechat demo mode by adding conversations
spanning on several months and with ratings and different operators. That way
we have beautiful data to show in demo mode.
Task ID 2075287
PR #37355
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Purpose of this commit is to improve search capabilities of eLearning
frontend application. Searching tags and content should be easier to
do, update and notice.
SPECIFICATIONS
Before this commit
- There is no visual indication to what are the selected filters.
- The user can only select one tag in each dropdown box.
- When the user selects a tag on one course card, this tag replaces all other
filters.
- When the user enters custom search terms, it replaces all other filters.
- When searching a documentation, a stacktrace appears.
After this commit
- Selected tags appear as little tag boxes under the search bar.
- The custom search terms appear as one tag box.
- It's possible to remove a search tag by clicking on the cross present in each
little box.
- It's possible to select multiple tags in each dropdown box.
- Tags in course cards work the same as tags in dropdown boxes, and add
themselves to the list of filters.
- To generate the list of courses to display, a logical OR is operated between
tags of the same group, and a logical AND is operated between groups of tags.
- A logical AND is operated between the custom search terms and other filters.
- A logical AND is operated between the "My courses" options and other filters.
- Bug when searching a documentation is fixed.
LINKS
Task ID: 2080617
PR #39259
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Forward-port of ffee5bdbd12b0080349da515d01981943355d0cd;
because of 1a315e87b05fcbdefcb3db6d8d4837f6cc3e835c by the same author,
only the following are left:
- we need to translate the untranslated message
- give the temporary cursor a name different from cursor or cr
so that _'s _get_cr method does not get the closed cursor
closesodoo/odoo#41140
X-original-commit: 926873031d479ec96ca122fe8c3a481b31f2a32b
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Note that this also add data-oe-model and data-oe-id in XML.
This allow us to avoid to load these links as external URL when
a user receive it in inbox instead of external mail client.
See file addons/mail/static/src/js/thread_widget.js -> _onClickRedirect
Task ID: 1895451
closesodoo/odoo#39958
Related: odoo/enterprise#6414
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
This commit fixes the traceback that happens when we try to create
a question from the survey form in mobile mode.
The problem was due to the context not being propagated
to the "add record" button that appears in mobile mode.
Therefore, as we use that context in our widget, it crashes.
The solution to this is to just use the normal tree view behavior
instead of our override when we are in a mobile environment.
LINKS
closes odoo/odoo#41143
Taskid: 2071342
Pr: #40694
X-original-commit: 0dc7d956c59dfbece1f05e475c227affd51ce435
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes the traceback that happens when we try to create
a question from the survey form in mobile mode.
The problem was due to the context not being propagated
to the "add record" button that appears in mobile mode.
Therefore, as we use that context in our widget, it crashes.
The solution to this is to just use the normal tree view behaviour
instead of our override when we are in a mobile environment.
LINKS
Taskid: 2071342
Pr: #40694
X-original-commit: b394a67ccd527b4ff88f0b59083fd3b59cf97681
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.
We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.
Some cleaning is performed prior to that change of ACLs, done in separate
commits. This cleaning includes
* ease the use of mail.thread tool method _message_compute_author by
cleaning its api (return tuple instead of dict);
* give a way to access to company email and catchall with formatting.
Those will be used in various automated emails. Indeed currently several
templates use either ``company_id.partner_id.email``, ``company_id.email``
or even don't provide fallback values;
* improve mail creation calls, notably author and email from default
computation. Purpose is to correctly compute author_id and email_from
in mail_message and mail_mail as they depends from each other. Moreover
it is a good idea in various flows to specify email and author when giving
creation values to avoid default computation that is not always guaranteed
to be accurate notably when involving super user;
* improve author / email_from synchronization in default values in mail
composer;
* clean some calls to mail.template send_mail();
Task ID 1853147
PR #32243
Related: odoo/enterprise#4001
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes 2 issues, both coming from a misbehavior in
`get_nearest_lang()`:
1. Anyone could reach the website in a lang available in backend but not in
frontend. Eg, french is activated but not a website lang, going to `/fr`
would show the page in french.
2. As a logged in user coming from backend in a lang not available in frontend
(has request.lang set to that lang), the website would show a 500 error page
since it would not filter out the current request lang.
Both these issues are fixed here by ensuring langs are filtered out if they do
not belong to the frontend (website langs).
Step to reproduce (bug 1):
- Install french in backend lang (not on website)
- Visit `127.0.0.X/fr_FR`, the frontend will be displayed in french even if
it not a lang available in frontend.
Step to reproduce (bug 2):
- Install french on frontend and remove english from frontend
- Navigate to the backend /web
- Navigate to frontend, it will crash
Fixes#40572 and fixes#40078closesodoo/odoo#41146
X-original-commit: 4bfba037fbbf34c178abd532f7bf52b94ae40b27
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.
We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.
Task ID 1853147
PR #32243
Purpose of this commit is to correctly compute author_id and email_from
in mail_message and mail_mail as they depends from each other. Moreover it
is a good idea in various flows to specify email and author when giving
creation values to avoid default computation that is not always guaranteed to
be accurate notably when involving super user.
Mail message creation could lead to desynchronized values between author
and email_from. This is improved with this commit by correctly inheriting
from default_get and computing both of them at the same time instead of having
two default values. Indeed they depend on each other.
Same thing is done for mail composer. Mail Thread offers a tool method to
find email_from / author_id based on having one of those values or current
user and it is called whenever necessary.
Some calls to mail template send_mail are also cleaned.
Task ID 1853147
PR #32243
Purpose of this commit is to give a way to access to company email and catchall
with formatting. Those will be used in various automated emails. Indeed
currently several templates use either ``company_id.partner_id.email``,
``company_id.email``, or even don't provide fallback values.
With this commit from a company record people will be able to use
* a correctly formatted catchall: ``"My Company Name"
<catchall_alias@catchall_domain>``
* an email_formatted field like partner email_formatted that is either its
partner-related email_formatted value, or formatted catchall if its partner
is not correctly configured;
Various calls to mail creation are updated accordingly.
Task ID 1853147
PR #32243
Purpose of this commit is to ease the use of mail.thread tool method
_message_compute_author. Instead of returning a dict with two values and
having to unpack them, directly return a tuple with both author and
email_from values. All calls and return management are the same in mail.
Let us simplify code.
Task ID 1853147
PR #32243
- Install project_timesheet_holidays
- Create a company with any user (except the SUPERUSER)
An AccessError is risen.
This is because the new project is created in the new company, but the
user is not in this company. The record rule `project_comp_rule`
prevents the constraint to be evaluated.
`sudo` seems the only solution here...
opw-2146153
closesodoo/odoo#41144
X-original-commit: a7d24cabafe1a9c71f9dbdb7cf3f129006250951
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This is a first step towards more complex behaviors in the left panel
and more possibilities with standard XML options. The main goal is to
use widgets for internal option components (checkbox, button, input,
colorpicker, ...) as a way to receive a value for an option method
(selectClass, selectStyle, ...) while the two parts of this system were
both handled by the option before.
For example, now, a developer can say: "I want a colorpicker to style
the border-color of this elements" or "I want the combination of two
inputs to be set as a data-example of this element" without writing
any JS.
See sub-commits for details.
In preparation of task-2122935
closesodoo/odoo#40282
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In a normal flux, this happen when an option is hovered and left:
1) Hover event -> the widget goes in 'preview' state and notifies a
preview to the option
2) The preview is received by the option and, after an internal mutex
resolution, the option enables its methods with the widget values.
3) Leave event -> same as (1), except leaving 'preview' state
4) same as (2), except receiving a 'reset'
Everything is fine and correctly managed... except if a JS code triggers
both hover and leave events in the same execution... and this is what
tests are doing. In this case, as (2) executes after an internal mutex
resolution, the points (2) and (3) were inverted, so the widget left the
'preview' state before (2) got the widget values.
Maybe the test system has to be improved, but this commit solves the
problem for this case explicitely.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
* website, website_blog, website_sale
Some snippet option already needed to implement this by themself and now
that they use custom widget, this is even more needed. The long-term
goal is that developers should not have to override the onFocus method
or the updateUI method but only the _computeWidgetState method.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
* web, mass_mailing, website
Introduced a new sub-widget for snippet options: we-colorpicker. This
allows to retrieve a color value (either a normalized css color or a
theme color name) to be used for a snippet option method.
This commit replaces the old 'colorpicker' snippet option whose behavior
is now simply achieved by defining an xml option using a we-colorpicker
widget in combination with the 'selectStyle' standard method.
This commit also adds the possibility to control the border-color of
elements alongside their border-width. Again, just a we-colorpicker
widget in combination with the 'selectStyle' standard method.
Note: this commit reviewed what the colorpalette palette widget
notifies. This is not a cssColor and a 'isClass' flag to say if it is
a css class or not. The colorpalette always returns a color string which
can be the name of a color like 'alpha'. This is up to the caller to
check if the color string is a css color or not with isCSSColor. In the
case it is not, the related code can read the actual color by reading
the related css variable.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
* website
Review colorpicker methods to always allow to use normalized colors.
Also factorize some code in the color palette widget.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
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
* website, website_sale
Also make the "isTopOption" method a property.
This is done in preparation of better code for coupling sub-widgets used
to retrieve user value (button, input, colorpicker, ...) to actual
change in the edited DOM through snippet options methods.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
Now, the editor UI can suggest options the same way as select-class but
for editing a data attribute.
Note: the public widgets are now refreshed on data attribute changes
through the select-data-attribute and set-data-attribute methods.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
Currently when you open, for example, 5 chat windows on the desktop,
each of those windows will be opened on mobile as well.
The big issue with that is that I have to shut down all windows before
starting to work on the application.
To make things simple, you have to explicitly open chat window to
make it appears on mobile. Synchronization is blocked in both direction.
We don't update the chat window state on the server and we no longer
consider notifications (bus) about it.
Tests were added in enterprise.
Task ID: 1891952
closesodoo/odoo#41052
Related: odoo/enterprise#6943
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Missing / wrong indented code during rewrite of binary controller:
https://github.com/odoo/odoo/commit/7d85ab1#diff-1407a8ce197a04eefaefa26c127a4418L343-L348
In case you have:
<record id="s_cover_default_image" model="theme.ir.attachment">
<field name="key">website.s_cover_default_image</field>
<field name="url">/web/image/theme_treehouse.bg_img_15</field>
</record>
theme_treehouse.bg_img_15 will be not found in /web addons.
So we need a 301 redirect too.
opw-live
How to reproduce:
odoo.com/trial > Website > Install theme Clean
Drop first snippet > background is 404
closesodoo/odoo#40605
X-original-commit: b8ce93e4eb397e1b7a0e1d408d61d2f283223fb9
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Old heuristic is not more True:
Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST']
We have some controller that only allow 'GET' method, so we need to check GET
also when we try to know if an url is multilang or not.
This commit fix case where a controller '/test' only allow GET and you were in
another language that the default, in this case, the rendered url in qweb was
/get instead of /<lang>/get.
Closes#37223closesodoo/odoo#40519
X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>