When an employee submits an expense, no mail is sent to the manager.
This should be the case, since it works this way on holidays.
The trick, however, is that the expense is created as submitted, but the
followers are only added afterwards. We need to make sure to add the
followers at creation.
opw-751085
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:
- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
translated
The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).
Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).
This commit correct all the external ids tagged as from base or other incorrect
modules.
Review the subtypes
===================
- Add a subtype for the paid expenses
- Correct subtypes wording
Prevent expense report for several employees
============================================
- Can add lines from every employee, leading to account issues (payable / receivable)
Raise an error if you try to report several expenses for different employees
Don't track onchanges on journal_id
===================================
- Expense Sheet, click on Post Journal Entries: you have 2 produced messages, and
one is strange (Journal Entry: * 1 ?)
Remove useless message on chatter
=================================
- Remove the message to say that the expense report has been validated by ...
It's redundant as the visibility tracker already logs this change
Remove unused method
====================
- 'refuse_expense_sheets' is declared but never used
Log a link to the payment on chatter
====================================
Expense Sheet, click on Register Payment: you have a message containing the
payment name (SUPP.OUT/2016/0001). Add a link to the form view.
Expense duplication
===================
Do not copy 'sheet_id' on duplication. It's wrong and has as secondary effect
to duplicate the state too.
Expense Report tree view
========================
Display correctly the widget monetary
New feature in mail module
==========================
Currently, an email can be sent to an alias from:
- Everyone
- Authenticated Partners
- Followers
This commit is intended to add another category: Employees
The main purpose of this new feature is to allow employees to send an email
to an 'expense' alias in order to create automatically their expenses with
their mobile phones.
Use this new mechanism in hr_expense
====================================
Currenlty, we're overriding message_new to make a security check and create
an expense if the sender is an employee or bounce otherwise, which is not the
correct way to achieve this. A better way is to use the alias mechanism now
that it has been extended to employees too.
Don't hardcode email_from
=========================
The email_from of the bounce email is hardcoded to "help@odoo.com". I am sure
they will be happy to receive all answers from any odoo instance
Review the bounce email content
===============================
content: Your expense has not been created because your email address is not set
on an employee or on a employee's user. Configure your employee's information correctly and try again.
-> this is a message for the admin, not an employee or anyone else
Now the content is generical for aliase defined for employees.
addendum to commit da6b9d1be443999028f021ff81b4cf128a4eaaa2
- better employee name and image for default employee in data (xml-id: hr.employee_root)
- in demo data hr.employee_fp renamed to hr.employee_root to not have 2 employees linked to the root user
- renamed all occurences of employee_fp to employee_root
[IMP] improved planner content
[IMP] Misc usability improvement:
cost instead of sale price on product form
improved views and terminologies
journal entry is RO
1/ Modify the no content help message for hr_expense with a dynamic part
which describe how to create a new expense by mail
2/ Mail gateway mechanism. New customizable email alias expense@domain
that creates a new expense by sending an email to it. Check several things
- Check that the email_from is the same than one of the employees or than
on of the related users to employees. If not, send back an email to say that
the expense will not be created.
- If the email address is valid, check if something is between brackets '[]'
If it is the case, check if it is linked to a product internal reference
and set it accordingly. If nothing is found, use a default product
'Fixed Cost'
- If one/several float(s) are found in the mail subject, take the last
occurence and set it as the expense total amount.
3/ If a product template is created, to not add taxes on it. We don't expect it
to have additional taxes
4/ Under Expenses -> Configuration -> Expense Product, use a simplified product
view with only the needed fields.
5/ When generating the account move lines, use the account defined on the expense
line, not the sheet
6/ When creating a payment, make a reconciliation on the payable account move lines
That way, if the total amount on the expense is paid, the expense will be set to
paid automatically when registering a payment
7/ Add a one-page planner to explain how to use the email alias
8/ The field account_id on the expense sheet was informative. After some tests, it
seems that it's more confusing than helping. So we removed it
9/ Add a domain on the field 'bank_journal_id' to select journals of
type 'cash' or 'bank'
10/ If the number of expense lines is equal to 1, the expense summary on the expense
sheet should be the same name the line. So the process can be done in one click
NB:
- The option no_delete is not working, a fix will come from chm
- The many2many widget on a sheet creation is not working correctly as
the called command is a (1, id, values) without a (4, id, _) before.
A fix will also come from chm, but a disgusting hack has been
provided for this particular case (to remove after chm fix)
The test does not have hardcoded values referring to demo data anymore.
Moreover, in the test, we now use values which are different from the
demo data (621.54 instead of 700). Overall, this will make the test more
robust.
hr_expense: change car travel sale price
Car Travel Expense is used as a product invoiced at sale price.
Therefore, it is more useful to have a cost price and a sale price which
are different.
The whole idea of this commit is to avoid having the same values
everywhere.