Commit Graph
152749 Commits
Author SHA1 Message Date
Victor Feyens f4a85cb86b [REF] sale_management: test infrastructure
* New common with a unique dumb empty SO template
* clean tests to rely on the new sale commo data

Part-of: odoo/odoo#96791
2022-08-08 12:33:04 +02:00
Victor Feyens 3b8113891b [REF] sale: test infrastructure
New common based on new common infrastructure (base, uom, product, sales
team).

* Conversion of existing tests to use the common
* Remove invoicing tests common dependency when not needed (overkill
setup for most tests)
* Move tests to the correct test file.
* Rename test_sale_pricelist into test_sale_prices and add tests to
improve coverage of price computation.
* new file test_controllers to regroup all tests covering the routes.
* Speed up tests setup by creating records in batch
* Reduce tests setups and use more the common tests data.

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens f753fce0b7 [MOV] sale -> sales_team: extract new test common
Also move crm.team access rights test from sale to sales_team where it 
should be tested.

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens 546721e441 [REF] product: test infrastructure
* commons & setup refactoring:
  * convert setUp to setUpClass
  * move setups where needed (stock/mrp commons or specific test
classes)
  * create test data in batch (faster, less sql queries & batched
operations)
* move most tests post-install to allow runbot splits
* by default, run tests without mail logic
* by default, run tests in a consistent environment (fixed currency
imposed in the BaseCommon)
* refactor existing tests to use new commons data (while trying to keep
diff reduced)
* add dedicated test file to test the common data
* use mute_logger to reduce useless test logs (less spam to scroll in
logs, less data on runbot builds, ...)

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens 3525f8a855 [IMP] uom: extract new test common
Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens cfe9172884 [ADD] base: standard test commons
* Consistent currency used for tests
* Consistent base data (partner & users)

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Victor Feyens e32bf2384a [IMP] base: setUpClass instead of setUp
Do the setup once by test class.

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Victor Feyens 0d2e18e5ac [FIX] sale_management: wrong constraint error message
The unit price isn't supported/specified on sale order template line 
anymore, no need to mention it in the constraint message (the check on 
the field was removed along with the field)

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Younn Olivier e2e65790a5 [FIX] web_editor: fix nearest dropzone when moving a snippet
Before this commit, when a snippet was moved, and dropped outside of a
dropzone, the nearest dropzone was not found and the snippet would
return to its initial position.

This commit fixes it by using the editable document instead of the
global one.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#96401

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 12:32:52 +02:00
Younn Olivier 29dcb119f5 [FIX] website: copy frontend link when using the anchor option
Before this commit, clicking on the "anchor" icon from a snippet editor
would copy the client action's url (introduced in [1]).

This commit changes the snippet's path computation to use the target's
ownerDocument location instead of the global one.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier b0108e1876 [FIX] website: fix editor keyboard shortcuts
Before this commit, the editor shortcuts would not work.
Example: "alt+1", or "alt+2" switch tab of the editor.

This commit registers the editor as the active element, so that keyboard
shortcuts registered on that element are given priority at the hotkey
service level. The "escape" shortcut to go fullscreen is adapted with
the global option to be independent from the active element.

This commit also adds the "alt+p" keyboard shortcut on the publish
systray item.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 83501e38a3 [FIX] website: ignore context params when client action is restored
Before this commit, the website context was configured with the params
of the client action, at all times. This was leading to weird
behaviours:
- Go to the website client action
- Install the "Blogs" module from the new content systray item
- Navigate on a blog post from the client action
- Click on the "Settings" systray item (last one from the right)
- Click on the "Website Preview" breadcrumb item
=> The "New Content" modal is displayed, again, when it should not.

Another flow, on enterprise:
- Start the client action with /@/?enable_editor=1
- Click on the top left icon to go back to the home screen
- Click on the top left icon to go back to the website
=> The editor is launched when it should not.

