Commit Graph
153517 Commits
Author SHA1 Message Date
Brieuc-brd bfe9792d45 [REF] hr: review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2892062

Part-of: odoo/odoo#96195
2022-08-30 17:10:14 +02:00
Brieuc-brd fbfc0dc63c [IMP] web: KanbanView, introduce css variables
This commit introduces css variables to facilitate the customization of
the view.

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

task-2892062

Part-of: odoo/odoo#96195
2022-08-30 17:10:14 +02:00
Brieuc-brd ee46a9fda9 [FIX] web: KanbanView, layout issues
Prior to this commit there were some layout issues in KanbanView:

1. The `o_kanban_header` z-index was not high enough and some icons in
the record element could hide it partially.

2. The `o_ghost_avatar` was not visible (white on white).

3. `.container` elements placed inside a record had their width
   constrained by the grid system. This commit "fix the issue" setting
   their max-width to 'none'. 

Note on point 3:
To have '.container' max-width limited by the current resolution is not
a bug but the default grid-system behavior. This commit provides a
temporary workaround since 'container-fluid' classes should have been
used instead.

task-2892062

Part-of: odoo/odoo#96195
2022-08-30 17:10:13 +02:00
Brieuc-brd 7cfe50749f [REF] web: KanbanView, review and simplify scss
Review, simplify SCSS and adapt legacy code.
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2892062

Part-of: odoo/odoo#96195
2022-08-30 17:10:13 +02:00
Brieuc-brd dba33909aa [MOV] web: move KanbanView variables into the component folder
This commit moves the kanban variables from primary_variables.scss to
the KanbanView folder.

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

task-2892062

Part-of: odoo/odoo#96195
2022-08-30 17:10:13 +02:00
Odoo's Mergebot f957cb2bc0 [MERGE][IMP] portal: avoid error modal on wizard modal superposition
BEFORE THIS COMMIT :

When using the action "grant portal access" on contact, it opens a wizard.
When trying to granting access, an error is raised if email is not properly
formatted or already used by another user, in a modal. The modal of error
message is superimposed on the one of the wizard. This looks very unpleasant
and not very readable.

AFTER THIS COMMIT :

Therefore, the error messages due to an invalid email (bad format or already
used) are simplified and displayed inline in portal wizard user tree view
instead, not displaying the different action buttons for those users as long
as the error remains.

TESTS :

Tests are updated accordingly. The last assert of test_portal_wizard_error
is repaired. The previous one raised an error as expected but not the good
one. As the email had a wrong format, it was detected and error was raised,
and not because the user was internal, as supposed to. The portal user is
updated as it should be.

--- LINKS ---
Task Id - 2613780
COM PR - #74911

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-30 15:50:56 +02:00
Noe Antoine c28e7856e4 [IMP] portal: prevent duplicate views of portal wizard
The portal's granting access / revoking access / reinvite actions
return the wizard modal opening action in order to keep it open
and allow the user to keep browsing and managing portal access.

However, this can return the modal opening several times and execute
them all, generating several (unsynchronized) modal view instances
that the user sees and has to close one at a time.

Therefore the user field in the portal wizard receives a small widget,
that only allows one of these actions at a time. Clicking on other
buttons in the list while an action is ongoing will not do anything
since buttons are disabled for the time the action is being done.

Buttons showing the email_state will not do actions when clicked.

A short scss file is also added to the widget in order to make the elements
of the user_ids tree view as close to each other as possible. This prevents
in most cases the loss of buttons going off the list's width view and
generating a scroll bar, a situation to avoid since it does not show the
user the (dyamically appeared) action buttons. (e.g. when hiding buttons
if no valid email, then editing to a valid email, button reappearing out
of visible range)

Task-2613780

Part-of: odoo/odoo#74911
2022-08-30 15:50:55 +02:00
Noe Antoine d6cc18cfdf [IMP] portal: avoid error modal on wizard modal superposition
BEFORE THIS COMMIT :

When using the action "grant portal access" on contact, it opens a wizard.
When trying to granting access, an error is raised if email is not properly
formatted or already used by another user, in a modal. The modal of error
message is superimposed on the one of the wizard. This looks very unpleasant
and not very readable.

