*: project, crm, maintenance, helpdesk,
It is useless to track fields during create since they
have no initial value and future tracking message will
show changes on tracked field.
We can log a default creation message instead
(as it is now if there is no mail_create_nolog context key)
This change will implies
- less queries when creating record
- cleaner creation messages
- less occurence of mail_create_nolog ctx key
Removing tracking at create could break the creation subtypes
mechanism (example: following task creation subtype on project)
Instead of using _track_subtype to give a subtype at create,
a new _creation_subtype method can be override. If a creation
subtype is set on a specific modlel, creation messages will be
create by message_post instead of _message_log.
We also need to adapt the message_track_post_template in order to
keep this feature whithout tracking.
Task: #1916916closesodoo/odoo#31945
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: crm, project, maintenance, hr_recruitment
When a record is created from an email, cc can be lost. This commit
proposes a new mixin to keep cc on the record and allows to create
partner for each of them when sending a message from the chatter.
The mixin is added on the mail recors that can be created from mail.alias:
document
helpdesk.ticket
mrp.eco
quality.alert
hr.applicant
crm.lead
project.task
mail.channel
maintenance.equipment
Task: 1925001
Purpose is to clean the use of tracking parameters on fields. Parameters are
merged and is now tracking=<int> or tracking=True.
This commit is linked to task ID 1903814 and PR #28430.
The view on maintenance show the duration with the hours as
UoM. However the tooltip explains that the duration is set
as minutes and second. This commit modify the tooltip in
order to be coherent with the view.
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.
Related Task ID : 37311
When a user is assigned as responsible of request, we want him to get a
mail saying that he's a assigned to this request, a standard behaviour
exists in Odoo to perform such a thing, which consist of having a field
named 'user_id' which is tracked, so to avoid overriding the method, we
renamed the field 'technician_user_id' in 'user_id'.
Wre also set teh mail subtype 'request create' with default false, to
have the same behaviour as the on in project, meaning that it is true
only if you have the parent subtype set to true.
TASK-ID: 58645
Add effective date on maintenance equipement. The purpose is to define
when the equipment is put into service.
Adapt next preventive maintenance according to effective date
Task id: 33188
Purpose of this commit is to improve automated activities in maintenance.
Currently they are not always updated or rescheduled. Specifically when
updating equipment, technician user of schedule date automated activities
should be updated accordingly.
This commit is linked to task ID 1838956 and PR #25899.
Loosing data about existing requests is not good idea when managing
maintenance. It is better to ensure there are no ongoing requests
and prevent deletion if it is the case.
Closes#18794 .
Purpose
=======
The method _name_search and _search add support to search as another user.
All the overrides of name_search and search redefine the behavior of the search.
This bring inconsistencies as the result of a call to _name_search and name_search
could differ on certain modules, which is not acceptable.
Specification
=============
Example:
~~~~~~~~
If the name_search method is overridden to search also on the driver name,
then calling name_search with a label 'JF' will return all the cars with a name containing
'JF' or all the cars with a driver name containing 'JF'. Let's say that we have a ir.rule
preventing a user to read the cars of another company. Then the call to name search only returns
the cars satisfying the previous condition AND belonging to his company.
Now, we want to overpass this constraint. We call _name_search with the attribute name_get_uid=1.
Then the call to _name_search returns all the cars from all the companies with a name like 'JF',
but nothing is done about the driver_name.
Example of wrong search redefinition on a model
-----------------------------------------------
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
domain = args or []
domain = expression.AND([domain, [('name', 'ilike', name)]])
partners = self.env['res.partner'].search([('name', operator, name)])
if partners and name:
domain = expression.OR([domain, ['|', ('driver_id', 'in', partners.ids), ('driver_id', '=', False)]])
rec = self.search(domain, limit=limit)
return rec.name_get()
Example of correct search redefinition on a model
-------------------------------------------------
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
domain = args or []
domain = expression.AND([domain, [('name', operator, name)]])
partner_ids = self.env['res.partner']._search([('name', operator, name)], access_rights_uid=name_get_uid)
if partner_ids:
domain = expression.OR([domain, ['|', ('driver_id', 'in', partner_ids), ('driver_id', '=', False)]])
rec = self._search(domain, limit=limit, access_rights_uid=name_get_uid)
return self.browse(rec).name_get()
The same logic should be applied on the overrides of the search method.
The reified view on the res users will be dropped in the following commit.
The previous commit adds support to define each group as a computed field on the res users.
This commit defines:
- A boolean field for each 'isolated' res.group, i.e. a group in the hidden category.
- A selection field for each 'Application' res.group, i.e. a group in a application category.
Example:
- The group to manage pricelist in sales becomes a boolean field
- The groups project user/manager become a selection field
This commit refactors mail.thread message_subscribe method. It is done for two
purposes. First one is to optimize performance by using the new followers
computation methods introduced recently. Second purpose is to clean the API
of message_subscribe to make it simpler to use.
This commit splits message_subscribe in two main parts :
* _message_subscribe is a private method calling the follower new
subscription methods and updating the record set;
* message_subscribe is a public wrapper on _message_subscribe that adds
access rights checks;
Simplification comes by removing message_subscribe_users that was a
shortcut to message_subscribe. Having a method to subscribe partners and
channels is sufficient as we would like to avoid bloating the public API
of mail.thread. A force parameter is also removed from message_subscribe
as this implementation detail can be induced in the computation.
Various addons using the removed methods are updated in order to use the new
subscription API. They have the same functional behavior.
This commit has a great impact when subscribing several followers. In a more
general way all code using message_post is also optimized as posting a message
generally implies subscribing followers. It also improves activity use as
posting a message and subscribing new followers are common process in
activities.
This commit improves maintenance requests management through a better
integration of activities and addition of automated activities. Several
things are done in this commit :
* automatic activities generation is added for maintenance requests.
Activities are generated to remind assigned users about maintenance to
perform. They are also automatically removed or updated if the scheduled
date is changed or if the request is done to avoid bloating users with
unnecessary activities;
* a menu to configure activity types is added. Indeed equipment managers
should be able to see and configure activity types related to their job;
An override related to mail.thread auto subscription has been added in
maintenance application at 23a2bac3fa in 9.0. Since that version
however the field has been renamed to avoid confusion with user_id that is
generally a responsible with access rights to handle the document.
This code is therefore not necessary anymore and can be safely removed
without impacting any functional flow.
Purpose
=======
Avoid having people getting some tasks lost in the "undefined" column. Because they won't understand what it means an how they achieve it.
Specification
=============
Add an "ondelete='restrict'" on the stage field definition.
Add a company field on the maintenance equipment, equipment categories, maintenance request
and maintenance team (maintenance users from a company do not see equipments, categories
and requests from another company and Equipment Manager can create the maintenance teams).
Purpose
=======
Right now user not able to archive maintenance equipments and maintenance teams which are no longer in use.
Specification
=============
Add archive button in form view of Equipments and teams. Also add filter on list view.
Don't put a specific team by default on equipment, select the first unarchived one instead.
add missing string labels
rephrase the error message
add missing _description
removed forward-ported hr_equipment.pot
was unclear, courtesy of the translators
* account, hr, hr_recruitment, maintenance, mrp, sales_team, stock
Adaptation of https://github.com/odoo/odoo/commit/a79d83e436e5e965d59663d4a06a0f8a62d8f694 for saas-18 new colors.
Also change back all color defaults to 0 instead of 1 (see
mentioned commit: they were changed from 0 to 1 as in saas-16
the color was applied to kanban headers which had to be gray
(the old color 1) by default).
Also add default violet color for 'Customer Invoices' and 'Vendor Bills'
dashboards.
This commit changes the maintenance team:
-In the form view -> replace Category name by Team name
-Replace the partner by a many2many with users
-Display the from view instead of editable list view of teams
In the model, the partner field is replaced by member_ids.
However this field is never used except in the form view.
The feature added is a count of todo request that has no schedule date.
It will also add a link in the team dashboard that redirect to all
mainenance requests without a scheduled date.
The count is computed in the existing function '_compute_todo_requests'.
It will count requests that are not done and have no scheduled date.
This commit also modify the view and add the default filter 'unscheduled'
(created by a previous commit) for the action
'hr_equipment_todo_request_action_from_dashboard' which opens the maintenance
request for the active team.
This commit add the following feature :
Add the responsible and the owner of the maintenance request as
follower.
This commit creates a new method that adds as follower the responsible and/or
the owner. This method is triggered in the create and in the write if they
are modified.
It will not remove old responsible or owner from the chatter.