To prevent that, the action jsId key is registered at the website
service level. If the action is restored, the jsId will be the same, and
the params used to configure the context will be ignored.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier d4bf7c4b46 [FIX] web_editor: fix snippets overlay buttons ui
After [1] was merged, the delete/move buttons of the snippets overlay
reduced in size, because of the font-size difference between the backend
and the frontend.

This commit fixes it by setting a fixed font-size of 16px (this restores
the same size as before, as the button was using 1rem on the frontend,
and most browsers use 16px as a default font size).

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 9a542f121b [FIX] website: fix theme options background widget state
Before this commit, the Page Layout > Background option's widget of the
Theme section of the SnippetsMenu was not updated correctly after using
the option.
The #wrapwrap was queried in the global document when it should be
queried in the target's ownerDocument.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Younn Olivier e8112e2865 [FIX] website: keep focus on text when using snippet options
Before [1] was merged, for this flow:
- Drop a snippet in the page
- Click on some paragraph
- Click on a snippet option's widget
=> The text selection was lost on Chrome, but kept on Firefox.

With [1] instantiating the SnippetsMenu on a different document than the
snippets one, it was possible to keep the text selection (the snippets
document selection) when clicking on the snippets options (on the global
document).
Some code was added to preserve the Chrome behaviour and lose the text
selection. This code is reverted to keep the Firefox behaviour.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Romain Derie 7f1653a1de [IMP] website: remove the iframefallback in test mode
This commit gets rid of the iframefallback in test mode. It is not
helpful there and slows down the tests as it involves some HTTP
requests.
Its purpose is only for the end users to have a smoother UX during page
transition. It is irrelevant in tests. Note that it means the tests
wouldn't break if that iframe fallback was to be breaking something in
real use cases.

task-2687506

closes odoo/odoo#96229

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 10:50:56 +02:00
Horacio Tellez bf3942b553 [IMP] sale: progressbar js logic migration to owl framework
This PR is part of the whole migration of the sale javascript
code and related code to the owl framework.
Why: better developmet framework for javascript code in odoo.

This PR in particular targets the progressbar of sales team
appearing on the CRM app.

Task - 2918635

closes odoo/odoo#95565

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-08 10:50:54 +02:00
Manisha Tulsiyani 038bfa2ca1 [IMP] project,sale_timesheet: generic improvement for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - the 'upsell opportunity' activity should be generated even
   if the service has already been invoiced
 - project.task hide the 'create' button if the project in the
   context is archived
 - project.task portal form view: only the ref of the invoice
   should be underlined on hover, not the empty space.

task-2857924

closes odoo/odoo#94776

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:50 +02:00
stefanorigano (SRI) a75530c323 [IMP] hr: review and optimize SCSS
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

closes odoo/odoo#93049

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-08 10:50:48 +02:00
stefanorigano (SRI) d198ebbaf2 [FIX] web: 'text-muted' links, remove opacity-changes on hover
Remove exception initially introduced for 'o-btn-link-variant' mixin
when handling 'text-muted' links.

The opacity-change wasn't really needed and introduced inconsistencies
with other links designs and with the mixin logic.

In case of complex/custom scenarios that requires opacity-changes,
'o-opacity-x' utility-classes can be used to achieve the desired design.

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

Part-of: odoo/odoo#93049
2022-08-08 10:50:47 +02:00
stefanorigano (SRI) 819d6f3171 [IMP] web: create a variable defining the form separator color
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

Part-of: odoo/odoo#93049
2022-08-08 10:50:47 +02:00
hiroh-odoo 543f36d9e4 [IMP] project: add ancestor_id field in task analysis report
This commit add a ancestor_id field in task analysis report.

task-2824000

closes odoo/odoo#91023

Related: odoo/enterprise#27166
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:33 +02:00
Kartik Chavda 27488b11b2 [IMP] (hr,sale)_timesheet: improve timesheets report in SOs and invoices
In this commit done following change:
- Add 'Timesheets' report in sale order and invoice.
- Rename 'Timesheet Entries' report into 'Timesheets'.-