AFTER THIS COMMIT :

Therefore, the error messages due to an invalid email (bad format or already
used) are simplified and displayed inline in portal wizard user tree view
instead in the form of colored fa-icons buttons, with details as title.
In order to have the tooltip service detect mouse events, we make them
non-disabled: if clicked, the modal will simply be refreshed. Also, there
will be no display of reinvite / grant access buttons as long as an error
on email remains.

To do so, a new selection field sets the email validity status for each
portal_wizard_user : 'ok' / 'ko' / 'exist'. Errors are still thrown if method
is called directly, except for the revoke access method. Indeed, we want to
be able to revoke access, independantly of the email status. However, the
partner's email is only updated if the email is valid.

TESTS :

Tests are updated accordingly. The last assert of test_portal_wizard_error
is repaired. The previous one raised an error as expected but not the good
one. As the email had a wrong format, it was detected and error was raised,
and not because the user was internal, as supposed to. The portal user is
updated as it should be.

--- LINKS ---
Task Id - 2613780
COM PR - odoo/odoo#74911
2022-08-30 15:50:55 +02:00
Matthieu Stockbauer 9c85261597 [FIX] bus: fix test user logout outgoing message
The test_user_logout_outgoing_message is undeterministic because
it speculate on the fact that the channel subscription was made
when we try to dispatch notifications. Sometimes it is not and
the websocket to channel map is empty resulting in a StopIteration
exception being raised. Let's wait for the subscribe to occur to
ensure the websocket will be registered before trying to dispatch
the message.

closes odoo/odoo#99204

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-30 12:44:40 +02:00
FrancoisGe 4926dba1c8 [FIX] web: empty a many2one field
Before this commit, it was impossible to empty a many2one in a list view.

How to reproduce:
- go into a list view with a many2one
- empty a many2one containing a value
- click outside the line

Before this commit:
The record goes into readonly mode and its many2one returns to
its original value.

After this commit:
The record is saved and its many2one is empty.

closes odoo/odoo#99201

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 12:44:36 +02:00
Yannick Tivisse 20adbf2034 [IMP] mass_mailing: Migrate mailing contact list/kanban to owl
closes odoo/odoo#99153

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-30 12:44:33 +02:00
mafo-odoo 5f7e6b4183 [FIX] web : drag and drop for kanban does not open record
Steps to reproduce:
-Install Project
-Activate kanban view for projects in the settings
-On firefix do a drag and drop of a project between two stages

Current behavior:
You are redirect to the project record

Expected behavior:
The project changed stage but there is no redirection

Solution:
The check for the drag&drop case only happen inside the openRecord
function but the record should not be open in this situation and
hence the check should happen before the function is called in
onGlobalClick.

opw-2952389

closes odoo/odoo#99120

X-original-commit: 977ef91693f22a5fab2b71d4dadf99046853ca9d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-08-30 12:44:30 +02:00
Xavier-Do bfa8da6b35 [FIX] tests: bump url_open timeout
Some tests are randomly failling because /web takes more than 10 seconds
to load. A future pr will speedup /web but waiting for that a small
bump of the timeout should help.

closes odoo/odoo#99198

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-08-30 09:23:16 +02:00
Simon Genin (ges) 5e754ffd4d [FIX] web: fix field update
When a field in readonly view can be modified, it should write to the
backend immediately. (No changes are stored to be comited later)

For some reason, a bit of code was preventing this if the field was
required and had a falsy value. Furthermore, the code seemed incorrect
or at least misplaced. Removing these lines didn't affect the test.

The fix simply remove this extra check.

There was a condition in the update code for required field in readonly
views that prevented the correct flow to be executed. Since no test are
broken removing this check but it fixes the problem, it is removed.

closes odoo/odoo#98978

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 09:23:13 +02:00
svs-odoo cbee4b0c06 [IMP] web: add onSave/onDiscard on form_controller
Adds two new props in `form_controller` in order to call a function from
the parent `Component` just after the form view is saved/discarded.

closes odoo/odoo#97314

