Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] hr_expense: usability improvements #138387

Closed

Conversation

alialfie
Copy link
Contributor

@alialfie alialfie commented Oct 11, 2023

This commit contains a few small improvements to Expense app.

  • Primary button moved to the left.
  • Reports are auto saved when created from an expense.
  • "Attach Receipt" button now sets the uploaded attachment as the main attachment.
  • Expense lines in a report are no longer editable. When a line is clicked, the main attachment for that expense (if any) is shown in the attachment previewer.

task-3539382

Enterprise PR: odoo/enterprise/pull/50136

@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch from 67c3e1b to eec21f0 Compare October 11, 2023 13:02
@robodoo
Copy link
Contributor

robodoo commented Oct 11, 2023

Pull request status dashboard

@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch from eec21f0 to 9d3d33d Compare October 11, 2023 13:05
@alialfie alialfie requested a review from h4818 October 11, 2023 13:12
@alialfie alialfie marked this pull request as draft October 11, 2023 13:33
@C3POdoo C3POdoo added the RD research & development, internal work label Oct 11, 2023
@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch 2 times, most recently from 2456f4a to 35e9fe0 Compare October 12, 2023 10:14
@alialfie alialfie marked this pull request as ready for review October 12, 2023 11:09
@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch from 35e9fe0 to 1614e22 Compare October 12, 2023 15:48
Copy link
Contributor

@h4818 h4818 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done.
I think a QUnit test is important, in case of changes to ListRenderer or x2manyField

addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
addons/hr_expense/models/hr_expense.py Outdated Show resolved Hide resolved
addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
addons/hr_expense/tests/test_expenses.py Outdated Show resolved Hide resolved
addons/hr_expense/views/hr_expense_views.xml Outdated Show resolved Hide resolved
addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
addons/hr_expense/static/src/views/expense_list_view.js Outdated Show resolved Hide resolved
@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch 9 times, most recently from 9556d08 to 3be712c Compare October 19, 2023 15:04
@alialfie alialfie requested a review from h4818 October 20, 2023 06:49
@JulienAlardot
Copy link
Contributor

Sorry for the hellish rebase you'll have on that one :p (also, check your missing EOL :) )

@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch from 3be712c to e1aa199 Compare October 25, 2023 09:53
@alialfie
Copy link
Contributor Author

Rebased and ready!

Copy link
Contributor

@JulienAlardot JulienAlardot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me why you are not using the hr_expense.message_main_attachment_id again?

addons/hr_expense/models/hr_expense.py Outdated Show resolved Hide resolved
addons/hr_expense/models/hr_expense.py Outdated Show resolved Hide resolved
@alialfie
Copy link
Contributor Author

Remind me why you are not using the hr_expense.message_main_attachment_id again?

PO request. When an expense line is clicked in a sheet, the last uploaded attachment in that line is shown, and message_main_attachment_id is not necessarily the latest.

@JulienAlardot
Copy link
Contributor

Remind me why you are not using the hr_expense.message_main_attachment_id again?

PO request. When an expense line is clicked in a sheet, the last uploaded attachment in that line is shown, and message_main_attachment_id is not necessarily the latest.

After discussions with Laura

  • We want to display the main attachment
  • If we add a new attachment through the "Attach receipt" it becomes the main attachment
  • If we add a new attachment through the "Add attachments" it keeps the previous one

The last 2 changes are handled by register_as_main_attachment parameter force=True (need to check but it may already be properly set, else it is an easy fix

The reason behind the "last attachment" was because of simplicity (from what another PO told her), here it's definitely not simpler

Note that you would have to edit the attach_document method and check that its overrides are now extends of it

(Also, note that right now as you are never sorting the ids you only show the oldest one and not the latest)

@alialfie alialfie force-pushed the master-imp_hr_expense_misc_modifs-alal branch 2 times, most recently from 675791b to e8e6eaf Compare October 27, 2023 07:38
alialfie added a commit to odoo-dev/odoo that referenced this pull request Apr 22, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.
alialfie added a commit to odoo-dev/odoo that referenced this pull request May 6, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.
robodoo pushed a commit that referenced this pull request May 6, 2024
In /pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in /pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes #155417

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request May 6, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

X-original-commit: 0624487
robodoo pushed a commit that referenced this pull request May 7, 2024
In /pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in /pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes #164640

X-original-commit: 0624487
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
alialfie added a commit to odoo-dev/odoo that referenced this pull request May 10, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes odoo#155417

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
robodoo pushed a commit that referenced this pull request May 10, 2024
In /pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in /pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes #155417

closes #164645

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
alialfie added a commit to odoo-dev/odoo that referenced this pull request May 10, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes odoo#155417

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
robodoo pushed a commit that referenced this pull request May 11, 2024
In /pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in /pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes #155417

closes #165117

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
zel-odoo pushed a commit to odoo-dev/odoo that referenced this pull request May 24, 2024
In odoo/pull/138387, a new feature was added where clicking on an expense line in an expense sheet will highlight the receipts of that line in the attachment viewer if any. A JS test was included for this feature that mocked the fetching of the sheet's attachment. Since this changed in the backend in odoo/pull/142029, the feature no longer worked but the test never broke since it was mocking the backend. This commit adds a tour to prevent that from happening again.

closes odoo#155417

closes odoo#165117

Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants