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
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
1/ Send mail notification if expense is registered successfully
Before this commit, when user submits the expense via email, user is not getting
information about whether expense is registered or not. After this commit user
will get a confirmation email.
Few other usability improvements,
- Improved tooltip for the field 'default_code' in expense's form and in the
'Emails' config setting.
- Added product's default code in product's kanban view
- Filtered uom based on category of product's uom.
2/ Better parsing of expense mail subject
Criteria for matching expense product from email subject is changed,
- The product code should be the first word of the subject.
- Only expense products are allowed, previously there was no filter and user was
able to select any product in expense via mail.
Currency support is added,
- Now user can specify currency symbols and ISO code in expense mail subject.
- If subject contains multiple numbers in that case, number with currency will
get higher priory, and it selected as an amount in expense.
- If multi currency is active, user can use any active currency symbol/ISO code
in mail subject. Respective currency will be selected in registered expense.
- If multi currency is not active, user can only pass company currency. Other
currencies are ignored and expense will be registered as default company currency
- If user pass non active currency in subject then that currency will be ignored
and expense will be registered as default company currency
Examples:
PROD_CODE 2 foo $1205.91 baz
Added python test cases for mail subject parsing.
Related to task #35093closes#22168
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
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)
Setting an expense with a tax included with a negative base code sign was
getting the wrong amount (tax line as a credit instead of debit). So leading to
a total for the accounting entry superior of the total of the expense (should
not happend as the tax is included).
Add test to verify this scenario.
Fixes#4260, opw 618531