Related: odoo/enterprise#30045
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 09:23:09 +02:00
svs-odoo cb19ad1995 [IMP] web: ConfirmationDialog buttons' name
This commit adds two props for the `ConfirmationDialog`:
`cancelLabel` and `confirmLabel`.
Both are `String` and optional and the buttons will remain named "Ok"
and "Cancel" by default.

Part-of: odoo/odoo#97314
2022-08-30 09:23:09 +02:00
Philippe Wauthy f4407fd38a [FIX] hr_holidays: fix future allocations not appearing
Due to missing default_date_{to,from} in the hr_holiday_status_id field context, an allocation planned
next year wouldn't be selectable by the user.

closes odoo/odoo#99197

X-original-commit: cd1cb57f87bd0437dad48f03c3842216366427dc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
2022-08-30 08:19:13 +02:00
Walid HANNICHE (waha) 0ff9b82ee6 [FIX] website_sale: add to cart (image too large)
Steps to reproduce:
1- enable "add to cart" feature on the website shop page
2- add any product to the cart
3- the image is way too large

Bug:
the animation creates a clone of the original image on which new css
classes has been added (h-100 w-100) that sets the image to full size

Fix:
since the CSS atribute of the new image are set in the function removing
all the classes of the original image solves the issue

Note:
the bug only started on 15.2 where the new classes have been added
merging on 15.0 just to prevent future issues

opw-2952608

closes odoo/odoo#99184

X-original-commit: 90911266403cd6157f61e8123b24dcdf3ecd98f4
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 08:19:09 +02:00
William Braeckman 498b9476d3 [IMP] hr_holidays: improve days calculation based on worked time
Prior to this commit accrual levels based on worked time did not
properly compute the number of days when the period prorata was taken
into account.

TaskId-2924364

closes odoo/odoo#99183

X-original-commit: d9000d3d883ab6fa8325692f1ac5249d6822046a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 08:19:06 +02:00
Benoit Socias 6beb52caea [FIX] test_website: avoid random test failure related to image links
A random test failure happens during the test of image links. Sometimes
the image link tools popover does not appear anymore.

This commit adds additional steps to make sure the popover is fully
removed before a new one is created.

runbot-4615
runbot-4617
runbot-4618
runbot-4620

closes odoo/odoo#99182

X-original-commit: 4cd4876fe7bb7fa984a91e50a3878058e8abc597
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-30 08:19:03 +02:00
Vincent Larcin 0b4c5de6e5 [FIX] project_timesheet_holidays: fix AccessError with mrp
Steps to reproduce
------------------

1) Install project_timesheet_holidays and mrp.
2) Go to Manufacturing > Settings and enable Work Orders.
3) Log in as a user with access rights to Manufacturing but no access rights to HR.
4) Create a Manufacturing Order with a Work Order.
5) Go to Operations > Work Order and start the Work Order.
5) Click on "Done", you should get an AccessRight error.

---

This commit fixes this error by calling sudo before creating the timesheet leaves for each employee.

Follow-up of https://github.com/odoo/odoo/pull/94414

closes odoo/odoo#99174

X-original-commit: 13718d26bb98713f5a533c1a53c7fc2c2abfaac2
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Larcin Vincent (vila) <vila@odoo.com>
2022-08-30 08:18:59 +02:00
Xavier-Do 6655813dd1 [FIX] web, tests: increase navigate_to timeout
The qunit loading is now arroud 15 seconds, breaking sometimes because
of the 15 seconds timeout.

A quick and dirty fix increases the timeout to 20 (freeze time)

An deeper investigation is needed to speed up this page.
Pregeneration of assets bundle may help

closes odoo/odoo#99163

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-08-30 08:18:56 +02:00
root 77c98ccf02 [CLA] add Vincent to contributors
closes odoo/odoo#99162

X-original-commit: 9360c82d135b203c866d849c0244e99980f88f01
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-30 08:18:53 +02:00
alt-odoo 2a16219ad0 [IMP] iap: add automatic deletion of accounts without token
Since the accounts without token are useless and could create errors
afterwards, we should delete them and automatically create a new one
with a new token in case force_create is set to True.

closes odoo/odoo#99155

