Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.
Before this commit, a project user could not access the Activity Type
menu.
Convert it to a selection field with the selection values being
computed in sudo.
closesodoo/odoo#74981
Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
PURPOSE
Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.
SPECIFICATIONS
* move those templates in their own file to ease their discovering and
maintenance;
* put them into data (as those are not views even if it contains qweb)
* guidelines are now :
-> Qweb templates should be in data/mail_templates.xml;
-> mail.template records should be in data/mail_template_data.xml;
* put their declaration in no update when not done if template has no
technical code or complex dependency on underlying code;
* move found mail data (mail.message.subtype or mail.activity.type) records
in a mail_data file that should contain only "core" records linked to mail;
LINKS
Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
This field is a non-sense. By using the same logic, it should be added
to any low level model.
Replace the check by a simple verification of presence of an XMLID.
A more generic opt-in solution should be integrated into ORM.
Partially revert commits 0db0e66e96 and
bbd64c22ab.
See #29257odoo/enterprise#3550closesodoo/odoo#31778
Signed-off-by: Christophe Simonis <chs@odoo.com>
Purpose of this merge is to update main addons and set activity types used
for automated activities as master data. This means they cannot be removed.
Indeed those activity types are used in business flow to generate activities
and removing them may break some flows.
This commit is linked to task ID 1907970 and PR #29257.
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>
This commit improves expense flow management through a better integration
of activities and addition of automated activities. Several things are done
in this commit :
* expense sheet (report) model do not inherit from mail.activity.mixin.
This commit adds the inherit so that expense users and managers can now
schedule and manage activities on expense reports. This will help them
in their daily job;
* automatic activities generation is added for expense reports. Activities
are generated for approval. They are also automatically set as done when
validating or unlinked when refusing or resetting to avoid bloating users
with unnecessary activities;
* a menu to configure activity types is added. Indeed HR managers should be
able to see and configure activity types related to their job;
* filters are added to be able to use the systray and to filter the kanban
view based on activities
Having automated activities allow to replace some messages and tracking
that were implemented to warn people of expense reports to approve.
This commit therefore
* simplifies the tracking as tracking to confirm reports is not necessary
anymore;
* removes to approve subtype on report model as well as its parent subtype
on the department. This allows to simplify chatter in hr_expense app;
Since e9734f4975 assignation is now a notification sent in the
inbox or by email to the newly-assigned responsible. It is therefore
considered as not necessary to link a subtype to the assignation itself.
Indeed having it logged in the discussion history as a classic tracking
in addition to the notification is considered as sufficient.
This commit is related to task ID 60790. Closes#23244 .
It is simpler to have data split by main model or application like we
already do for models and views. It allows to easily have an overview
of data a module holds.
As we will work on mail related data like adding activities or tweaking
subtypes and templates, having them all in a single file and not lost
between other data helps finding and working with it.
This commit only moves code. No functional change should occur.