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
closesodoo/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>
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
closesodoo/odoo#130065
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
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
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
closesodoo/odoo#131638
X-original-commit: 3b64971045741e5dbea93a8961a86a73cdeeb891
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
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
closesodoo/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>
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
closesodoo/odoo#131709closesodoo/odoo#131818
X-original-commit: e0bceb37ee7656c37ab99a4a4bb3b71d85199e1b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
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
closesodoo/odoo#131579
X-original-commit: 6848d8e37d1bce0cb767ba9328b38038b6056e77
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#131444
X-original-commit: 00b09c548b0a01191bea20584193da6a02681a36
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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.
closesodoo/odoo#131954
X-original-commit: 1138a24760ad57cb9e9895926012d269b4e2bfb0
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
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
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
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
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
closesodoo/odoo#130865
Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
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.
closesodoo/odoo#130522
Task-id: 3342969
X-original-commit: d4ba0c1f69212bfb0030036951c2888e935bbdf0
Related: odoo/enterprise#45060
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
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
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
closesodoo/odoo#130397
X-original-commit: c889dcc83daeaccb09b7692e430e232778fc031d
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
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
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.
closesodoo/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>
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.
closesodoo/odoo#130058
Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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: 8723f020c3closesodoo/odoo#129910
Task-id: None
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
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.
closesodoo/odoo#129468
X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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>
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
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
closesodoo/odoo#125642
Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
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
closesodoo/odoo#127469
Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
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
closesodoo/odoo#124157
Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
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
closesodoo/odoo#127246
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
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
closesodoo/odoo#124205
Task-id: 3354763
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
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
closesodoo/odoo#126805
Related: odoo/upgrade#4873
Signed-off-by: Laurent Smet (las) <las@odoo.com>
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
closesodoo/odoo#126529closesodoo/odoo#127794
X-original-commit: b64a378aab79ae4b6682ad66902c43a98a6f776d
Signed-off-by: William André (wan) <wan@odoo.com>
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
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
This commit remove the forgotten '#TODO: remove in master' that
were forgotten during the FW-port
closesodoo/odoo#125887
Signed-off-by: John Laterre (jol) <jol@odoo.com>
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
closesodoo/odoo#126836
X-original-commit: 3d6d36ac5bab95af76776f07e55f286850f22ff9
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
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
closesodoo/odoo#126388
X-original-commit: c2588824edc732bea40b1a8f6e5248b3d318b361
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
*: 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.
closesodoo/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>
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
closesodoo/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>
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
closesodoo/odoo#121627
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Before this pr the label and the field were way too close, by adding a padding
start the setting become way more readable.
closesodoo/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>
When uploading a PDF, the expense name is showing
the 1st category of expense instead of the name
of the PDF.
opw-3339756
closesodoo/odoo#123608
X-original-commit: 7ec2bb68067e49ea5ab2bbd6598264ccb78cfd70
Signed-off-by: William André (wan) <wan@odoo.com>
*: 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
closesodoo/odoo#123286
X-original-commit: b492049788353274fb32bb6fbe4d40e97a184a87
Related: odoo/enterprise#41798
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
=== 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
closesodoo/odoo#122986
X-original-commit: a1d697cc32ef4f94a4a7a89c3b442f58ddb8ecea
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
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
closesodoo/odoo#122133
X-original-commit: b7bc19e30afaf1e6374620b7a3bfbdf26c63e765
Signed-off-by: Laurent Smet <las@odoo.com>
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.
closesodoo/odoo#121607
Task-id: 3329707
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>