X-original-commit: 637df81a22bf4adbb685f78a59072b110c30a546
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2022-08-30 08:18:50 +02:00
Jigar Vaghela 2367fb1116 [IMP] l10n_in_edi: raise error on authentication
Before this commit
==================
Error not raise In E-invoice(IN) config when authentication is failed

After this commit
=================
Error raise in E-invoice(IN) config when authentication is failed

closes odoo/odoo#99148

X-original-commit: c01b26d3391b53468c3bee8ff0117e55f5115943
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-08-30 08:18:46 +02:00
Leo Tran 560e8108bc [CLA] Viindoo updates Odoo's CLA
closes odoo/odoo#99143

X-original-commit: c13b66dafe5d3bf2639c8ed8a0ae4194b5c3daa6
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-30 08:18:43 +02:00
Alexandre Kühn 11c8e94a14 [FIX] im_livechat: restore fold feature in public livechat
Before this commit, folding chat window in public livechat
was not working.

This is because the title of chat window was 0px of height,
so it was impossible to click on it.

This commit fixes the issue by letting title take as much vertical
area as it is available in the header, so that the header
except buttons is clickable to fold the chat window.

Task-2964331

closes odoo/odoo#99024

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-08-30 08:18:40 +02:00
Yannick Tivisse 27d58517b8 [IMP] lunch: Restrict alert creation right to lunch managers
closes odoo/odoo#99021

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-30 08:18:37 +02:00
Kevin Baptiste 503c0d6f8f [IMP] lunch: migrate to Owl
Migrate lunch to Owl.

task-2916338

Part-of: odoo/odoo#99021
2022-08-30 08:18:36 +02:00
Nshimiyimana Séna 727fd4f208 [FIX] sale, purchase: fix invoicing interaction with “Invoicing Switch Threshold”
Steps to reproduce:
- Create a sale order with a product that's invoiced on delivered
  quantities.
- Set delivered quantity (partial delivery) and create an invoice based
  on the delivered quantity. Set the  "Invoice Date" to sometime in the
  past.
- Go to the settings and set  "Invoicing Switch Threshold" to any date
  in the future (so that the invoice you created has a date BEFORE the
  new threshold)
- The invoice will get the label "invoicing app legacy".
- Go back to the sales order and change the delivered quantity.
You should see that the invoiced quantity is automatically set to 0.
A similar behavior can be observed with purchase orders.

Why this is happening:
When a new “Invoicing Switch Threshold”  is set, all posted invoices
before the threshold are marked as `canceled`. In v15, changing the
delivered quantities  triggers the invoiced quantities to be
recalculated as well. However, computing invoiced quantities doesn't
take into account  invoices that are marked as `canceled`. This mean
that the newly computed invoiced quantities won't include invoices
posted before threshold.

opw-2896797

closes odoo/odoo#98909

X-original-commit: cc979734bd7ef3f2a94b411cb7b4f3e782b7ddab
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-08-30 03:45:05 +02:00
FrancoisGe e50bee88c4 [FIX] web: touch a record in a x2m
Before this commit, if a touchstart event is performed on a row in an
x2many, then a crash is displayed.

We also use this commit to rename the hasSelector props to allowSelector.
allowSelector is true if checkboxes can be present.

How to reproduce:
- go to a form view in mobile mode with an x2many field
- touch a row in the x2many (trigger an event touchstart)

Before this commit:
    An error is displayed

After this commit:
    Nothing happens.

closes odoo/odoo#98893

Related: odoo/enterprise#30773
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 03:44:56 +02:00
William Braeckman 75cb824902 [IMP] website_sale: improve zoom features in front-end
This commit adds a new option for picture zoom on product pages.
The designer may now select a attachment viewer like carousel upon
clicking on images in the view.
The hover zoom has also been fixed as it was broken due to the bootstrap
5 changes.
The designer may choose between zoom on hover, on click, both or no
zoom.

TaskId-2922062

closes odoo/odoo#98305

Related: odoo/upgrade#3785
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 03:44:50 +02:00
FrancoisGe 1ecdbfcfbf [FIX] web: empty a many2one field
Before this commit, it was impossible to empty a many2one in a list view.

