The desired flow of currency rate in expense is as followed:
- (default) Use Odoo currency rate
- Allow the user to set a custom rate (to include fees) when changing
the total amount in company currency
- Revert to the default behaviour when the currency is changed
or the amount in foreign currency is changed
This aims to fix how currency rate is computed and overridden
- Reorganize all currency rate computation, so it doesn't revert to Odoo rate
at every compute call
- Deals with a bug where a "total_amount_currency", when changed
just before calling "action_submit_expenses" would not trigger
the computation of unit_amount
- Force save when changing currency on expense form view to prevent a bug
where the first modification of "total_amount_company" would be canceled
(due to the new behaviour of currency rate computation)
- Removes unit_amount_display from views as it should be removed
in later versions and is deprecated since 16.0
task-3476569
closesodoo/odoo#137598
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit adds a copy of the attachments from the expense report to the created journal entry.
task-3443042
closesodoo/odoo#132955
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
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
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
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>
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>
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
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>
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>
Activate Multicurrency (USD company curr, EUR foreign currency, 1 EUR = 2 USD)
Have a Bank account in both currencies.
Create an expense of 100€, paid by company
Create report, set EUR journal as Bank Journal
Send To manager > Approve > Post Journal Entries
Open created payment
Issue:
- Payment amount is 200€
- In journal items, amount_currency and balance is 200$
Do the same with "Paid by employee".
Open the vendor bill
Issue:
- Invoice lines are expressed in the wrong currency
opw-3269009
closesodoo/odoo#119490
X-original-commit: 5eab4469d87a4d1ca80916ca5790691ffed68e38
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
The computation of `use_in_tax_closing` was overlooked when refactoring[^1]
the CoA templates. Since it was using a `onchange` with an extra code in
`create` of the `account.tax.repartition.line.template`, it didn't work on
its own after the refactoring.
[^1]: 5125748616closesodoo/odoo#119440
X-original-commit: e51ffcb01be3238338f23946b75f7e034032cf37
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Explanation:
A rework of hr_expense has been introduced in master and landed in 16.2.
https://github.com/odoo/odoo/commit/f79ff3fb374650670e89f231aaf17bb8d6596c25
There was a need to backport it to 16.0 then 16.1.
https://github.com/odoo/odoo/commit/90affb562962d0dc233526e3f15f5b60f383331d
During the backport;
- a computed fields 'journal_displayed_id' has been introduced and will need to be removed again in master.
- 2 bugs have been discovered:
-- the analytic.account were not created anymore (function not called)
-- the payment terms for expense paid by company could not be modified as a filter was missing
closesodoo/odoo#115650
X-original-commit: 672f4efd2c990ab6eef8f934c41625860b8ded46
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
Steps to reproduce:
Create an expense by sending an email.
Make sure the product has a zero cost.
Issue:
The expense has no total amount even if
a unit price is detected in the subject of the mail.
Solution:
Compute a total amount if we have a unit price.
opw-3128566
closesodoo/odoo#115620
X-original-commit: eb629fa82cbf592184ed60d0bf309a26a4465b70
Signed-off-by: William André (wan) <wan@odoo.com>
Rework of the hr.expense workflow so that:
- expenses paid by employee generate purchase.order
- expenses paid by company generate entry that look like payments
Main reason being that purchase.receipt are not active by default.
That makes the entry hard to find, holes in sequences, inconsitency
with payment states.
It also remove the refusal of expenses as this was dead / inaccessible code, only reports can be refused.
task-id: 3126550
[community](https://github.com/odoo/odoo/pull/110518)
[enterprise](https://github.com/odoo/enterprise/pull/36090)
closesodoo/odoo#110518
Related: odoo/upgrade#4266
Related: odoo/enterprise#36090
Signed-off-by: Laurent Smet <las@odoo.com>
To reproduce
============
- create a payment term with Balance of 3 months and a percent with 50 as value
- create a vendor bill using this payment term
- try to register a payment, the amount is not showing
Problem
=======
the amount field would be invisible if the Group Payment check box is checked,
and in this case it should be checked because it's one deadline.
Solution
========
the problem comes from the fact that the compute method that will check or uncheck
the group payment field, is called twice in same compute process but we only execute it
once because the record is protected and that's how ORM is expected to work to avoid infinite loops.
to solve the issue, `group_payment` was removed from `_get_batches` because it's not necessary.
opw-3103465
closesodoo/odoo#111710
X-original-commit: 5fd0dc7929156b193271679be90f1cbdf4e626b3
Signed-off-by: abla001 <abla@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce:
- Install Expense module
- Activate analytic accounting in settings
- Create an analytic account X
- Create an expense with X as analytic
- Delete the analytic account X
- Go back to the expense created
Issue:
Cannot access the expense (error message).
Cause:
The analytic account is deleted but the analytics (Json field) on the
expense are not updated.
Solution:
When deleting an analytic account,
if used in an expense raise an error.
opw-3059908
closesodoo/odoo#109012
X-original-commit: 6c058e62812605f511220ec6cde06ebe77ae7edd
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
The - Split Expense - feature was introduced in odoo/odoo#90770
In this commit we fix the following bug, related to it:
Steps to reproduce:
- Create expense with tax_ids.
- Click on - Split expense on the expense form. From the first
hr.expense.split line remove the tax_ids. Rename it as '1',
so that it is easier to find it back for checking later on.
- Click on - Expense split on the wizard.
Check the resulting expenses. Specifically, the one with the name '1'.
Current behavior - The tax_ids field for the first expense
(with the name '1') is still populated.
Expected - The tax_ids field for the first expense should be empty.
On top of that, we introduce the tests that check Split Expense flow.
task - 2831024
closesodoo/odoo#108049
X-original-commit: 3aaf4f1ee2967793c9a4c29766cec63d2c6e3cf4
Related: odoo/enterprise#35005
Signed-off-by: Kevin Baptiste <kba@odoo.com>
It is not possible to post the journal entries related to an expense
paid by the company
Steps to reproduce:
1. Install Expense
2. Create an expense payable to company
3. Set an amount
4. Create report
5. Submit report
6. Approve report
7. Attempt to post
8. An error is thrown
Solution:
Relax the constraint on account.move.line linked to an expense paid by
the company
Problem:
The constraint `_check_payable_receivable` in the account module forbids
to post the journal entries even though they are correct
opw-3038648
closesodoo/odoo#106266
X-original-commit: 09274db12a25c178974dc20c4d669134e21cddbe
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
When printing a check that comes from an expense,
the check has no reference to the move from which
the payment has been created.
The reason is that we filter the move by taking
only outbounds to complete the check informations,
but moves from an expense are of type entry.
With this commit, we allow moves coming from
expense to be taken into account by adding a
check on move.move_type.
opw-3044141
closesodoo/odoo#105157
X-original-commit: b588329a45633f0dec89fe195cf24a8b3671dedd
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
During a refactoring [1], the behavior of having the taxes included in
the price for all expenses was broken/removed.
All the fields related to taxes are computed should be computed with the
correct context key when computing entries related to expenses. This is
preferred to adding the context key only when creating because it will
then keep the behavior even when editing the document.
task-3043252
[1]: https://github.com/odoo/odoo/commit/d8d47f9ff8554f4b39487fd2f13c153c7d6f958dclosesodoo/odoo#104746
X-original-commit: 6e944ac5fe108d5f2bc2d3f41ab547efd88a5ede
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
The `analytic_distribution` field is a Json.
It was stored temporarily as a char.
Search is not available yet, so we do queries by hand when we need to search on keys.
Also added a constraint on account_analytic_distribution_model,
so we don't have models with accounts specific to a company when the model has no company or another company.
It would cause an issue when looking at the models from another company.
X-original-commit: 7064c95aa04e5138bb12ae97acfee04ebb67cc0e
Part-of: odoo/odoo#103097
Currently, when posting accounting entries from an expense report, the accounts set on the expense entries were not taken over in the account move lines. Also, the employee was not set as the vendor of the purchase receipt (account move).
This PR makes sure that both the accounts on the expenses, as well as the vendor (employee) is set on the account move created from an expense report.
Tests added as well.
closesodoo/odoo#103037
X-original-commit: 066c70e483b2f49ae48cb98ddc412014f4fe258a
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Bank statements are now optional in accounting. The users add statements directly and can assign statements for control reasons.
The users can enter end date and end balance real for the statements and attach the bank statement scan.
The system checks if there is a gap (lines without statement) before current statement and warns the user
with decoration, also we check if the ending balance match the accumulated balance of the last line.
Bank statement lines now show an accumulated balance and can be sorted by drag and drop in the same date, if the user drags a line
to a position with lines of another date, it simply doesn't have any effect.
Rename accumulated balance to cumulative balance, a better name
closesodoo/odoo#99092
Task: 2879904
Related: odoo/upgrade#3906
Related: odoo/enterprise#30824
Signed-off-by: Laurent Smet <las@odoo.com>
The goal of this commit is to get rid of the analytic tags as they were confusing, serving tag purposes as well as distribution on analytic accounts.
Everywhere analytic tags were used as a distribution have been replaced with a new widget that will dispatch distribution on analytic accounts. If there was an analytic account field next to the tags, it has been included in the distribution.
Analytic tags that were used simply as information tags have been removed.
To fill the new widget, there are now 2 kind of rules that will help fill and prefill it.
The first are applicability: previous groups have been removed, and have by replaced by plans. Each account is required to have a plan. These plans define when they are available in the widget: a default applicability per plan and applicability lines that can specify rules following the context of the widget.
The second one are distribution models, that will replace previous default rules but follow the same principles. The accounts (and so the plans) that will be given by the distribution model can override the applicability rules from before.
closesodoo/odoo#98914
Related: odoo/upgrade#3885
Related: odoo/enterprise#30743
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: Habib (ayh) <ayh@odoo.com>
Major changes:
- converted list view to owl
- merged menus
- added CREATE REPORT button on hr.expense that reports either
ticked draft expenses, or all the draft expenses for the user
- added dynamic buttons on expense.sheet list view
- added searchpanel on expense.sheet for team approvers and above
- moved (and changed) expense categories from demo to data
- added support on drag'n'drop while in list and kanban view of
expense for quick upload
task - 2831036
closesodoo/odoo#93802
Related: odoo/enterprise#28474
Related: odoo/upgrade#3778
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This is an oversight of odoo/odoo#95729
In a database with multi-uom disabled,
when attempting to create an expense choosing a product
with a different unit of measure than the Unit(s)
a ValidationError was raised to the user
regarding an UOM incompatibility
e.g.
- Create an expense
- Set the product "[MIL] Mileage", using the uom "km"
- Save
-> ValidationError about UOMs
This is because the above mentioned PR makes the
`product_uom_id` completely removed from the view,
and the onchange no longer set the uom correctly within the form.
Solve this by setting `precompute=True` on the UOM field,
and the other fields using the same compute method.
In addition to solve the issue, it also allows to create
more easily expenses from the XMLRPC API:
Before, when creating an expense for the product "Mileage",
it was required you set yourself the uom correctly
in your API call,
even if multi UOMs was disabled in your database.
After, it's no longer mandatory to pass the UOM to use,
it is correctly computed from the product directly,
by default.
closesodoo/odoo#98662
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
TLDR:
* invoices are implemented using computed methods instead of onchange
* the synchronization only happens when switching tabs in the Form view
to improve perfs.
_______________________________________________________________________
The whole engine of the synchronization of Invoices to the Journal
Entries has been refactored
* by using computed fields instead of onchange functions
* by synchronizing only from invoice to journal entry in `create` and
`write`
* by saving when switching tabs on the Invoice form, to synchronize
before showing the values
This comes with numerous advantages:
* no need to call the onchange methods manually
* no need to use the Form emulator to build invoices (i.e. EDI, OCR,
intercompany, ...)
* the performance for invoices with many lines improves drastically, going
from 2 minutes to 4 seconds to create an invoice with 500 lines
* the model is more declarative, we can now see how the values are computed
instead of having the values being copied from various places.
* remove the hack in `onchange` that disabled the recursivity of it,
which was unexpected and needed to be managed manually in all the
onchange methods
This means that:
* Some fields need to be exclusively computed on journal entries values
or invoice values, more specifically the Tax Summary widget.
It is now
- computed from entry lines, when opening the view
- computed from invoice lines when changing those, because the tax lines
will need to be recomputed anyways, erasing previously set values
- set with an inverse function when saving; after the sync has been done
* Some possible operations previously possible have been dropped.
(i.e. look at the removed test test_in_invoice_line_onchange_accounting_fields_1)
This is because such a behavior was undefined (how is changing the balance going
to affect the unit price? How is the amount currency going to affect it?)
_______________________________________________________________________
Implementation Details
----------------------
The "dynamic lines", meaning the payment terms and the tax lines are now
only created in the `create` and `write` functions.
In order to reduce code duplication, it has been implemented using
context managers used in both `account.move` and `account.move.line`
These context managers help comparing the values before/after, acting
like a local `onchange`, but getting benefit from the dirty flags from
the `compute` dependences.
This is relying on computed fields on the move (`needed_terms`) and on
the lines (`compute_all_tax`) which contain the values needed for the
related move.
Depending on the needed values and the existing values (`term_key` and
`tax_key`, respectively) the context manager will determine what needs
to be created/updated/deleted.
Some related changes are to produce a `dict` instead of a `str` for the
`tax_totals` (previously `tax_totals_json`) fields, by simplicity to
reduce the complexity of IO, and simplicity of debugging, because the
logic of the field needed to change (cannot be computed at the same time
anymore since it needed the lines to be synced)
By simplicity, and also because it makes more sense, some boolean fields
have been merged into `display_type`:
* `is_rounding_line`
* `exclude_from_invoice_tab`
* `is_anglo_saxon_line`
The `price_unit`, `quantity` and other "invoice fields" are now not set
anymore on lines that are not product lines since it didn't make any
sense to have it.
Performances
------------
You have to keep in mind that a simple `create` didn't compute a lot of
fields, for instance not taxes were set, no payment terms,...
Now it does.
```python
import random
from timeit import timeit
from odoo import Command
domain = [('company_id', 'in', (False, self.env.company.id))]
products = self.env['product.product'].search(domain).ids
partners = self.env['res.partner'].search(domain).ids
taxes = self.env['account.tax'].search(domain).ids
def create(nmove, nline):
self.env['account.move'].create([
{
'move_type': 'out_invoice',
'partner_id': random.choice(partners),
'invoice_line_ids': [
Command.create({
'name': f'line{i}',
'product_id': random.choice(products),
'tax_ids': [Command.set([random.choice(taxes)])],
})
for i in range(nline)
]
}
for j in range(nmove)
])
# After | Before
print(timeit("create(1, 1)", globals=globals(), number=1)) # 0.11 | 0.09
print(timeit("create(100, 1)", globals=globals(), number=1)) # 2.76 | 2.50
print(timeit("create(500, 1)", globals=globals(), number=1)) # 14.56 | 12.34
print(timeit("create(1, 100)", globals=globals(), number=1)) # 1.03 | 5.52
print(timeit("create(1, 500)", globals=globals(), number=1)) # 3.99 | 125.02
print(timeit("create(50, 50)", globals=globals(), number=1)) # 19.44 | 79.55
```
Another metric that can be used is running the test suite with
`--test-tags=/account` (only `account` installed)
* before: 404s, 267127 queries (366 tests)
* after: 318s, 232125 queries (362 tests)
Why this commit title?
----------------------
Someone told me that this was the perfect way of naming your commits.
c04065abd8
task-2711317
closesodoo/odoo#96134
Related: odoo/upgrade#3715
Related: odoo/enterprise#29758
Signed-off-by: Laurent Smet <las@odoo.com>
Task: 2856281
- Remove user_type_id, account.account.type model, internal_type
- Add account_type that is a simple selection field
- Move internal_group and include_initial_balance to account.account
- Because of these changes, type_control_ids on account.journal is also removed
closesodoo/odoo#93212
Related: odoo/documentation#2223
Related: odoo/upgrade#3595
Related: odoo/enterprise#28205
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
In case we change the employee on an expense and in case expense has
sheet which has only one expense_line_ids, then changing the
expense.employee_id triggers changing the sheet.employee_id too.
In case there are more than one expense linked to the report, then we
unlink the expense line from sheet, (so that the user can create a new report).
task - 2890095
closesodoo/odoo#94424
Signed-off-by: Kevin Baptiste <kba@odoo.com>
- Refactor the bank reconciliation widget to use more standards views and have a side-by-side kanban/widget views instead.
- Make sure the bank reconciliation widget is doing the same thing as the "reconcile" method on account.bank.statement.line. Then, what you see on the view is exactly what you get on the corresponding journal entry.
- Since the "reconcile" method is gone, clean the matching rules since it's now called only for one statement line at a time. Also, move the auto_validate feature into a CRON to avoid performance issues when opening the widget.
closesodoo/odoo#91448
Task: 2555114
Related: odoo/enterprise#27360
Related: odoo/upgrade#3555
Signed-off-by: William André (wan) <wan@odoo.com>
Enterprise PR - odoo/enterprise#23980
Upgrade PR - odoo/enterprise#3206
- UI improvements/changes
- Taxes
Before this commit, in case taxes were defined on expense,
the tax amount was added on top of a product price.
For example, in case product price was 100$, and tax - 15%,
then expense.total_amount would be 115$.
Now, tax amount is included in expense.total_amount. To accommodate
this change, we set following domain - ('price_include', '=', True)
on tax_ids on expense.
For the same example, expense.total_amount would be 100$, tax amount
would be 13.04$ and untaxed amount - 86.96$.
But, tax amount can be set for non-zero expenses (in case expense.product_id.standard_price !=0).
For the above example, one could set tax amount to 15$.
As a result untaxed amount will be 85$ and total amount - 1OO$.
- Journal entry
Previously, in case journal entry was reset to draft, canceled,
reversed - it changed the state of the linked expense report.
Now, actions done on accounting by accountant does not impact expense reports.
task - 2687999
closesodoo/odoo#81904
Related: odoo/upgrade#3206
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Current behavior:
When cancelling an expense payment, the expense state was not modified and was still 'paid' when it should be 'refused'.
Steps to reproduce:
- Create an expense and post the expense and register a payment for the expense.
- Then go the vendor payments and cancel the associated vendor payment.
- The expense still shows as paid in the expenses page.
opw-2711383
closesodoo/odoo#82496
X-original-commit: 16459957d23f4bdfddfe96d72ef96cbdc6fec539
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
In a multi-currencies environment, if the user creates an expense with a
different currency than the company's, one of the associated account
move lines will have an incorrect base amount.
To reproduce the issue:
(Need account_accountant. Let USD be the company's currency)
1. In Settings, enable "Multi-Currencies"
2. Edit the currency rates:
- EUR: 2
- USD: 1
3. Create an expense:
- Currency: EUR
- Unit Price: 700
- tax: 15%
4. Create Report, Submit, Approve, Post Journal Entries
5. Accounting > Reporting > Tax Report, This Financial Year
6. Audit of "Tax 15.00%"
Error: Base amount of the expense is $700, which is incorrect. It should
be either 700€ or $350
OPW-2613547
closesodoo/odoo#75264
X-original-commit: d6fd7301291dfe3ffd58d33edb3f2c4270e3b8a1
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Steps to reproduce the bug:
- Install Accounting and Expense app
- Go to accounting settings > enable cash basis option
- Go to accounting > configuration > accounting > taxes
- Create a new tax or choose an existing one e.g “Tax abc”:
Tax Computation = `”Percentage of Price”`
Tax Type = `”Purchases”`
Choose any value for amount
Select "Based on Payment" in tax due
choose an account with the "Allow Reconciliation" option activated in the Cash Basis Transition Account field
Save
- Go to expenses > Expense Reports > All reports > Create a new one :
- Add 2 expense and for both set up the taxes to "Tax abc" and unit price > 0
- Submit to manager
- Approve
- Post journal entries
- Register a payment
Problem:
A user error with the following message is triggered: “You are trying to reconcile some entries that are already reconciled”
In the use case we have two expenses and for each, an `" account.partial.reconcile "` will be created,
so we will loop twice and therefore add twice all the `”account.move.line”` linked to the taxes
in the dict `" to_reconcile_after "`: https://github.com/odoo/odoo/blob/beccf82e09d536255d9d9cb9bfe58ebae2559843/addons/account/models/account_partial_reconcile.py#L585
Then we loop to reconcile all the `" account.move.line "` which are in the dict `" to_reconcile_after "`,
but since we added them all twice, at each turn of the loop we give them all as a parameter
of the “reconcile” function without checking whether they are already reconciled or not.
opw-2565934
closesodoo/odoo#74432
X-original-commit: fb2b1482f5d3dec924b08e08dc915d6608c7d6b3
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
To improve the payment method system, proceed to a few changes
such as changing the view a bit, making sure payment acquirers are not
linked to a journal by default and that only the manual payment method
type can be used multiple times in a single journal.
Task id #2573145closesodoo/odoo#73596
X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Users may want to be able to have transactions coming from multiple
payment acquirers to be registered in the same journal.
This will allows that.
Task id #2414749closesodoo/odoo#67331
Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
- Add "payment_status" field to be more explicit.
- Turn error message "Expenses must have an expense journal specified to
generate accounting entries." into "Specify expense journal in tab
Other Info to generate accounting entries."
closesodoo/odoo#65528
Task: 2424870
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
The sign of tax tags sometimes could get inverted explicitly. It typically happened for misc operations, so :
- manual entries
- CABA entries
- writeoffs created from the reconciliation widget
We had to do things this way in stable to fix those use cases, but it's not ideal, as the tags shown to the user were inverted, so it was a bit confusing, as one would have expected to see the exact same tags as on tax configuration.
We fix that by using a boolean field on account.move.line telling whether or not the sign must be inverted. This allows keeping the same tags as in the tax config, and simplifies the computation of the tax report's multiplicator, making the overall model more intuitive for both user and developper.
Task 2363287
closes#62536closesodoo/odoo#64627
Related: odoo/enterprise#15031
Related: odoo/upgrade#1983
X-original-commit: 4e8581b6846ef8ee4601c994b0d586734a4fe117
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
PURPOSE
Lessen use of mail-specific calls and variables
SPECIFICATIONS
Use mail_new_test_user tool in tests, lessening use of mail-specific context
keys in tests.
LINKS
Task ID-2326281 (context keys use cleaning)
PR odoo/odoo#56631
PR odoo/enterprise#12707
X-original-commit: 910559c092dc7dfa00b91339a5423e16cd4668e1
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it:
- doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates...
- doesn't setup a testing user then all tests are done using the superuser.
- doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc...
- is run sometimes at-install.
--task: 2301180
This fix will complete the task 1965890 by allowing the user with
access rights to edit fields (reference, account_id, taxes_ids
& analytic_account_id) depending the sheet state.
Also added Tests to check if access rights on expense lines are
working well depending on the expense.sheet.state and the user group.
Task ID 2226352
closesodoo/odoo#53862
X-original-commit: f42c812916a50438078210c020f6144c7417d365
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....
Several onchanges have been converted to computed fields in the following modules :
Community :
- hr
- hr_contract
- hr_recruitment
- hr_work_entry
- hr_maintenance
- hr_expense
- hr_expense_check
- hr_holidays
- sale_expense
- account_analytic_default_hr_expense
Enterprise:
- hr_contract_salary
- hr_referral
- hr_payroll
- hr_payroll_expense
- test_l10n_be_hr_payroll_account
There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
to "resource_id.tz". Apparently it is useless except to initialize the default
value of "tz".
- an onchange that updates "name" that is defined as a related field to
"resource_id.name".
the applicant.
closesodoo/odoo#45414
Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.
Specification
Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.
Taskid: 2088891
X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826