When using _prepare_analytic_distribution_line, it would take
the company for the line from the distribution, then the env.
This would cause multicompany issues in some case, creating the
line for the wrong company. By using current the move line to
get the company before falling back on the env, we can avoid such
an issue.
OPW-2900827
closesodoo/odoo#96465
X-original-commit: 8c10324f062e4cd239494545cdfce7cde7ffadbb
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
*: calendar, im_livechat, survey.
Following @ged-odoo review, the multi tab service has been improved:
- multi_tab_service.js has been moved to the correct location.
- _callLocalStorage method has been removed and replaced by
getItemFromLocalStorage/setItemToLocalStorage.
- underscore.js calls have been removed.
- multi_tab_service is now using function closure style instead of class.
- multi_tab service is now using its own bus instance.
- service name is now in snake case as per convention.
- tests have been added.
- multi tab service now handles setting/removing/getting values
shared between all the tabs.
closesodoo/odoo#96386
Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Adapt the wording since the edit button is not always on the top
right corner but can also be on the top left one. Also make the
info alert non editable, and add a placeholder to indicate the
editable area.
Task-2924229
closesodoo/odoo#96371
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The purpose of this component was not helpfull
as it has no real use case and was only used
by the BinaryField component.
Instead of using an entire component, we only
keep the DOM that is now used directly in the
BinaryField template.
closesodoo/odoo#96357
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit fixes the wrong implementation of the
field. It was not functional and is now using the
FileInput component.
Before the commit, it was not possible to upload or
delete files from the list. Test has been adapted to
those changes.
Toast notifications were also missing, and a new
test has been added to check that a notification is
correctly displayed when the server responds with a
error message for a given file.
Part-of: odoo/odoo#96357
Since [1] and even after [2] when replacing a media by a media of a
different type only classes were cleaned - but all inline styles were
copied.
This commit filters the inline styles when replacing a media by a media
of another type.
Steps to reproduce:
- Drop a "Text - Image".
- Replace the image by an icon.
- Apply solid colors for the foreground and the background.
- Replace the icon by an image.
=> The applied colors were kept in the inline style of the image.
[1]: https://github.com/odoo/odoo/commit/7fd0698cf765a79959566b51e33cb76bff83d344
[2]: https://github.com/odoo/odoo/commit/9ca349bbdb75505e8dbd31898f05ba8d694e7953
task-2687506
closesodoo/odoo#95853
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since [1] when replacing a media by a media of the same type or that has
some extra classes in common, those classes were removed instead of
being kept.
This commit makes sure only the classes that do not exist in the newly
selected media type are removed.
Steps to reproduce:
- Drop a "Text - Image".
- Replace the image by an icon.
- Apply a circle effect and colors on the icon.
- Replace the icon by another icon.
=> The applied effect and colors were lost.
[1]: https://github.com/odoo/odoo/commit/9ca349bbdb75505e8dbd31898f05ba8d694e7953
task-2687506
Part-of: odoo/odoo#95853
Commit [1] moved the editor in the backend introducing changes to the
way some options interact with the website. This unfortunately broke
the header position option, the header background option and the footer
visibility option.
The header position option would loop indefinitely, the header
background color option would not display the correct preview colors and
the footer position would trigger a traceback.
This commit fix those bugs:
- The header position option had a callback that was never called, it is
now called.
- The copy of styles introduced by [2] is now less implicit. Only styles
that are defined in web_editor/common/utils:
[EDITOR_COLOR_CSS_VARIABLES] are copied on the snippet menu, and only
those variables will be used as background colors for the preview
elements. (Allowing for every other colors like black and white to be
used with classes).
- The footer visibility option had a broken line of code that was copied
from past code. It is now fixed and working.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6
task-2687506
closesodoo/odoo#94949
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since this commit [1], when you select the Header position option and
set it to "Over The Content", the change is not saved if you did not
edit something else in the page too.
Indeed, now that the "save" works correctly (and that it no longer saves
the page every time). It does not detect the change made by this option
which is to add a class on the '#wrapwrap' element. (The editor looks
for changes inside the wrapwrap but not on it).
This commit checks if any page option is dirty on save on top of
checking if the content of the page has been modified.
Additionally, this commit fixes a bug that would occur on Firefox based
browsers where the hidden input used to display the status of these
options would be auto-completed by the browser in some conditions.
(https://bugzilla.mozilla.org/show_bug.cgi?id=520561).
This could result in an incorrect state being displayed.
To reproduce:
- Change the option, click on cancel, start the editor
- the incorrect state is displayed
A test is also added by this commit to verify that all the page options
works correctly.
[1]: https://github.com/odoo/odoo/commit/bab673488e185ddd7792aedecc3870663290fed3
task-2871426
X-original-commit: ea7a69b344d970cc2b31555f4cd8fd7c5e2fc6d2
Part-of: odoo/odoo#94949
In SearchModel, the calls to search_panel_select_range and
search_panel_select_multi_range were done without using the global
context (e.g. the action context), contrarily to what is done in the
legacy SearchPanelModelExtension. We fix that.
closesodoo/odoo#96458
Signed-off-by: Géry Debongnie <ged@odoo.com>
During the BS5 migration, the .text-body class wasn't properly ported.
As it is a standard Bootstrap class and useful to override component's color with the one used by the body (ie. set a heading color the same as the content).
This commit restores it.
closesodoo/odoo#96173
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
When receiving more than expected, we try to redirect the SM thanks to
the putaway rules. This can lead to undesirable behaviors.
To reproduce the issue:
1. In Settings, enable 'Storage Locations'
2. Create a storable product P
3. Edit the operation type "Receipt":
- Show Detailed Operations: True
4. Create and confirm a planned receipt for 1 x P
5. In the Detailed Operations:
- Set the done quantity to 3
- Set the destination location to Shelf 1
6. Validate the receipt
Error: The destination location of the SML has changed: Stock. It should
still be Shelf 1
When validating the SM, because the done quantity is more than the
demand, an exra-move is created. During such a process, the extra move
is confirmed and assigned, so it leads to the destination redirection
thanks to the putaway rules (that's the reason why the destination Stock
will be selected and defined on the SML).
In such situation, we should not try to apply the putaway rules.
OPW-2900283
closesodoo/odoo#96124
X-original-commit: 0183298293192538a801f52262c047ea34a1b76a
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
The alert block content and style for the transaction status after
payment were computed in two different places: In the dedicated
`payment.transaction_status` QWeb template, and in the
/payment/confirmation` route's controller which, for some reason, was
re-inventing the wheel instead of relying on the dedicated template.
This commit combines the slightly different behaviors in the template
and gets rid of the duplicated logic in the controller to:
- Handle the states 'draft' and 'error'.
- Always show the transaction's state message, and not only when the
transaction was in a state for which there exists no pre-defined
message (`draft` and `error`).
task-2924873
closesodoo/odoo#96348
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
==== Short version ====
Google is deprecating Universal Analytics in July 2023 and Google
Sign-In in March 2023. Google Analytics Embed API is based on Sign-In,
meaning it won't work anymore. It actually already doesn't work anymore
for accounts created somewhere after mid-2020 apparently.
There is no plan for now for Google to allow Analytics 4 dashboard to be
embed in external website.
We therefore can't do anything to keep the Google Analytics dashboard in
Odoo.
In previous stable version, it was kept but is displaying a warning
about it (as until mid 2023 old accounts can still embed it).
All this is about the embed dashboard, not the tracking in itself for
which Odoo is already adapted in Odoo 15.0 for Analytics 4.
==== Detailed version (following short version, read it first) ====
- Universal Analytics EOL July 2023, see [1].
- It will be replaced by Analytics 4 for which Odoo is already ready and
actually using it since version 15.0 with [2].
- Google Sign-In EOL March 2023, see [3]. Analytics Embed API was based
on it, it won't work anymore.
- There is no plan (for now) for Google to allow Analytics 4 to be able
to be embed in external websites. They seem to just have dropped the
"feature".
This was confirmed by Google here [4] and indirectly here [5] in the
DOC:
`Note: This API does not support Google Analytics 4 (GA4) properties`
- While the EOL is planed for 2023, the dashboard integration is already
not working anymore for new accounts.
- Old projects/keys/accounts can still embed their analytics dashboard.
The threshold seems to be somewhere mid-2020, according to [6].
It seems to be accurate as my own key from 2018 still works, while my
keys from 2021 do not.
==== Fix ====
- In stable, warn user about it in their Odoo Analytics dashboard (this
PR) and also add a warning about that on the doc.
- In master, simply drop the whole google analytics dashboard
integration and remove the doc about it, see [7].
==== Useful links ====
[1]: https://support.google.com/analytics/answer/11583528?hl=en
[2]: https://github.com/odoo/odoo/commit/78bc86cbeccfc5df16218aee2b0d7c501e5c05b5
[3]: https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html
[4]: https://issuetracker.google.com/issues/233738709?pli=1
[5]: https://developers.google.com/analytics/devguides/reporting/embed/v1
[6]: https://support.google.com/analytics/answer/11583832
[7]: https://www.odoo.com/documentation/15.0/applications/websites/website/optimize/google_analytics_dashboard.html
Finally, note that it means that from July 2023 to Octobre 2023, while
Odoo 14.0 is still supported, Google Analytics won't work anymore in
that version as it will still be designed for Universal Analytics and
not Analytics 4.
opw-2710910
opw-2855405
opw-2881515
opw-2892370
task-2790245
task-2820890
closesodoo/odoo#96280
X-original-commit: d065595f77790fb5ab9480f6de5b88549352324b
Related: odoo/enterprise#29666
Related: odoo/upgrade#3698
Related: odoo/documentation#2499
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Filter product templates search result if there are any possible attribute
combination to get/create a product variant regarding the searched attributes.
For example if the combination (A, B) is excluded, filtering on (A, B)
will filter that product out of the result.
task-2558970
closesodoo/odoo#89018
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.
While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.
Task - 2162165
closesodoo/odoo#82411
Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Steps to reproduce:
1- install POS in multicompany env
2- create a customer c from POS UI
3- c doesn't belong to the active company
Bug:
the company_id is not set when the customer is created
Fix:
set comapny_id to current active company for new customers created from
POS
OPW-2881551
closesodoo/odoo#96073
X-original-commit: 3aa03eb65d431cb9749a2b31a9a09d6b41cd34a4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
Have a legacy list view, click on a record to open it in a new (WOWL) form view
Before this commit, the pager was wrong, as we never passed the list's current resIds
to the form.
After this commit, the pager of the wowl form view is correct.
closesodoo/odoo#96123
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The "plain text" template instantiated the regular web_editor.wysiwyg
rather than its specific override for mass_mailing. As a result, it
didn't include certain customizations like commands that should be
overridden for mass_mailing.
task-2715295
closesodoo/odoo#94434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Previously, we were using the bootstrap 4 function "color-yiq" to choose
a text color depending on the background color. Since the migration to
BS5, color-yiq is no longer valid, and color-contrast should be used
instead, but the wowl-views migration was maintained in parallel from
the BS5 migration and some instance of this function call were added
back with it. This commit fixes those.
Functionally, this fixes the text color in the m2m_tags field.
closesodoo/odoo#96598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
These rules no longer apply because they use a direct descendant
selector which no longer matches since field widgets now have an extra
div. These rules also already exist in the statusbar_field.scss file.
Part-of: odoo/odoo#96598
After the bootstrap migration, the enterprise badge in the settings view
were the wrong color because the class bg-primary was not adapted. This
commit fixes that.
After the wowl views merge, the badge has become hidden behind the
navbar, because it can no longer modify the DOM of its label as it is
managed by owl. When there is no label, the widget appends the badge to
its own $el, and uses position: absolute to position it. This didn't
work because the closest parent that was positioned was the view itself.
This commit fixes that by giving a position: relative to the settings
box.
closesodoo/odoo#96580
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The css rules for the settings view should be in the corresponding css
file, not with the generic form view rules. This commit moves these
rules to the proper files and unnests some rules when the selectors are
specific enough, which generates less CSS.
Part-of: odoo/odoo#96580
Windows uses /r/n as newlines and the split parameter was not taking
that into account, thus inserting the /r character.
task-2742071
closesodoo/odoo#96422
X-original-commit: 90e565f811523968c297f0254f4aa7046c4e710e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit solves 2 problems in the list view:
- incorrect label for a column
- the label in the optional column dropdown can be different than
the label of the displayed column
When converting the list view, we used the displayName of the widget
and not its label.
In order to improve the consistency between the labels in the optional
column dropdown and the associated columns, we decided to use the same
label.
closesodoo/odoo#96408
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the subtypes are not correctly ordered when
none of the subtypes have a parent model. while it should be
order by parent model, then by sequence.
So in this commit, we will first check if both their parent model
are falsy then we can't order them (A = B). Then we will consider
their sequence, and they will be useful to determine the proper order.
task-2904015
closesodoo/odoo#96402
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit when multiple instances of the same product
were selected in a PoS session, `can_be_merged_with` checked if they
had the same price before merging them in a single order line. However
the order line prices were not rounded. In the case of a floating
point error in order line price calculation, this behavior resulted
in multiple order lines for the same product.
Steps to reproduce the issue:
1. Create a product
2. In the pricelist, create a formula of -10% discount based on cost,
and set the cost as 136.35 $
3. Open a POS session, add the product multiple times
4. The products are not combined in one group, each creates their
own order line
To fix this issue, we need to round the order line prices in this
function.
opw-2854304
closesodoo/odoo#96410
X-original-commit: 254521d302b31acd5b6f6cfbf49c184035b30eb0
Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit fixes the profiler datetime usage by properly using the
'real_datetime_now' as a callable.
This was breaking the output json file when profiling.
closesodoo/odoo#96456
X-original-commit: 5fec27e42b033f79933afb3d0c85b142360981f9
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit introduces some information/instructions regarding the access
to the project/tasks depending on what the user has selected for the project visibility.
This should reduce confusion and thus increase productivity on the user side by
making the task of granting access rights more straightforward to the user.
closesodoo/odoo#95947
Task: 2917471
Related: odoo/enterprise#29455
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Steps to reproduce the bug:
- Enable 'Multi-Step Routes' option in Inventory settings
- Edit warehouse and update Manufacture = 'Pick components, manufacture and then store products (3 steps)'
- Create a storable product 'P1' with BOM:
- BOM type: Manufacture this product
- operations: “OP1”
- Components: product 'C1' consumed in the operation 'OP1'
- Set Reordering rules for product 'P1'
- Run Scheduler and MO will be generated with order points
- Edit MO and add Producing Quantity less than to produce
- Validate the MO and create backorder.
Current behaviour:
- child/parent MO were getting visible when backorder was created in 2/3 Step Production.
Expected behaviour:
- No child/parent MO visible until child/parent relations are there
closesodoo/odoo#96533
Task: 2846768
X-original-commit: 14431b2497dcf4aaf778ef1b06e023101b00a4e2
Signed-off-by: Tiffany Chang <tic@odoo.com>
To reproduce
============
on settings -> document layout -> choose Bold with blank background.
print a document (quotation for example) that has at least 2 pages.
the second page of the document has a background.
Purpose
=======
the issue is caused by the condition :
https://github.com/odoo/odoo/blob/0436709f33e57479bd6d62c2e0a2de74743cbaa4/addons/web/views/report_templates.xml#L403
where we don't take into account the case where no background is set.
Specification
=============
to solve the issue the condition was corrected
opw-2888650
closesodoo/odoo#96528
X-original-commit: bf2ce0aa0c7d45c90d7ff104d5af5f99b29d59ae
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Before this commit, the "Edit Menu" was displayed for the restricted
editors, even if they didn't have the right to access the website pages.
This was leading to a warning in the "click_all" test with the demo
user, and didn't make sense for the real user (who was prompted an
"access denied" modal).
Now, this menu is displayed only for the website designers.
Additionally to that, the website root instance would load the wysiwyg
assets if it is created inside an iframe which has the "load-wysiwyg"
data-attribute. But the test was not correctly written (as
data-load-wysiwyg was the string 'false'). This would lead to a warning
in the console when a user with no website rights was accessing the
website client action, introduced in [1].
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
task-2687506
closesodoo/odoo#96520
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.
We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).
[1] odoo/odoo#92475closesodoo/odoo#78221
Related: odoo/enterprise#23069
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
The new list and form views were merged recently [1], but they
weren't activated because they weren't 100% ready yet. This is now
the case. This commit adds those views to the view registry. As a
consequence, a lot of qunit tests and tours needed to be adapted,
mostly for selector changes.
We also add legacy list and form views to the view registry, with
keys 'legacy_list' and 'legacy_form'. This allows to force those
legacy views when necessary. For instance, we did it in views
using complex custom legacy x2many field widgets that haven't been
converted yet (we have a compatibility layer but it isn't complete
and doesn't support every advanced usecases).
[1] odoo/odoo#92475
Part-of: odoo/odoo#78221
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Before this commit, the evaluation of the context was done for all
the context, even when only a subset of the context was needed.
Now, we evaluate only the attributes of the context that are used.
Part-of: odoo/odoo#78221
The `toPyDict` method is used to transform an object into a "python" dictionary,
by returning an equivalent object with the PY_DICT object in the prototype chain.
In practice, it is called everytime we create an evaluation context.
This is a performance problem, since creating the context is not cheap in the
case of Odoo form views: we need to iterate on all the values of the current
record, checking for each changes, applying all relational operations, ...
And even worse, almost all of the domains that we need to evaluate have very
simple conditions, which just needs to check the value of one field. So, it is
useful to make the computation of the eval context keys lazy, and this commit
make sure that pyjs does not undo the lazyness of the eval context, if any.
Part-of: odoo/odoo#78221
The view mode in which to display a legacy x2many field in a new form
view was badly processed. This lead those fields to be not renderered at
all (no list or kanban renderer displayed) or be renderered with the
wrong renderer in mobile mode. We fix that.
Part-of: odoo/odoo#78221
Sometimes a field component might need to know some other fields values
to render itself or for other purposes. In legacy, a mechanism allowing
to load some field values not displayed was available: a field would
declare a fieldDependencies object specifying some field names and
their types and the related values would be loaded along the other data.
Here we introduce the same mechanism for the new views.
Note that in a new view list, the tag widget is not currently supported
so that we have remove some lines in the list arch parser that were
useless.
Part-of: odoo/odoo#78221
Before this commit, if an arch contained a tree which itself contained
a tree, the parser would crash.
The reason for this crash is that the parser was trying to parse the
second tree with the model of the first. So it didn't know the fields.
The solution is to stop the exploration of children when it is not
necessary. For example, for fields, it is not necessary to explore
the children, it is parseFieldNode that takes care of it.
Part-of: odoo/odoo#78221