task-2826265

closes odoo/odoo#90744

Related: odoo/enterprise#27047
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:23 +02:00
Kartik Chavda ec1c65812b [REM] hr_timesheet: remove unused method from timesheet
This commit remove unused method added by commit: https://github.com/odoo/odoo/commit/2f20b9437a80d71a6184ab83b9c1db3dd04f9cb3

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:23 +02:00
Kartik Chavda 25cd0cf3fc [IMP] project_timesheet_holiday: improve feature timesheet created by time off
This commit prevent user write on time off timesheets and create timesheet
on time off tasks and add test for this feature.

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:22 +02:00
Kartik Chavda aef440b38e [IMP] sale_timesheet: set default project in action
This commit add first project as default project of timesheet
in 'Hours Recorded' stat button's action.

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:22 +02:00
Jacky (trj) a520745230 [IMP] point_of_sale: visual improvement
Small visual changes that should improve the user experience.
The loading demo data popup has been moved to the backend.
Created an Alert Popup that is less aggressive than an Error Popup

closes odoo/odoo#83780

Task-id: 2485062
Related: odoo/enterprise#26104
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-08-08 10:50:14 +02:00
Antoine Guenet 00b9a0fcbe [FIX] web_editor: properly convert link-wrapped card-images
The e-mail conversion process for Bootstrap cards stripped card-images
from their link when they had one. This corrects the process to preserve
the link.

task-2937123

closes odoo/odoo#97199

X-original-commit: 947ee6756b9e9d9ddf7380ecaf0beb27c271b231
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-05 19:06:53 +02:00
tsm-odoo d998c54feb [FIX] mail, bus: fix mock sendone/many crash during tests
The mock of sendone/many was relying on the bus_service. Since owl.Component.env
is changing during tests setup, the bus_service was not always defined. In order
to make this more reliable, the longpolling/poll route is now mocked, returning a
promise that can be resolved by the sendone/many methods.

closes odoo/odoo#97298

Related: odoo/enterprise#30059
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-05 16:35:45 +02:00
Ipsita Borisagar 19fa3c35a3 [FIX] web_editor: traceback while removing the link
Before this commit:

After inserting the 'calendar' or 'appointment' link in an article through the
'/appointment ' or '/calendar' command, removing the link shows the error.

After this commit:

Removing the link through the link editor will remove the link and only keep the
text.

Task-2894489

closes odoo/odoo#97210

X-original-commit: 8eda489a26a3d138c2e4c601e42b531e6bc719b6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-05 15:09:16 +02:00
Odoo's Mergebot a81cc415ae [MERGE][IMP] web: allow commands to be middle-clickable
Purpose
=======
Allow commands in the command palette to be opened in a new tab by
either CTRL+clicking on the command, CTRL+ENTER or right clicking and
copying the link/opening in new tab.

Specifications
=============
Add new slot `focusMessage` that displays the message (if device is not
a mobile device). The `href` value has then to be defined in the
registry.

Task-2710445

closes odoo/odoo#94241

Related: odoo/enterprise#29715
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-05 12:09:55 +02:00
Adrien Schoffeniels 9c5b5a9dfd [IMP] web: allow commands to be middle-clickable
Purpose
=======
Allow commands in the command palette to be opened in a new tab by
either CTRL+clicking on the command, CTRL+ENTER or right clicking and
copying the link/opening in new tab.

Specifications
=============
Add new slot `focusMessage` that displays the message (if device is not
a mobile device). The `href` value has then to be defined in the
registry.

Task-2710445

Part-of: odoo/odoo#94241
2022-08-05 12:09:54 +02:00
Adrien Schoffeniels a84736d610 [IMP] web: slightly change command palette' scss
Purpose:
========
Knowledge's command palette layout is standardized so that its layout
matches the one of the standard command palette. Therefore,
"o_command_left" is not used anymore and its style is removed. 
Fix a small typo: ".test-ellipsis" to ".text-ellipsis".

