Step to reproduce:
- Duplicate expense with a uom != of Unit
Current behaviour :
- Error telling that the unit is not correctly chosen
Behaviour After PR:
- The uom is copied on duplication and no error
opw-2714136
closesodoo/odoo#81973
X-original-commit: bd4db173284aa45d141cc3736ecef511738dd8e3
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
Simple users lost the ability to read their own paid expenses due to
missing access rights on account.move.
closesodoo/odoo#80646
Taskid: 2698791
X-original-commit: f164967c1eef731e92f41945b9a9fa05099950d9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce the bug:
- Let's consider two companies C1 and C2 where C1 is the parent of C2
- Let's consider an expense product P with T1 as tax in C1 and T2 as tax in C2
- Let's consider an expense alias A defned for C1 and C2
- Let's consider an employee E in C2 with work email address W
- Send from W to A an email with subject [internal reference of P] Test Expense 1000€
Bug:
An expense is created in C2 with T1 and T2 as supplier taxes instead of only T2
Inspired from function _compute_tax_id defined in model sale.order and purchase.order
opw:2507162
closesodoo/odoo#80250
X-original-commit: a3daaf4d3a22e403ca891a1d396380e118020164
Signed-off-by: Laurent Smet <las@openerp.com>
The field `payment_credit_account_id` on `account.journal` has been
removed by 04522f01e6closesodoo/odoo#79203
X-original-commit: a5e5110b9a1cc85e76cb6a29de6e3bef9658d405
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Description of the issue/feature this PR addresses:
When an expense was accepted and then the account move related to the expense was reset to draft/cancelled, the expense's state stayed as payed.
Current behavior before PR:
The expense's state stayed as payed.
Desired behavior after PR is merged:
Change the expense's state to refused with the reason 'Payment Cancelled'.
opw-2559225
closesodoo/odoo#77729
X-original-commit: cfe95a0e3781a23be73541cdae4393b8507cf9c1
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Setting a default value on a readonly related field without an inverse
method is nonsense. We log some warning when it happens.
We also fixed other cases where a related field has a default value
that overrides the target field's value.
closesodoo/odoo#67762
Related: odoo/enterprise#17313
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.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:
- Go to Expenses > Expense Reports to approve
- Select expense reports with different managers
- Click on the Action drop-down button > Approve report
Problem:
Traceback is triggered because we try to access `"self.user_id"` (manager) of expenses as a single element,
While we have several `”user_id”`
Solution:
- Filter the `"hr.expense.sheet"` which must be approved
- Approve each expense separately
opw-2622837
closesodoo/odoo#75212
X-original-commit: e7299b7d0f081fa861d4b25cc76d5b0d5dab4b73
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
Steps to reproduce:
- Install Expenses module
- Go to Expenses (list view)
- Select multiple expense in `To Submit` stage
- Click on Action -> Create report
Issue:
Report is directly in Submitted stage.
Cause:
Submitting report on creation.
Solution:
Do not set 'sumbit' satge on report creation.
opw-2586184
closesodoo/odoo#74615
X-original-commit: 7cb6cfad0dc8254c3668f6d3c5a0be1a85051ab3
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Steps to reproduce the bug:
- Let's consider an expense E paid by the company
- Validate E and post journal entries
Bug:
Two journal entries were created:
1. Outstanding payments (debit) / Account Payable (credit) as draft
2. Expense (debit) / Outstanding payments (credit) as posted
With the this fix:
Only the second entry is created and posted
This reverts commit 25ac51e01a2084afd7a4d5e9c4c87a50ea787b93.
opw:2510663
closesodoo/odoo#73715
X-original-commit: 3add44d462deebb2b7600d0bd2d86a4af8b2ab4e
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce the bug:
- Let's consider an expense E paid by the company
- Validate E and post journal entries
Bug:
Two journal entries were created:
1. Account Payable (debit) / Outstanding payments (credit) as draft
2. Expense (debit) / Outstanding payments (credit) as posted instead of Expense (debit) / Account Payable (credit) as draft
opw:2510663
closesodoo/odoo#71627
X-original-commit: 25ac51e01a2084afd7a4d5e9c4c87a50ea787b93
Signed-off-by: William André (wan) <wan@odoo.com>
Purpose
=======
When you archive an employee, if he's the manager/coach of someone else, the link is not removed.
closesodoo/odoo#71368
Taskid: 2536219
Related: odoo/enterprise#18588
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, when we create an expense that is paid by company,
then create and approve a report, then post entries, 2 entries are
created. 1 is posted and is correct, the other one is in draft due to
the creation of the payment for employee and should not be there.
As when a company pays for an expense, in 99% of the cases,
it's because employees have a credit card funded by the company.
It happens often that company owners have this kind of card or even
employees but that's more common in the US. In such case,
it's just an account payable to visa or mastercard. so no need to
create a payment for the employee.
So this commit, draft entry will not be created when payment paid
by the company while posting the entries from the expense.
closesodoo/odoo#71063
Taskid: 2410551
X-original-commit: 2aedd076317b37ceffba061c48e3d4fc38f02ea9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, When we create expense report from expense it will
directly create a expense report record so discard button on
top is misleading.
So in this commit, when creating the expense report from the expense
it will not create an record but set the default value in editable
form view with auto computed name based on expense.
Also create report action coming to the two places
1) in top action menu
2) on tree header
So in this commit, removed 'create report' menu from top
action bar.
Added the depends on can_reset and can_approve to compute
the value for displaying the button when record is not saved
from the 'create Expense report' button and default in submit state.
also fix the attachment_number field because expense.id is
NewId_X while passing in default_get of expense_line_ids so count was
0 without saving the expense sheet.
closesodoo/odoo#65104
Taskid: 2359834
Related: odoo/upgrade#1875
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce the bug:
When trying to import or create a expense product with supplier taxes,
the supplier taxes were removed.
PS: The field vendor taxes is available in the expense product view
opw:2444551
closesodoo/odoo#65403
X-original-commit: 02d0591b73f5acd8c94e65cda3af1158c3a2254a
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Display notification to give feedback to user.
And reload the view with the params "next".
closesodoo/odoo#67219
Taskid: 2344276
X-original-commit: bd33f283a1fa39815481ca28918c65ac7b48d641
Related: odoo/enterprise#16830
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Display a confirmation dialog when a user creates duplicate expenses.
Two expenses (or more) are considered duplicates when they share the same
date, amount, product, employee, company and currency.
closesodoo/odoo#64190
Taskid: 2368636
Related: odoo/upgrade#2061
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This line was an hack to manage the custom register payment wizard of hr_expense.
Since this wizard is gone and 'payment_id' is a related stored field in account.move.line, we should not write such data explicitely.
closesodoo/odoo#67162
X-original-commit: 2d7f45e76607736bcc4f37bec480967ae2b373d7
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.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>
In a multicompany environment, when a expense is created from the
expense email alias, the expense account is computed with SUPERUSER
context, so depending on the SUPERUSER set company, we could get
a mismatch of expense and employee's company and the account one, wich
causes a subsequent error when trying to post the expense.
closesodoo/odoo#65413
X-original-commit: da758c44b19a9339f0c0b1b6a74c11e3e5491a64
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: simongoffin <sig@odoo.com>
In order to make the expense form more intuitive, it was necessary to distinguish between whether the product has cost different from
zero or not. Depending ot this context, some fields are shown or not. Also 'Bill Reference' is shown only to account managers.
Now the expense can be submitted in different currency and it can be reimbursed in company’s currency.
In case the latter two currencies differ from each other,
the conversion is done automatically and the rate is also displayed.
Suggestion - untaxed_amount can be removed
Task - 2366775
closesodoo/odoo#61920
Related: odoo/enterprise#14838
Related: odoo/upgrade#2028
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently at odoo we use expense product terminology just because it's
set up using product. Inside the expense app, there is no reason of
not using category instead of product
So in this commit, rename the product term into category for all expense
views.
closesodoo/odoo#62661
Taskid: 2391433
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The reconciliation between an expense and a bank statement does not
update the expense and its sheet.
To reproduce the error:
(Need account_accountant)
1. Go to Expenses
2. Create one (e.g. an expense of $20)
3. Save, Create Report, Approve, Post Journal Entries
4. Go to Accounting > Bank
5. Create a bank statement (e.g. $-20)
6. Save, Post, Reconcile
7. Select the expense, Validate
8. Go to Expense > The created expense
=> The expense's state is still 'Approved'. It should be 'Paid'.
Moreover, if you click on the associated report ("View Report"), the
same error appears: the sheet's state is 'Posted' instead of 'Paid'.
The problem was that the method 'action_invoice_paid' (deleted in this
commit) was never reached. Moreover, there was no way to get the
expense's residual amount.
OPW-2389414
closesodoo/odoo#63486
Signed-off-by: adwid <adwid@users.noreply.github.com>
One can leave the currency_id empty and that causes Traceback error
Task - 2409942
closesodoo/odoo#63159
X-original-commit: 7473ad44f960aa3609faafe0cee8e12a392b43a9
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: sofiagvaladze <sofiagvaladze@users.noreply.github.com>
Since commit 80c1dad, the form view of a new record was no longer
editable.
The "editability" of the expense sheet is computed based on the status
but no default value was available.
closesodoo/odoo#63049
Taskid: 2413154
X-original-commit: d0ad00fddf5c3eb05381769a4e75c93e4dcfc388
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
Otherwise, they may crash or be incorrectly verified when
creating/updating recordsets containing multiple records.
Also improve the constraint error messages to be more detailed.
When possible, use a sql constraint instead to speed up the records
validation.
Task Id: 2328664
COM PR: https://github.com/odoo/odoo/pull/55525
ENT PR: https://github.com/odoo/enterprise/pull/12250
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.
In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.
Remove old action fetching from the context in create_move that is no
longer used.
closesodoo/odoo#61602
X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
Before this, misc operations always used the balance of the base line as the tax_base_amount of the tax line. This was inconsistent with the invoices, for which we invert its sign when making a sale invoice or a purchase refund (as for those operations, positive amounts are put in credit). This commit should make everything behave in the same way.
closesodoo/odoo#60912
X-original-commit: 2ca3158ce2de596526067dbd86da2ef7d4ae85bd
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
When a user can edit it's employee, the field expense_manager_id is
editable but any value is ignored, and the previous manager is forced.
closesodoo/odoo#60261
X-original-commit: 41f73fe92139811bc1f43ea07ca4539768001ae5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
If we submit an expense to the manager, a next activity is created for him.
If we reset to draft, it is not cancelled.
So if we resubmit expense, a second next activity is created for the manager.
This commit will cancel created activities when we put the expense in draft
Task id: 2350168
closesodoo/odoo#60107
X-original-commit: 107ac15687befccf59527730cc776d5ad68cac44
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
TLDR: fix a mess in journal fields check
Steps:
* Create expense "paid by Company"
* Click Post
Before:
* AttributeError: 'account.journal' object has no attribute
'default_credit_account_id'
After:
* Either posted or shows user error about journal misconfiguration
Notes:
* Field ``default_credit_account_id`` is replaced in https://github.com/odoo/odoo/commit/41f119d5325dfbbf916d1d34e63946646ed4d44c
* The error is introduced during incorrect forward-port #58852
---
task-2355177
closesodoo/odoo#59780
X-original-commit: 5c0fca662279702115b5e61c8227f82086693e38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
PURPOSE
user with the 'team approver' or the 'all approver' access right levels
cannot approve his own expenses. However, the 'approve' button is still
being displayed, which is confusing and misleading, and an ugly user error
is thrown when the user tries to click on it
SPECIFICATIONS
Hide the 'approve' button on expense reports If the user has either the
'team approver' or 'all approver' access right levels and the employee_id
set on the report is linked to the current user
LINKS
Task-2323982
closesodoo/odoo#56784
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
PURPOSE
Clean code. Be more performance oriented.
SPECIFICATIONS
Improvements applied in this commit
* not all() --> any(not) for earlier returns;
* all([generator]) --> all(generator) to avoid unnecessary list casting.
This code construct is better managed by all;
This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.
LINKS
Task ID-2328619
closesodoo/odoo#56810
X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
The "Incoming Emails" setting is now enabled by default and the email
address shown on the list helper.
closesodoo/odoo#56069
Taskid: 2300864
Related: odoo/enterprise#12494
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
/web/action/load is the public controller that Should be used by the
webclient to fetch actions
_for_xml_id is the default access method on actions that implements
fields filtering to avoid leaking server action code or other
information not needed by the webclient
Implementing whitelist of fields that can be access per model
- Use the one defined in the account module allowing paying multiple journal entries
and group payments together.
- Remove the hr_expense_check module that contains only duplicated features regarding the
register payment wizard.
--task: 2273528