- the x2many tour would finish on a click canceling the creation but
not wait for that to resolve, leading to the driver catching it in
the act (checking before the client had had the time to switch),
just need to wait for the list view to be displayed
- the constraints tour would just drop in the middle of a creation
with an error dialog open, so need to finish the entire thing and go
back to the list view
Part-of: odoo/odoo#96517
Since 54ea956490 the form view has an
"urgent save" fallback mechanism. Even if nothing has changed since
the last (?), it will save during unload, which leads to extra
requests during the browser teardown (deletion of cookies and storage,
navigation to about:blank, ...), which can lead to inconsistent
behaviors and non-deterministic errors.
- add check steps at the end of the tour to wait for relevant terminal
states
- perform an explicit save during the tour (before confirmation)
Ideally we'd really only block on *dirty* forms, because logically the
urgent auto save thing should not trigger if the form is not
dirty. However I'm not sure there's any way to check for that
externally, so saved it is...
Part-of: odoo/odoo#96517
A tour finishing while a form is in edition mode is an issue, as it
then triggers an `urgentSave` which generates network traffic (and
promise handlers) during browser cleanup, at a time when the state of
the browser may not be entirely coherent.
Two methods seem to be the most common here:
- drop form during creation, aka the tour mostly wants to mess around
with onchange & ui & error reporting, in those cases the tour just
stops using the form, the "proper" way to handle this is to cancel
the creation and wait until back to the list view (note: the utility
step does not currently handle situation where the creation was
triggered from an other form view, or canceling an edition)
- save form during creation or edition, aka the tour wanted to create
an object, did trigger a save, but didn't wait for the save to
complete, leading to the tour finishing mid-save (which in theory
should allow the save to complete but may still trigger odd effects)
Part-of: odoo/odoo#96517
We can't really know where the clickall tour will end, and if it ends
on the settings action things are rather difficult as saving or
discarding the settings form returns to the edition mode.
Part-of: odoo/odoo#96517
Since 54ea956490 the form view has an
"urgentSave" fallback when the page is unloaded (tab closed, page
navigated away from, ...).
In tours, this translates to new network requests being performed
during the browser cleanup, possibly chaining further into more
network events.
Flag these tours as incorrect (by making them fail if we find a form
in edition mode after receiving `"test successful"`).
Adjust testing of http cases because I've added an empty line between
the signal and the actual message for better readability on complex
error messages.
Also provide opt-out, as for some tours it's difficult to impossible to
truly fix them: the `allow_end_on_form` class attribute can be set to
`True` in order to disable the new behaviour.
To implement this, update the browser runner receive the test class
directly (rather than just the test class' name) for more
introspection flexibility.
Part-of: odoo/odoo#96517
The navigation bar inside the Courses main page and the courses list
are forced to white with an inline style.
When a dark palette is used it makes the text color white as well.
Because of this the texts in those navigation bars cannot be read
anymore.
This commit removes the forced white background so that colors can
automatically adapt to the palette.
Steps to reproduce:
- Pick a dark palette.
- Go to the "Courses" page.
=> "All courses" and its icon were not visible anymore.
task-2855511
closesodoo/odoo#97148
X-original-commit: 852acad7585fa884f365dd2fc10348446d56d4e9
Related: odoo/enterprise#29995
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website, website_sale
Before this commit when a search bar was within a navigation bar, its
autocompletion popover was using the text color according to the
navbar's background color determined by the theme. For dark themes, this
made the autocompletion appear almost as white on white.
This commit uses the defaults before applying a specific preset color
so that the dropdown menu style within the navbar uses the original
color.
It also resets the `text-muted` style used in "No results" message.
Also removing the `website_sale.productsSearchBar.autocomplete` template
which was not referenced anymore.
Steps to reproduce:
- Select a dark palette (e.g. one that makes the navigation bars black).
- Drop a "Products Search" block.
- Reset its background color.
- Pick a color combination with a dark background.
=> The autocompletion's "No results" message is shown without contrast.
task-2855511
X-original-commit: f9bf40cb53cf487c8736c1f565c2f0d3834acd5e
Part-of: odoo/odoo#97148
- Purpose
Improve the UX of the "column creation" mechanism in the kanban view
so that users better understand what it is they are creating.
- Specifications
In the kanban creation mechanism, use the name of field on the model
(e.g. when grouped by stage_id in project.tasks kanban, "Add a Column"
would become "Add a Stage" because the stage_id field's name is "Stage").
task-2755570
closesodoo/odoo#95550
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Purpose of this PR to improve generic usage of project app.
So in this commit did the following changes:
- Changed recurrence conformation messgae
- Changed Burger menu actions in
project.project kanban view
- Added quick search Description in project.task search view
- In product form view hide button based on condition
- Added sample data in project_milestone_views
- switch the state and the author fields from place and add author
label underneath it's value
- switch the date and the progress fields from place
- Added table-stripes class
- Changed label sprint summary to summary in project_update_default_description
- In project.project form view and project.update right-side panel hide
'collaborators' button on condition
task-2895388
closesodoo/odoo#95245
Related: odoo/enterprise#29089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2943607
closesodoo/odoo#97403
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the Ace editor field did not update on props change.
Now, it will update its value and options when the props keys "value",
"mode" or "readonly" are modified.
closesodoo/odoo#97396
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Stacked bar does not support the stacked option in the y axes.
This option was introduced in the stacked line generalization and was
set to False if the user is in the bar mode.
closesodoo/odoo#97410
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Previously, the pre-commit hook was modified to disallow commiting when
the config files were not up to date, the paths that were checked for
changes assumed that the hook was executed in the community repo which
breaks in enterprise and disallows commiting completely instead.
This commit fixes that, and also reloads or refreshes the tooling
automatically when it is not up to date before running prettier and
eslint instead of aborting the commit and asking the user to do it by
hand.
closesodoo/odoo#97404
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Since 48ef812a63, a warning was raised
(python side) when a grouped list is sorted by anything different from
an aggregate or the first field of the group.
Now, only the first field of the group or an aggregate fields can be
used to sort a grouped list.
closesodoo/odoo#97392
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Enable automatic linting and formatting for spreadsheet modules.
`o_spreadsheet.js` lib file should not be checked since the file comes from
an external library (`o-spreadsheet`)
closesodoo/odoo#97393
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Currently, when we delete a single certification that is linked to a course,
it gives a validation error, which is good. But when we try to delete multiple
certifications that are linked with courses, it throws an error.
This commit fixes the issue by properly handling multiple records in the
deletion check, and updates the ValidationError message accordingly.
taskID-2901629
closesodoo/odoo#97391
X-original-commit: fecc1babb63ad1164189c95bb019afb2469043bb
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The actual icon have to be replaced with a new one
in order to follow the style of other payment acquirers modules
task-2937637
closesodoo/odoo#97387
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
We recently added the prefer-const eslint rule, but the default
configuration of this rule disallows some things that we often do and
which we do not think are bad practice such as declaring a variable with
let so that it's available to a function defined below, but assign it
only once later, we also sometimes destructure variables with let where
some of the variables could be const but not all, in those cases we
accept that some variables will be mutable even though it's not strictly
necessary in favour of conciseness.
closesodoo/odoo#97384
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Previous fix: https://github.com/odoo/odoo/pull/84631 missed the case
when raw_move_ids have already done move_orig_ids (i.e. when 2/3 step
MOs or subcontracting w/ resupply contractor). This made it so when
MOs are backordered, these moves would not be reserved even though they
were in the original MO.
This issue was fixed during a refactoring (reserved amounts are now
distributed to backordered MOs), but this commit will add a test to
prevent the issue from returning in the future.
Part of Task: 2777571
Original PR fix (pre-refactoring): odoo/odoo#91460closesodoo/odoo#97383
X-original-commit: a825d9ed715b369128c876174ca6ebfac72adbe5
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
Steps to reproduce:
- create a subcontracted product (i.e. create subcontract BoM)
- create and confirm PO for subcontracted product (qty > 1)
- try to decrease PO qty for subcontracted product
Expected Result:
Since receipt is not yet validated, the qty in the receipt should
decrease (it will in the subcontract MO as well, but this doesn't matter
since no one should work directly with the MO)
Actual Result:
A validation error occurs saying the qty to produce must be non-negative
We allow neg demand qtys to be proprogated from SOs and POs since
https://github.com/odoo/odoo/pull/76752 . While we added in a check to
make sure MOs are not created when a neg qty change is proprogated, we
forgot to add a check for subcontracted created MOs, hence the
validation error (i.e. the neg qty change is trying to create a
subcontracted MO of a neg amount.)
Task: 2777571 (issue 2 of additional issues)
X-original-commit: 251f146b6ecb0e2d428089669199a6deb3a6c060
Part-of: odoo/odoo#97383
Fixes a few incorrect subcontracting UX behaviors:
- When subcontract BOM is flexible, the record burger should always show
so user can more easily record varying quantities
- When `show_operations=True` then `action_assign_serial` button in
Operations tab should only show if subcontract BOM is NOT strict AND
has no tracked components (instead of always showing regardless of BoM
consumption and its components)
- When a subcontract receipt is backordered, the Done moves should no
longer return `_action_record_components`.
- When 'show_operations=True' for receipts, we shouldn't display the
subcontracting component lines in the Detailed Operations tab
Task: 2777571
X-original-commit: e9b9fe541df984bba33c4f44d48e57820ea4968f
Part-of: odoo/odoo#97383
Prior to this commit a non existing product type was used in one of the
test.
This commit changes it to an existing one.
closesodoo/odoo#97380
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Issue:
The product descriptions on the /shop page (always shown if the product
description option is checked) are shortened... but only if the user is
logged in. It should also be the case for visitors.
Explanation:
Using css selector for data-oe stuff is a problem for visitors as they
don't apply to them. To fix the issue we change the selector to a classic
css class.
opw-2926847
closesodoo/odoo#97379
X-original-commit: eb50e48c798e3a5f39fa333d4248973a31e16a9f
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Since 4f984568e1, the css theme is not
correctly applied to the boolean fields in the settings, allows them to
take a big width.
Now, the max width is fixed. Note that, this was already the case on the
legacy views
closesodoo/odoo#97378
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Steps to reproduce the bug:
- Let's consider a company c and a user in this company u.
- Delete the logo of c
- Go to mass mailing > Create
Bug:
Traceback is raised
opw-2927807
closesodoo/odoo#97326
X-original-commit: edda787471d539e9e32ab0dfe4f15235dacec48d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: stcc-odoo <stcc@odoo.com>
This commit fixes the style of the progressbar
in kanban. It also remove a useless
t-on-click that was left in the template
by mistake
closesodoo/odoo#96957
Related: odoo/enterprise#29878
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit fixes the case where classNames set on fields
used in list views were set on the cell instead. This was
causing style issues as some classnames could modify the
display option of the cell instead of styling the field
appropriately. As the layout could break easily, it is more
safe to only apply the classnames to the root div of field
elements.
A test has been added to verify this behavior.
Part-of: odoo/odoo#96957
this commit will allow users to setup replenish locations and replenish
them directly if they have negative forecast
instead of checking forecast qty per warehouse,
this adds the abiltiy to replenish to any internal stock location,
marked as replenish location, instead of just the warehouse location
Task Id: 2796757
closesodoo/odoo#93633
Related: odoo/upgrade#3626
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Previously, when editing an image field and choosing a new image, the
image preview would update itself to show the selected image. With the
conversion of the image field, this behaviour was lost. This commit
restores that behaviour.
closesodoo/odoo#97370
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In community, some actions contain view types that only exist in
enterprise (e.g. in MRP, Work Orders, there's a gantt view). Before
this commit, it crashed because the view doesn't exist. This commit
simply ignores those unknown views.
closesodoo/odoo#97369
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Commit b743fda doesn't seem to work properly.
Steps to reproduce:
- Open a spreadsheet A in one tab
- Open a spreadsheet B in another tab
=> the master tab should poll both spreadsheet channels but it
does not.
The condition here sheems wrong
https://github.com/odoo/odoo/blob/bf2ce0aa0c7d45c90d7ff104d5af5f99b29d59ae/addons/bus/static/src/js/crosstab_bus.js#L299
`peerChannelsBefore` is not really "before the channel was added".
It's "before outdated channels are cleared".
It already contains the new channel added to local storage by the slave tab!
Hence it wrongly returns `false` which means the poll request is not
restarted.
Additional fix required since e2aeb5f
-------------------------------------
Commit e2aeb5f broke a little more the feature.
It is assumed the ids in `channels` are matching the ids in `lastPresenceByTab`
(previously named `peers`). It was no longer true since `lastPresenceByTab`
is now managed by multi_tab service (with it's own id).
With those non-matching ids, channels from other tabs were always considered
outdated and therefore cleaned up.
Small comment on the change in the mock server
----------------------------------------------
Cross tab bus tests were not working properly.
The error message string "XmlHttpRequestError abort" was stringified
(stringifying a string), leading to "\"XmlHttpRequestError abort\"". Since the
implementation depends on the exact error message, tests didn't propely
reflect reality.
This is technically not needed anymore since bus tests are no longer using
the legacy mock server but it can't hurt to fix it. (the new mock server
doesn't have this issue)
closesodoo/odoo#97036
X-original-commit: f25f36a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Goaman <nby@odoo.com>
Co-authored-by: tsm-odoo <tsm@odoo.com>
When a tab is closed (unloads), the main tab is still considered the main tab
and event listeners are not properly removed.
In practice, it's probably not an issue because the tab is killed by the browser,
but it could still potentially have unexpected and undesired side effects.
It's safer to clean everything properly.
The issue is much more visible in tests because the mutli_tab and bus services
are still "active" after we simulated a tab unload.
Part-of: odoo/odoo#97036
Co-authored-by: tsm-odoo <tsm@odoo.com>
The wrapping promise synchronously resolved to the rpc promise.
Hence it could not be aborted since the promise was actually already
resolved.
Part-of: odoo/odoo#97036
TLDR:
* invoices are implemented using computed methods instead of onchange
* the synchronization only happens when switching tabs in the Form view
to improve perfs.
_______________________________________________________________________
The whole engine of the synchronization of Invoices to the Journal
Entries has been refactored
* by using computed fields instead of onchange functions
* by synchronizing only from invoice to journal entry in `create` and
`write`
* by saving when switching tabs on the Invoice form, to synchronize
before showing the values
This comes with numerous advantages:
* no need to call the onchange methods manually
* no need to use the Form emulator to build invoices (i.e. EDI, OCR,
intercompany, ...)
* the performance for invoices with many lines improves drastically, going
from 2 minutes to 4 seconds to create an invoice with 500 lines
* the model is more declarative, we can now see how the values are computed
instead of having the values being copied from various places.
* remove the hack in `onchange` that disabled the recursivity of it,
which was unexpected and needed to be managed manually in all the
onchange methods
This means that:
* Some fields need to be exclusively computed on journal entries values
or invoice values, more specifically the Tax Summary widget.
It is now
- computed from entry lines, when opening the view
- computed from invoice lines when changing those, because the tax lines
will need to be recomputed anyways, erasing previously set values
- set with an inverse function when saving; after the sync has been done
* Some possible operations previously possible have been dropped.
(i.e. look at the removed test test_in_invoice_line_onchange_accounting_fields_1)
This is because such a behavior was undefined (how is changing the balance going
to affect the unit price? How is the amount currency going to affect it?)
_______________________________________________________________________
Implementation Details
----------------------
The "dynamic lines", meaning the payment terms and the tax lines are now
only created in the `create` and `write` functions.
In order to reduce code duplication, it has been implemented using
context managers used in both `account.move` and `account.move.line`
These context managers help comparing the values before/after, acting
like a local `onchange`, but getting benefit from the dirty flags from
the `compute` dependences.
This is relying on computed fields on the move (`needed_terms`) and on
the lines (`compute_all_tax`) which contain the values needed for the
related move.
Depending on the needed values and the existing values (`term_key` and
`tax_key`, respectively) the context manager will determine what needs
to be created/updated/deleted.
Some related changes are to produce a `dict` instead of a `str` for the
`tax_totals` (previously `tax_totals_json`) fields, by simplicity to
reduce the complexity of IO, and simplicity of debugging, because the
logic of the field needed to change (cannot be computed at the same time
anymore since it needed the lines to be synced)
By simplicity, and also because it makes more sense, some boolean fields
have been merged into `display_type`:
* `is_rounding_line`
* `exclude_from_invoice_tab`
* `is_anglo_saxon_line`
The `price_unit`, `quantity` and other "invoice fields" are now not set
anymore on lines that are not product lines since it didn't make any
sense to have it.
Performances
------------
You have to keep in mind that a simple `create` didn't compute a lot of
fields, for instance not taxes were set, no payment terms,...
Now it does.
```python
import random
from timeit import timeit
from odoo import Command
domain = [('company_id', 'in', (False, self.env.company.id))]
products = self.env['product.product'].search(domain).ids
partners = self.env['res.partner'].search(domain).ids
taxes = self.env['account.tax'].search(domain).ids
def create(nmove, nline):
self.env['account.move'].create([
{
'move_type': 'out_invoice',
'partner_id': random.choice(partners),
'invoice_line_ids': [
Command.create({
'name': f'line{i}',
'product_id': random.choice(products),
'tax_ids': [Command.set([random.choice(taxes)])],
})
for i in range(nline)
]
}
for j in range(nmove)
])
# After | Before
print(timeit("create(1, 1)", globals=globals(), number=1)) # 0.11 | 0.09
print(timeit("create(100, 1)", globals=globals(), number=1)) # 2.76 | 2.50
print(timeit("create(500, 1)", globals=globals(), number=1)) # 14.56 | 12.34
print(timeit("create(1, 100)", globals=globals(), number=1)) # 1.03 | 5.52
print(timeit("create(1, 500)", globals=globals(), number=1)) # 3.99 | 125.02
print(timeit("create(50, 50)", globals=globals(), number=1)) # 19.44 | 79.55
```
Another metric that can be used is running the test suite with
`--test-tags=/account` (only `account` installed)
* before: 404s, 267127 queries (366 tests)
* after: 318s, 232125 queries (362 tests)
Why this commit title?
----------------------
Someone told me that this was the perfect way of naming your commits.
c04065abd8
task-2711317
closesodoo/odoo#96134
Related: odoo/upgrade#3715
Related: odoo/enterprise#29758
Signed-off-by: Laurent Smet <las@odoo.com>
Before this commit, images displayed on survey question answers
were small and hard to read, and nothing existed in order to zoom
on them properly.
AFTER THIS COMMIT
Backend:
A new field value_image_filename is added to store the names of
the image fields. They are seen when editing an answer (line).
The max_height and max_width of the images are raised to 1024 px
on their field definition in survey.question.answer to compromise
between image resolution and space, and in order to be able to
zoom on them and still see details
Survey:
A hovering frame is visible on the images, as well as a zoom in
cursor, to indicate we can click on them to zoom in. The rest of
the answer frame is the selection area. Clicking anywhere on the
modal closes it. Until then, a pointer cursor hints the feature.
A new widget SurveyImageZoomer is added. Once the user has clicked
on a choice image, a transparent modal is opened on the whole screen.
This is thought for all size devices : it can be closed by clicking
anywhere, or the cross button, or ESC key. It will always be destroyed.
Also, for small width screens, we do not take the whole height but leave
bands over and below to indicate the mobile users can leave by clicking out.
The image will be displayed in the foreground, zooming on small images
by default, by setting a min width depending on the screen width. We
also avoid using a zoom too large to avoid very low resolution.
The widget allows zooming as long as the image stays in the frame.
The user can zoom both with the mouse scrolling and + and - buttons,
sized to allow medium screen (tablets) to press them accurately.
All keys are disabled but the 'ESC' one when the Zoomer is open to
avoid (undesired) survey navigation.
Task-2566584
closesodoo/odoo#73718
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Define in python a domain on field in the string form containing a leaf of that style
`[('field', '=', field)]` the second field doesn't have quotes around as we want it to take the current value
of the record, JS side.
Given that the field is a m2o, click on the autocomplete to trigger a name_search with that domain.
Before this commit, there was a crash as the dynamic value for `field` was absent from the evaluation context
of the domain.
After this commit, the domain sent to name_search, or at any time, is correctly evaluated.
closesodoo/odoo#97342
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit converts the radio image field of hr_timeoff
to the new framework and renames the registry key to
time_off_radio_image.
closesodoo/odoo#97103
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the DomainSelector did a lot of
RPCs to fields_get each time it was rendering.
Now, we use the view_service.loadFields which does the
RPCs and caches the results.
closesodoo/odoo#96852
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, giving an unknown operator for a
certain field type made the DomainSelector crash.
Now the component lists all existing operators to find
one that matches and prevent crashing.
Part-of: odoo/odoo#96852
Before this commit, when trying to paste into the Odoo editor, if file
and html was in the clipboard, the file got precedence and were added
instead of html.
task-2941679
closesodoo/odoo#97359
X-original-commit: 0af0927f48f213d835a7d4a8396fc6376476e220
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: website_livechat
This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.
Task-2942001
closesodoo/odoo#97354
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit fixes an "Uncaught Promise" error that is thrown when the
timesheets configuration page is accessed since 150f63c1b6.
The error stems from the appStoreWidget component and specifically from
how the component props are handled.
closesodoo/odoo#97341
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Before this commit, when clicking on the translate button on a translatable field,
the translate dialog had too much data, among them wrong data because the domain
to fetch them was wrong. The context was also wrong.
This lead to a crash in subsequent operations (modify and save)
After this commit, the translate dialog is usable and fetches data with the right context
and domain.
closesodoo/odoo#97280
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
With the rule const preferred, let something; and assigning only once triggers an error.
let something = undefined; does the trick and is what was intended.
Part-of: odoo/odoo#97280
This commit simplifies the component SCSS improving bootstrap
integration and allowing components other than 'SearchPanel' to use the
same tree-view design.
Part of the overall v16 SCSS optimization/restyle, task-2704984.
task-2795166
closesodoo/odoo#87687
Related: odoo/enterprise#25781
Signed-off-by: Pierre Paridans (app) <app@odoo.com>