Task-2710445

Part-of: odoo/odoo#94241
2022-08-05 12:09:54 +02:00
Fabien Pinckaers f981c5f8f0 [IMP] web: FormView: field tooltips UX
- Less Overwhelming: reduces the hover zone to an icon. Tooltip
appearances are less intrusive as you move the mouse in the screen
- More discoverable: show an icon for the fields that have a tooltip
- better UX: max-width on the popup

closes odoo/odoo#97440

Note: commit 3363e55cac reduced help messages to useful ones.
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-05 09:37:16 +02:00
William Braeckman 4f35751bb0 [FIX] hr_holidays: fix accrual level maximum leaves
A test introduced with https://github.com/odoo/odoo/pull/96432
revealed an issue with the level limits for the accrual plans.

The only applied limit was the one of the current level at the end of
the run, however if for whatever reason multiple levels had to be
processed at once (if the database was shut down for a long period of
time for example), the individual levels would not apply any limit logic
to their behaviour which meant that you could have a different behaviour
between running the cron each day and running it after a long period.

This commit aims to fix that issue by applying the said limit.

OPW-2868297

closes odoo/odoo#97540

X-original-commit: 09fa1020f42d641fc0011d482cdd08aea4f4085a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-05 08:11:45 +02:00
Audric Onockx (auon) bc880f2af0 [FIX] base: address operation context keys in calendar view
Prior this fix, creating an action with (e.g.)
additional_context : {create: 0} wouldn't have any effect
on calendar view.

Now, if this context key is added, the user won't be able to create.
Also true for delete and write.

closes odoo/odoo#97538

X-original-commit: 8d108f32b8333f0698427f9a7f12765c8addd8ae
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 04:45:02 +02:00
Hubert Van de Walle (huvw) 92e700fc08 [FIX] web: parseMonetary with NBSP as a thousands separator
Steps to reproduce:

  - Switch odoo language to french
  - Create a client bill for Azure Interior of $1 000 000
  - Confirm it
  - Go to the accounting dashboard
  - On the bank, click on reconcile
  - Select Azure interior
  - Click on the correct bill
  - Switch to Manual operations
  -> $1 000 000 is not a correct monetary field

Cause of the issue:

  Recently in https://github.com/odoo/odoo/pull/94126 , `formatMonetary`
  switched from joining the currency and symbol from `&nbsp;` to a non
  breaking space, NBSP.
  To parse monetary values, the behavior was to split around NBSP to
  get the symbol on one side and the value on the other which is then
  passed to `parseFloat`.

  For the following examples, NBSP is replaced with an underscore.
  So `$_1000` becomes `$, 1000`
  But some languages such as french uses the same char as thousands
  separator.

  In that case, `$_1_000` becomes `$, 1, 000` and then the parse fails.

opw-2937403

closes odoo/odoo#97513

X-original-commit: 9d36722797669498dfd1ad4659e5f29347ba30f3
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-08-05 04:44:56 +02:00
Arthur Detroux (ard) 6d185fd085 [FIX] website: fix dynamic snippet render issues
Prior to this commit, if an user chose to fetch 16 elements, the snippet
would bug out and display 16 elements per row.

Steps to reproduce:
- Install website_sale
- Drop a product snippet
- Select 16 fetched elements
- Layout is broken

Some legacy code introduced in [1] could result in an infinite loading
animation locking the editor out. This commit removes the code as a
fix made at [2] makes it unneeded.

Steps to reproduce:
- Install website_sale
- Enable debug mode
- Drop a "Dynamic Snippet Carousel"
- Click on the Dynamic Snippet for edit
- Sometimes the editor hangs and the page needs to be refreshed

[1]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5
[2]: https://github.com/odoo/odoo/commit/ac8d83cc124a6175a263e11795fda35eebe69324

Related to task-2677203

closes odoo/odoo#97502

X-original-commit: 5ef31db8599d5dbe7ed07c88ac1c703bd7287345
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-05 04:44:51 +02:00
Benoit Socias dcd1ee109b [FIX] website: not record header animation in editor history
Before this commit when the header scroll effect was happening, the
related DOM updates were recorded in the editor's history.

This commit deactivates the history during the updates of the header.

Steps to reproduce:
- Drop a "Text" block in the page.
- Drop 4 "Banner" blocks below the "Text" block to make the page
scrollable.
- Save.
- Edit page.
- DO NOT SCROLL until the last step.
- Select the Text block.
- Delete the Text block.
- Click undo => Text block reappears as expected.
- Click redo => Text block disappears as expected.
- Click undo.
- Scroll down until header vanishes and reappears.
=> Redo step is lost, undo tries to undo the header animation.

task-2930568

closes odoo/odoo#97488

X-original-commit: c710f73f84ce798b8363b7f8904f96b9eacd56dc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-05 03:38:26 +02:00
Rémy Voet (ryv) e96666ccd4 [IMP] base: add the reason of skipped test in log
When test are skipped, we don't have any information of why.
It seems important to log also the reason, it can help
developers to find the source of issues (example: when your chrome
doesn't the devtools active: you just know that test is skipped, but
don't know why)

closes odoo/odoo#97481

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-08-05 03:38:23 +02:00
Xavier BOL (xbo) 650d0679c0 [FIX] web: fix autofocus when input type is 'number'
Before this commit, when the autofocus is used on an input with
`type="number", the `selectionEnd` is not available because the input
element's type ('number') does not support selection.

This commit checks the input type is not a number:
- if it is the case then the selection is used to place the cursor at
  the end of the input content,
- otherwise the selection properties are not used and the input is
  simply focused.

closes odoo/odoo#97466

X-original-commit: 38a5de7b2962a47c29b23f12f2ea7599bdea11fd
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-05 03:38:20 +02:00
rd-manatec 22c4e926ae [CLA] manaTec signs Odoo CLA
closes odoo/odoo#97460

X-original-commit: e40fc33340b0477d5b9e1e5dcf09f83b66af3514
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-05 03:38:17 +02:00
Kartik Chavda 7517bf46d4 [FIX] sale_,(project): set default analytic account and analytic tags in task
Currently, the project's analytic account and analytic tags are not set by
default in the task. Now it will be fixed.

 Steps to reproduce:
    1. Install project
    2. Activate the analytic account and analytic tags in the user setting
    3. Create a project with analytic account and analytic tags
    4. Create a task from the kanban view
    5. Check the analytic account and analytic tags in the task

 Steps to reproduce:
    1. Install sale_project
    2. Activate the analytic account and analytic tags in the user setting
    3. Create a project with analytic account and analytic tags
    4. Create a product (Create on Order = task)
    5. Create a sale order and confirm
    6. Check the analytic account and analytic tags in the task

task-2930761

closes odoo/odoo#97455

X-original-commit: 0a5bc153cf682b29b1c86ac966d8164bd41acbdb
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:14 +02:00
Eteil Djoumatchoua (etdj) 4dc5d76c8d [FIX] website_sale: Some translation bugs
Issue: When using other languages, some expressions aren't translated.

Solution: Add the untranslated words in the .pot file of the module website_sale, which will
be translated later in transifex or directly in customer database.

opw-2938969

closes odoo/odoo#97454

X-original-commit: 56a3adf46b5b361c304075da7ceccb5d915befb0
Signed-off-by: Eteil Djoumatchoua (etdj) <etdj@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-05 03:38:11 +02:00
Rohitkumar (roku) a819d6a597 [IMP] sale_(project),hr_timesheet: improve generic UX for project
Purpose of this commit to improve generic usage of project app.

So in this commit done following changes:
 - when deleting a project, delete all of its tasks in the process instead of
   raising an error
 - make the list view editable bottom
 - add a 'view task' button to open the task form view
 - the 'download' and 'print' buttons should be centred
 - rename 'planned hours' into 'allocated hours' (or 'allocated days' if the
   timesheet encoding unit is in days)
 - when a project is linked to an SO manually, he should appear in the
   'projects' stat button of the SO; same goes for tasks
 - remove the 'profitability' setting
 - display the SOL and the quantity in red as well if the milestone hasn't been
   reached yet for update right side panel
 - add a project field for quickcreate in kanban view
 - 'fa-check-square-o x/y' in muted on the project kanban cards

task-2838372

closes odoo/odoo#92262

Related: odoo/enterprise#27758
Related: odoo/upgrade#3561
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-05 03:38:02 +02:00
pedrambiria 5db33bfa43 [FIX] point_of_sale,pos_sale: load the missing partners
Before this commit: if the "Limited Partners Loading" were enabled, the
partner wouldn't set when using the "Quotation/Order" functionality
for unsynced partners.

Steps to reproduce the issue on the runbot:

	Enable developer mode.
	Go to the Point of Sale.
	Open the config of any pos.
	Enable "Limited Partners Loading" and set "Number of Partners
    Loaded" to a low number (like 5 or 10)
	Disable "Load all remaining partners in the background."
	Open a new PoS session for the configured PoS
	Use the "Quotation/Order" functionality.
	Select any order, for example, S00043.

	The customer is not set for the current pos order.

Solution

	The solution is to load the partner.

Also, there was an issue when using the limited number of partner loading
when it tried to load the cached and paid orders' partners. I added a function
to load missing partners.

opw-2883686

closes odoo/odoo#97442

X-original-commit: 4d7c05346e0c253c8b11736b9ee9f8426a87f2af
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-08-05 01:41:50 +02:00
FrancoisGe ed237addb1 [FIX] web: ListView click on sortable column header
Before this commit, in a list view with a record being edited, if you
click on the header of a column sortable and press a key then a
crash is displayed.

Solution:
We will unselect the record when we click on a column header
(sortable or not). It will be impossible to focus the header of a column
when a record is in edit mode. Either the record is in readonly mode,
or it is invalid and the invalid field is focused.

How to reproduce:
- Go to a list view
- Switch a record to edit mode
- Click on the header of an sortable column
- Press a key (for example "a")

Before:
    Crash is displayed, the record is still in edition and the header
    of the column is focused.

After:
    When you click on the header, the record switches to readonly mode
    and the header of the column is not focused.

closes odoo/odoo#97433

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-05 00:29:47 +02:00
Lucas Perais 9b81ddb993 [FIX] web: settings form view: save on click on an action button
On the res.config.settings form view, click on button that will do an action
e.g. defined as some flavor of `<button type="object" name="myMethod" />`

Before this commit, this did not work as we never fully created the res.config.settings record in python
hence, when executing myMethod on the model res.config.settings, the ID was unset, pointing to no record.

After this commit, we "create" in python the transient res.config.settings record before doing anything.

closes odoo/odoo#97428

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 20:11:03 +02:00
Romain Derie 1ac43fab05 [IMP] website: fix python linter errors
Just a nice to have. It will prevent those errors to be replicated when
copy pasted and will help reading the files in the IDE.

closes odoo/odoo#97282

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-04 20:11:00 +02:00
Dardenne Florent (dafl) 13e9388c87 [FIX] web: restore specialData when discarding
Changed specialData (as in statusbar) were not discarded when clicking "Discard".
Now, when a form is Discarded, the specialData is restored.

Example: In project.task form view, there is a statusbar in which the domain depends on the project_id.
Edit a task, remove the project and the statusbar is updated. When discarding, the statusbar
is not restored to his initial state. Now it is restored to his initial state.

task_id: 2811530

closes odoo/odoo#97164

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-04 20:10:57 +02:00