How to reproduce:
- go into a list view with a many2one
- empty a many2one containing a value
- click outside the line

Before this commit:
The record goes into readonly mode and its many2one returns to
its original value.

After this commit:
The record is saved and its many2one is empty.

closes odoo/odoo#99140

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 02:51:12 +02:00
Alexandre Kühn aecdc50278 [IMP] im_livechat, *: Refactor JS Public Livechat (step 16)
*: 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-2965839

closes odoo/odoo#99137

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 02:51:08 +02:00
Rémy Voet (ryv) 318888fd83 [IMP] *: add missing indexes
By observing the slowest queries in our servers, we find some indexes
to add (and verify the pertinence of each) :
- Add a index on `sale_id` of `stock_picking` because, it has a one2many inverse highly used.
- Add a index on `product_id` of `purchase_order_line` because, it has a one2many inverse in purchase_stock and there are some search with it (in `_compute_purchased_product_qty`).
- Add a index on `product_id` of `sale_order_line` to improve the `sale.report` view and it is also called by `_compute_sales_count`.
- Add a index `btree_not_null` on `created_purchase_line_id` of `stock.move` because its one2many inverse `move_dest_ids` is highly used.
- `key` on `ir_ui_view`: Backport of https://github.com/odoo/odoo/pull/97478

closes odoo/odoo#99130

X-original-commit: da55c8d88b846d9d1841712b6bd96799e2768a5b
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Rémy Voet <ryv@odoo.com>
2022-08-30 02:51:05 +02:00
Nasreddin Boulif (bon) d7cc0916b2 [FIX] website_event: Display cover even if text too long
Steps to reproduce:

  - Install `website_event` module
  - Go to Events and edit `Design Fair Los Angeles` event
  - Edit the title and make it very long then save
  - Go to the Website then click on Events in the menu
  - Click on Customize and disable `Layout - Columns` to have
    a list view.

Issue:

  The cover is hidden on edited event.

Cause:

  It's a know issue:
  https://stackoverflow.com/questions/36247140/why-dont-flex-items-shrink-past-content-size

Solution:

  Set min-width: 0 to the div arround the title if screen size bigger
  then `sm`.

opw-2882533

closes odoo/odoo#99078

X-original-commit: f9068079bd3535146727f710bc7a3aca863524ab
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-08-30 02:50:58 +02:00
Younn Olivier a574833055 [FIX] web_editor, website: unlock save/discard buttons on save failure
Before this commit, when saving a page website would fail (for a
validation error, for example), the "Save" and "Discard" buttons of the
SnippetsMenu were not re-enabled, and the edition was lost.

This was visible following this flow:
- Go on a job form view,
- Duplicate it,
- Go to its website page,
- Edit the title to remove "(copy)",
- Click on save,
=> There is a validation error (there cannot be two jobs with the same
title), the page was not saved and the user cannot access the
"Save" and "Discard" buttons to continue the edition anymore.

To fix that, the "after" callback of the SnippetsMenu _buttonClicked
method (which will re-enable the buttons) is added after or as the
onFailure callback of the "request_save" event.

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

task-2687506

closes odoo/odoo#98352

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-30 00:46:35 +02:00
Younn Olivier 706c782a97 [FIX] website: correctly remove website systray on replayed action
[1] added a way to detect a replayed action, and returns early the
effect that parses the action's params to ignore them.

This implementation is an error, as the return value of the effect was
not consistent: for a replayed action, it was not returning the cleanup
function that resets the pageDocument, websiteRootInstance and
currentwebsiteId.

This was leading to such behaviour, with enterprise modules:
- Go to the website,
- Click on the top left 'home' button,
- Click on the top left arrow to replay the action,
- Click on the top left 'home' button again,
=> The website systray is still there.

To fix that, the cleanup function is moved to an onWillUnmount hook.

Also, blocking the iframe until its first load event is called in an
onMounted hook, as it is the same as using a useEffect hook with no
dependency and no cleanup function, but it is clearer.

[1]: https://github.com/odoo/odoo/commit/83501e38a338cabd5a064dd0db9f70df08a3aadc

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

task-2687506

