Commit Graph
3054 Commits
Author SHA1 Message Date
Hamza (hisl) d40d530a91 [FIX] hr_expense : remove the default_partner_bank_id
If we try to register payments for multiple expenses with multiple bank accounts from the expenses app, there is a traceback regarding the bank ids, as a singleton value was expected. We can do the same process from the vendor bills and the payment will be registered fine.

1. Create two expenses against two employees having different bank accounts.
2. Approve and post both of them.
3. In the 'To Pay' expense list, select the both expense reports and click on register payment.

Current Behaviour:
A traceback is thrown that a singleton value was expected. This is because there were multiple bank accounts against that payment.

Expected Behaviour:
The payment should be registered without any problem.

OPW-3272500

closes odoo/odoo#132774

X-original-commit: c7f62dca74e89659230ebc7a02d290cd62dd8323
Signed-off-by: Anh Thao Pham (pta) <pta@odoo.com>
Signed-off-by: Hamza Islam (hisl) <hisl@odoo.com>
2023-08-23 11:13:04 +02:00
Thomas Becquevort (thbe) a2963d689d [IMP] hr_expense, sale_expense: category on product form view
Prior to this PR, when creating a new product.product model, a product.category
is allocated. As it is not shown on the product.expense.form view, the user
might make mistakes  if he did not set  the product.category himself.
This can be fixed by adding the product.category field on the view to allow
the user to modify it.

Also, some design changes are made at the same time to improve the form view.

This PR improves the product.product.expense.form view by adding the
product.category field so the user can modify it and also by modifying the
general layout of the view.

The view is modified adding the field, aligning the two first fields and
removing the notebook page for the notes and placing it in the continuity of
the view as it is the only page in the notebook

task-3413267

closes odoo/odoo#130065

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-21 14:14:57 +02:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Gorash 75a105f46a [REF] base/all: Update modifier syntax: remove 'states' from fields
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.

During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').

Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.

Part-of: odoo/odoo#104741
2023-08-18 09:49:11 +02:00
Thomas Becquevort (thbe) 7e9129936c [FIX] hr_expense: expense splitting redirection and display
As from the 16.2, when splitting an expense, the wizard first opens so you
can modify the result of the splitting and when clicking the split expense
button, you are redirected to a new and blank expense. Inside of the
splitting wizard, if you click on a total and modify it without pressing
"Enter" or "Esc", the currency symbol stays to the extreme left of the
column. These two behaviors are not desired.

This PR changes the redirection after splitting an expense so the user is
brought back to the tree view of the expenses and the total field of the
lines inside the splitting wizard is modified so the symbol stays to the
right of the column.

For the redirection, a different return on the splitting action is added
and is triggered when the action is called from inside the wizard.
For the symbol, an adjustment to the field size is made so it stays
shorter until a bigger value is entered.

After this PR, the expense flow is improved with a better redirection of
the user after he split an expense and the display of the total amount
column is clarified

task-3443396

closes odoo/odoo#131638

X-original-commit: 3b64971045741e5dbea93a8961a86a73cdeeb891
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
2023-08-17 18:42:59 +02:00
SaddemAmine 5bd4120928 [IMP] hr_expense,project_sale_expense: Clarifying user error when partner is missing
When the partner is missing, the error message is not clear enough.
This commit adds a new error message to clarify the issue.

Task ID: 3438559

closes odoo/odoo#132029

X-original-commit: 5be853ebb6da19a4f0a147944995583e234bf1b9
Related: odoo/enterprise#45779
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Naceur Amine Saddem (sana) <sana@odoo.com>
2023-08-16 17:47:45 +02:00
Julien Alardot (jual) 7e1855f5b1 [FIX] hr_expense: Fix expense unit_amount computation
This fixes a bug when you change currency on an already saved expense
due to the fact that the unit_amount is never recomputed but used to
generate the move line balance

Step to reproduce:
- Duplicate an existing expense paid by an employee
- Change currency + save
- create -> post expense report
- The total amount and remaining amount do not match

closes odoo/odoo#131709

closes odoo/odoo#131818