Part-of: odoo/odoo#98352
2022-08-30 00:46:35 +02:00
Younn Olivier e4d7fbfca8 [FIX] web_editor, website: keep the text selection when changing columns
It was decided with [1] to keep the text selection, if there was one,
when changing a snippet's option.
It was not working for the layout_column option:
- Drop a text snippet,
- Click on the first paragraph (the text is selected),
- Change the number of columns,
=> The text selection is lost.

To add some columns on snippets like the s_text_block which has no rows
and columns, the layout_column option will first wrap its content into a
set of row and column, which will remove the selection.
To fix that, the selection is restored after wrapping the snippet's
content.

The same thing is done when removing all columns from a snippet (and
unwrapping its content).

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

[1]: https://github.com/odoo/odoo/commit/e8112e2865ca449c4df9cd6147e9e24c4c6dcd41

task-2687506

Part-of: odoo/odoo#98352
2022-08-30 00:46:35 +02:00
luvi 33925701aa [FIX] web: fix the copied tooltip of CopyButton
This commit fixes the style of the field, which was
pretty broken since the Owl conversion.
It also bring back the tooltip (as in legacy) when
the button is clicked.

The button now only shows the tooltip if the text
has been copied successfully to the clipboard, and
not appear when it is not allowed or not available
in the browser.

Tests have been added to assert those behaviors.

Enterprise PR to adapt a selector in tests:
https://github.com/odoo/enterprise/pull/30832

closes odoo/odoo#98340

Related: odoo/enterprise#30832
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 00:46:26 +02:00
Ahmed Khalaf (ahkh) 275fa2f0ce [IMP] purchase: Purchase Dashboard to OWL
This commit converts the purchase dashboard to owl component
and removes its legacy code.

closes odoo/odoo#97590

Taskid: 2920812
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-08-29 23:46:48 +02:00
Tiffany Chang (tic) e4988b70ab [IMP] stock{_account}: add reference opening magic in list view
The move line form view is too technical for the average user so instead we
can to auto-magically open the reference document instead (picking or MO
only for now).

We do the same with stock valuation layers as well, but this feature
will not be available until its custom JS is converted to OWL

"product moves" part of b2b task: 2882539

closes odoo/odoo#97109

Related: odoo/enterprise#29974
Related: odoo/upgrade#3819
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-08-29 23:46:36 +02:00
Tiffany Chang (tic) a066638cd5 [IMP] web: allow custom row click action
This commit adds a generic `action="action_some_method"` attribute to
the list view to allow for a custom action when clicking on a (record)
row. This feature mirrors the existing Kanban "action" attribute.

Note that in cases where the action method does not return a valid
action then the default action `act_window_close` will be called
instead (same behavior as the kanban view and buttons in general).

Supports "magic link" part of Task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:36 +02:00
Tiffany Chang (tic) f05e3eabbe [IMP] stock{_account}: add (product) stock report
Adds a new reporting view for [storable] product.product to allow for
easier analysis by product (rather than by quant which is location
specific).

This includes:
- adding 3 new fields for products:
  - avg_cost = total svl value / total qty
  - total_value = avg_cost / on hand
  - company_currency_id = self.env.company.currency_id (i.e. the
    currently selected company) for which currency symbol to display in
    the view
  - IMPORTANT NOTE:
    - these variables (and some of the existing ones) do NOT support
      multi-company aggregations due these values being used to calcuate
      future svls which should be company specific. Larger refactoring
      would be needed to ensure correct calc in both cases. Larger issue
      occurs in stock.report which uses these variables in combination
      with variables that do take into account multi-company records.
- A customized `SearchPanel` so that a warehouse context can be applied
  to the view, rather than a filter. (viewable only when more than 1
  warehouse)

"stock report" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:36 +02:00
Tiffany Chang (tic) 36a2514430 [IMP] purchase,stock: improve misc small UX
Minor UX updates in purchase and stock:

Reworded (in stock):
- Default name location "Partner Locations" => "Partners"
- Default result for "Apply All" wizard "Inventory Adjustment" =>
  "Quantity Updated"
- Individual "Apply" move reference/name updated for individual quants
  (i.e. "Quantity Updated / Confirmed") so that the scheduled date is
  no longer included

Removed (from purchase):
- Duplicated menuitems, i.e.  "Purchase > Reporting > Purchase" showed
  the same thing as Enterprise menuitem and both were being displayed in
  Enterprise version. Also updated the no records found help message
  since old message appeared to be slightly out of date.

ENT PR: odoo/enterprise#29974
"other" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Tiffany Chang (tic) 9649000b89 [IMP] {purchase_, sale_}stock{_account}: improve forecast report UX
Minor UX updates to forecast report:

- add missing space (between # and unit + before |) also removed
  superfluous uoms (only need it at the end now that an equation is
  displayed)
- move On Hand Value to under product link (+ variants if they exist)
  and make it a link to the valuation report of the product(s) in
  question
- add link from Quantity on Hand to the locations (i.e. inventory/quants)
  report for the relevant product(s). Note that product template was
  added to Search in order to support default searching due to
  forecasting report structure
- redo the top right forecast values to be On Hand + Incoming - Outgoing
  = Forecasted so we provide more explicit and transparent values.
  Additionally, these values are made to not display decimal digits if
  all of those digits are 0.  Note that forecasted values in table are
  untouched (i.e. Forecasted Inventory = Forecasted is unchanged and
  Forecasted with Pending still shows in table)

Also did some t-esc => t-out replacement and other small cleanup since
templates were already being edited.

"forecasted report" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Tiffany Chang (tic) 06a2d3baaf [IMP] stock{_account}: update UX of valuation report
Note this is specific to the view shown when clicking on
"Reporting > Valuation", but this uses the same 'stock.quantity.history'
wizard and related custom js as "Configuration > Locations > Current Stock"

Minor UX updates to valuation report:
- don't default groupby product
- add filters incoming and outgoing (same logic as stock.move filters)
- replace "Inventory at Date" with "Valuation at Date" where appropriate
  (but leave location current stock view untouched)
- create separate view for the valuation report so remaining qty/value
  are displayed, but all other svl viewing actions (including the
  "Valuation at Date") will remain showing the original qty/value to
  support deeper analysis
- don't sum unit_cost when groupby is applied in list view since the
  value won't make sense
- add "reference" to svl which is = to stock.move.reference

"valuation" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Arnold Moyaux 0d826efeb3 [IMP] stock_account: add remaing quantity on layer with standard price
The purpose is to easily identify useful layers needed in an audit.
This way we could create a filter and only see layers that still have
quantity to deliver

Supports task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Tiffany Chang (tic) fc6aed2c28 [IMP] stock: update UX of stock moves lines report
Note this includes the view shown when clicking on:
- "History" button in inventory adjustments
- "Product Moves" button in scrap/product forms
- "Reporting" > "Moves History"
At time of this commit being written. Other move line views not changed
since they are specific to inputting data rather than readonly data.

Minor UX updates to stock move lines report:
- rename "Units of Measure" column to "Unit"
- add color to quantity field (green = incoming qty into stock, red =
  outgoing, black = all others [i.e. internal transfers/external
  locations only, etc]
- search filter order updated + src/dest location filters replaced with
  generic filter that checks if either meets condition
- add src/dest package to list view
- add status, lot, and from/to dest to kanban view and replace picking
  with reference so inventory adjustments are visible as well
- order by date desc so most recent ones are first
- always display location src/dest to help understanding of moves

Specific to "History" button in Inventory Adjustments / Reporting >
Locations (i.e. inventory report), moved product_id from domain to
default_search for more user analysis flexibility/ease.

"product moves" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:34 +02:00
Tiffany Chang (tic) f9c345fa21 [IMP] stock: update UX of stock moves report
Minor UX updates to stock moves report:

- don't default groupby source location
- order list by date
- rename "Units of Measure" column to "Unit"
- add color to quantity field (green = incoming qty into stock, red =
  outgoing, black = all others [i.e. internal transfers/external
  locations only, etc]
- search filter order updated
- make to location_{dest_}id text-muted when not a physical location
  (i.e. internal/transit)
- display "Quantity" instead of "Demand" for product_uom_qty and show
  sum at bottom of list

"stock moves" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:34 +02:00