X-original-commit: e0bceb37ee7656c37ab99a4a4bb3b71d85199e1b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-08-16 16:05:51 +02:00
mehjabinfarsana 0b2133fe4a [FIX] hr_expense: remove quick_create from expense report kanban view
before this commit, on expense report kanban view
after adding group by status, it allows the
to quick create expense report in approved
status.

after this commit, quick create is disabled

closes odoo/odoo#131579

X-original-commit: 6848d8e37d1bce0cb767ba9328b38038b6056e77
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:35 +02:00
niyasraphy 933856d669 [FIX] hr_expense: warning in log on posting expense je
before this commit, on posting journal entry from
the expense it shows a warning in the log.

*warning in the log*

Action {6: account.move(49,), 'type': 'ir.actions.act_window_close'} contains custom properties 6. Passing them via the params or context properties is recommended instead

after this commit, on posting journal entry
warning wont be displayed in the log

closes odoo/odoo#131444

X-original-commit: 00b09c548b0a01191bea20584193da6a02681a36
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:26 +02:00
Andrius Laukavičius 61bf9ae3bf [FIX] hr_expense: improve computed field performance
If you have large amount of product.template records (e.g. over 40k),
`hr_expense` module can't be installed as you would get MemoryError. It
would consume all memory while computing `can_be_expensed` field.

For that, using `_auto_init` to make it less of a memory hog.

closes odoo/odoo#131954

X-original-commit: 1138a24760ad57cb9e9895926012d269b4e2bfb0
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-08-14 20:24:47 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Jorge Pinna Puissant 7b1d82aa9b [REF] *: add t-key when needed on the template
As all the templates are now imported in the owl app, the templates must
comply to owl.

t-key is mandatory when using a t-foreach

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:27 +02:00
Thibault Delavallée 638e0f658d [REF] mail, various: cleanup alias usage
Cleanup alias usage and definition. Prepare code to ease future changes and
improvements. Notably

  * add a 'alias_email' computed field on the mixin allowing to have the
    complete alias email when set, and False in case it is inactive or linked
    to an inactive alias domain;
  * remove unnecessary alias_id field definition when just the help differs
    from the standard definition coming from the 'mail.alias.mixin';
  * use fields coming from 'inherits' instead of using alias_id and its sub-
    fields; notably use 'alias_display_name' and 'alias_email' fields;
  * remove useless custom code and management;
  * improve alias parameters support code in configuration parameters;

Task-3453343 (Mail: Cleanup Alias Usage)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#130632
2023-08-09 17:04:26 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
 web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.

task-3292454

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Maximilien (malb) e3f4651c52 [FIX] * : Display improvement
This PR will introduce multiple display improvements. Here is the list:

- In the accounting settings, the fiscal localization section has a button that
was oddly placed. This PR solves that issue.

- On the dashboard, when clicking the three dots on a card, the options "remove
from favorites" and "configuration" were not aligned.

- In ir_attachment, the label and field of "datas" will be aligned, and a gap
will be added between the icons.

- In the settings, the button links were inconsistent in terms of padding. This
PR resolves that.

- In the payment providers, two button links had text wrapping issues. By adding
 Bootstrap classes, this has been resolved.

closes odoo/odoo#130522

Task-id: 3342969
X-original-commit: d4ba0c1f69212bfb0030036951c2888e935bbdf0
Related: odoo/enterprise#45060
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-08-02 17:29:27 +02:00
Michael (mcm) 06adb79b1e [REF] hr_expense, lunch, mail: change patch to mixin
Before this commit, a patch was used to modify some classes in place
but these classes were declared some lines just before the patch.
This commit replaces those patches by mixins, it's a better way to
provide a same extension to multiple classes as the extension is
done by the language.

Task: 3410198
Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Julien Alardot (jual) 029a1ab2cc [FIX] hr_expense: Fix rounding mismatch
When paid by the company in another currency
with at least one tax, there may be
a rounding difference between the move and the expense

task-3390444

closes odoo/odoo#130397

X-original-commit: c889dcc83daeaccb09b7692e430e232778fc031d
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-08-02 06:18:39 +02:00
Julien Alardot (jual) a1d92ddd4a [FIX] hr_expense: Fix reports and moves accounting date
The accounting date on the report sheet and the linked
moves are always set at the current date

We want the accounting date to be the expense date,
or the most recent expense date when possible

task-3390444

X-original-commit: f1d03364230058f77f23bf0083e2757c8cd98e9a
Part-of: odoo/odoo#130397
2023-08-02 06:18:39 +02:00
Maximilien (malb) 182c8b0b84 [FIX] hr_expense: Fill payment_mode
When creating a new expense sheet the payment_mode is empty by default. When adding a new expense to it, the payment mode of the expense itself should be filled with 'own_account' but if the payment mode of the expense sheet is set, the payment_mode of the expense related will be the same as the expense sheet.

closes odoo/odoo#130372

Task: 3382023
X-original-commit: 662c98fb19aeef331f110d6dc4a3d68890af7df4
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-08-02 06:18:06 +02:00
FrancoisGe 9d2656720c [REF] *: remove model.notify()
Since the relational model was rewritten (PR 114024), it is now reactive,
so it is no longer necessary to use model.notify() to render the view.

closes odoo/odoo#130058

Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 23:21:18 +02:00
Julien Alardot (jual) 55f8f3b1c0 [FIX] hr_expense: fix create report button
On the hr.expense.tree view the create report button
raises an error since some recent framework refactor
This applies the related changes missed during the refactoring

related commit: 8723f020c3

closes odoo/odoo#129910

Task-id: None
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-31 20:53:58 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Louis Wicket (wil) 7da30c7d14 [FIX] mail, *: fix grammar error in field help
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.

Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”

The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.

closes odoo/odoo#129468

X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-25 17:36:08 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Laurent Smet 1de5c98c3a [IMP] account: Add 'Request Cancel' step in invoice workflow
Allow localizations having an EDI to prevent resetting to draft an invoice already
sent to a government. By law, in some countries, if you want to cancel an invoice,
you need to ask an authorization from the government.

Task: 3069324
Part-of: odoo/odoo#128395
2023-07-20 20:53:05 +02:00
william-andre 0479b2b594 [IMP] account,*: manage subsidiary companies
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models

These records can be read and used in children companies.

This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
  country

task-3371677

closes odoo/odoo#125642

Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-20 11:49:06 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
Pierre Pulinckx (pipu) 8bfa76a842 [REF] *: Unify _t and _lt
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.

In this commit,

the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.

Example :

registry.category("web_tour.tours").add("example", {
    test: true,
    steps: () => [
        {...},
        {...},
    ],
});

task-3292454

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-19 13:13:16 +02:00
Julien Alardot (jual) 495546de79 [IMP] hr_expense: Allow user to fix currency rate
This allows the user to set the total_amount_company

Currently, when an employee set the amount
in a foreign currency, Odoo doesn't let the employee
register how much they have been charged after
conversion in their own currency
(assuming that it's the company one)

After this if the user changes the total_amount_company,
the new rate is computed and used

Task-3255758

closes odoo/odoo#127246

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-15 04:01:01 +02:00
Yosua Nicolaus 41d56e2e98 [IMP] expense: default expense category on scan
Description of the issue/feature this PR addresses:
- Expenses are automatically created when uploading or scanning receipts. This is a feature often used by employees who have a lot of tickets and upload them in batch. The expenses created have a random category (product_id) specified. Companies may however want to specify the default category for accounting or management purposes. They are currently unable to do so.

Current behavior before PR:
- Companies can't specify default category for scanned/uploaded expenses

Desired behavior after PR is merged:
- In the Expenses setting, combine the "Default Journals" and "Payment" block into one and name the new block "Accounting"
- Add new setting in Expenses for specifying default category for scanned/uploaded expenses
- If that setting is set, use the value inside it for the category field of new scanned/uploaded expenses

closes odoo/odoo#124205

Task-id: 3354763
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-07-13 16:52:52 +02:00
Julien Alardot (jual) 81fe11fabb [IMP] hr_expense: Split company payments per expense
When an expense sheet move is created, there is only one
outstanding line, but it is usual to pay separately.
That makes the reconciliation step harder.

This makes sure one move is created per expense

Task-3328877

closes odoo/odoo#126805

Related: odoo/upgrade#4873
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-13 14:47:30 +02:00
Yolann Sabaux b970caef22 [FIX] hr_expense: set correct account_id on upload
Steps to reproduce:
- On the expense product by default, set an account_id
- Upload an expense

Issue:
The account_id that we set is not the one on the newly created expense

Cause:
We don't give any account_id during creation. Therefore, the account_id by default is set:
https://github.com/odoo/odoo/blob/7bcd64c51b2e87ece462c75a528c9ad6e1601633/addons/hr_expense/models/hr_expense.py#L31-L32

opw-3343007

closes odoo/odoo#127891

X-original-commit: c6b048196be92392ee34e50cc7ab13107632b87e
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-07-10 16:59:33 +02:00
Yolann Sabaux acc638f80a [FIX] hr_expense: enable change account for no-access users
Commit #2:
Splite the method `_compute_from_product_id_company_id` so each stored field has its own compute method to avoid invalidation issues.

opw-3336796

closes odoo/odoo#126529

closes odoo/odoo#127794

X-original-commit: b64a378aab79ae4b6682ad66902c43a98a6f776d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-07 20:24:50 +02:00
Yolann Sabaux 033c446084 [FIX] hr_expense: enable change account for no-access users
Steps to reproduce:
- install Expense and Accounting
- create 3 separate Expense categories ( this will create a related product of 'service' type) with a different Expense account and Vendor tax on it.
- Configuring different Taxes are important to replicate the issue
- Create a 'test' user who has no access to apps
- login a 'test' user and create an expense for one of the categories and save it.
- Update the expense to a different category and click 'submit to Manager'

Issue:
The account_id of the expense is not updated

Reason:
Multiple fields are computed using the same method `_compute_from_product_id_company_id`. The field being read-only=False
https://github.com/odoo/odoo/blob/c38cf4c2038d15890d5d50ec05fd5cb4f9f379b1/addons/hr_expense/views/hr_expense_views.xml#L199
It is protected during the write; that is, considered as user input

Solution:
Duplicate the field is it will not be read-only and put it as invisible
Split the compute method

opw-3336796

X-original-commit: 6664ccba5230d7890964cfe372ca863314f2fad4
Part-of: odoo/odoo#127794
2023-07-07 20:24:50 +02:00
Yannick Tivisse e8c48f824e [IMP] hr: Remove address_home_id field
Improve usability of employee form. It is confusing for end users
to create another record to encode the employee address.

Move all the private information on the hr.employee record itself.

Remove the M2O address_home_id.

TaskID: 3101400
2023-07-05 14:21:28 +02:00
flvr-odoo 729ec65d36 [FIX] account, hr_expense: removing forgotten 'TODO'
This commit remove the forgotten '#TODO: remove in master' that
were forgotten during the FW-port

closes odoo/odoo#125887

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-07-04 17:59:42 +02:00
Julien Alardot (jual) 649b6d055d [FIX] hr_expense: fix currencies handling
Allow expenses reports to generate foreign currency
payments and use foreign currency accounts when all
expense lines are of the same currency.
If the report is multi-currency the company currency
is used instead (previous behaviour)

Task-3346458

closes odoo/odoo#126836

X-original-commit: 3d6d36ac5bab95af76776f07e55f286850f22ff9
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-06-30 01:32:58 +02:00
Ryan Cen 2bd6553ea4 [FIX] hr_expense: Add inverse on total_amount to update unit_amount
The customer was having an issue where they would create an expense from an email with the wrong cost on the expense.
Then when they would try to change the price on the expense record it would seem find all the way up until the journal was posted.

Issue:
When creating an expense from an email the unit_amount is updated instead of the total_amount.
This would cause issues if you had an attachment because when you would attempt to change the amount through the front-end this unit_amount would never get updated because it was set and there was an attachment (line 265).
However, when you would create a journal entry from this expense, because it has the unit_amount != 0 it would provide the unit_amount instead of the total_amount.
Thus propogating the original number from the email even if it was updated between the time of posting and the creation of the expense from the email.

Solution:
Implement an inverse function on total_amount that will update the unit_amount to total_amount_company.
This will cause the unit_amount to stay up to date with the total_amount while also taking into account currency.

opw-3286372

closes odoo/odoo#126388

X-original-commit: c2588824edc732bea40b1a8f6e5248b3d318b361
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-06-26 22:15:20 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
Andrea Grazioso (agr-odoo) 4caddf1787 [FIX] hr_expense: due date conflict with payment terms
Have an employee with payment terms set in the contact form
Create an expense for $100 for the employee
Create the expense report > Submit to manager > Approve > Post journal
entries

Issue: The bill due date is manually set to the Accounting Date.
This is not consistent with the Payment terms applied on the
bill

opw-3298981

closes odoo/odoo#124542

X-original-commit: d363aa12429768e63d0f9def7006101983fd0adc
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-12 12:41:19 +02:00
Ali Alfie (alal) 10d0805c94 [IMP] hr_expense: include paid by company expenses in status bar
Before: in the "My Expenses" statusbar, only expenses paid by the employee were shown.

Now: for the "to submit" and the "under validation" states, we show expenses paid by the employee AND the company. For the "to be reimbursed" state, we ONLY show expenses paid by the company.

task-3319115

closes odoo/odoo#121627

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-06-09 12:21:47 +02:00
Maximilien (malb) 2eca114f52 [FIX] hr_expense: padding setting
Before this pr the label and the field were way too close, by adding a padding
start the setting become way more readable.

closes odoo/odoo#123887

Task-id: 3338500
X-original-commit: 33d2cf77434c27f3ac382dc45888f7824dbb6bb5
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-06 13:10:42 +02:00
Guillaume (guva) e2500e26df [FIX] hr_expense: expense name on pdf upload
When uploading a PDF, the expense name is showing
the 1st category of expense instead of the name
of the PDF.

opw-3339756

closes odoo/odoo#123608

X-original-commit: 7ec2bb68067e49ea5ab2bbd6598264ccb78cfd70
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-02 23:39:32 +02:00
Elisabeth Dickinson c84d388fac [FIX] *: switch image's .rounded-circle to `.rounded
*: gamification, hr, hr_contract, hr_expense, hr_holidays, hr_org_chart,
lunch, mail, web

Since the Milk refactoring, the backend uses only `.rounded` avatar
images. The `.rounded-circle` classes on images have been replaced by
`.rounded`.

task-3336569
part of task-3326263

closes odoo/odoo#123286

X-original-commit: b492049788353274fb32bb6fbe4d40e97a184a87
Related: odoo/enterprise#41798
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-01 17:55:25 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Chrysanthe (chgo) 5754d06104 [FIX] hr_expense, web: fix CP buttons spacing
=== ISSUE ===

If you open the `Expenses` module, the buttons placed on the left inside
the Control Panel have a custom margin. One of them has a `.mx-1` and
another one has a custom `.gap` defined in the SCSS files.

=== AFTER ===

We remove the `.mx-1` class to replace it with a `.me-1` class, which
is used across Control Panels to space buttons.

We also fix a global issue with the `.o_list_buttons` inside a
`.o_list_view` class, which was adding a gap defined in CSS. Since this
gap is added on top of our `.me-1`, this was generating a higher value
than expected for the margin.

task-3330141
part of task-332626

closes odoo/odoo#122986

X-original-commit: a1d697cc32ef4f94a4a7a89c3b442f58ddb8ecea
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-05-31 09:23:21 +02:00
Abdelouahab (abla) 90c94b0de1 [FIX] hr_expense: scrolling in tree view
To reproduce
============
create many Expenses records, go to expenses in List View
scrolling not working

Problem
=======
some style classes are not applied on the correct element, which leads to this behavior

Solution
========
apply the classes on the correct element

opw-3300041

closes odoo/odoo#122133

X-original-commit: b7bc19e30afaf1e6374620b7a3bfbdf26c63e765
Signed-off-by: Laurent Smet <las@odoo.com>
2023-05-24 14:28:06 +02:00
Damien Bouvy 0066181f81 [FIX] hr_expense: misaligned icon
X-original-commit: c5a4f0532140d7bd429c1da787d461debda2b5a7
Part-of: odoo/odoo#122111
2023-05-23 22:32:45 +02:00
Maximilien (malb) 1c6a8a2975 [FIX] hr_expense: css issue on attachment
Before this pr, when attaching an image to an expense, the image was misplaced.
By adding a display flex and justify the content in the center, the image is now
vertically align in the center.

closes odoo/odoo#121607

Task-id: 3329707
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-23 18:01:43 +02:00