Commit Graph
67 Commits
Author SHA1 Message Date
XavierDo 92e9e84b63 [IMP] mail, *: don't track fields at create
*: 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: #1916916

closes odoo/odoo#31945

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-29 15:28:43 +00:00
XavierDo fbafbf2230 [IMP] mail, test_mail, *: add new email.cc.mixin on main models
*: 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
2019-03-28 09:34:11 +00:00
Thibault Delavallée b8197ff178 [REF] various: update tracking parameters
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.
2019-01-04 11:46:14 +00:00
Tejas Shahu 38b1debece [IMP] maintenance: Duration tooltip improvement
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.
2018-12-11 16:04:35 +00:00
Christophe Simonis 9dbb7d199c [MERGE] forward port branch 12.0 up to b81c2bce84 2018-10-22 17:57:08 +02:00
Christophe Simonis b81c2bce84 [MERGE] forward port branch saas-11.4 up to 3c108977c1 2018-10-22 16:59:51 +02:00
TWA e61286ecd4 [IMP] mail: Return a browse record in _track_subtype instead of xmlid
Purpose
=======

It's possible to gain some requests with returning a browse record instead of
an xmlid. It's also cleaner.
2018-10-18 13:07:30 +00:00
Christophe Simonis e9ae419fca [MERGE] forward port branch saas-11.3 up to 0de06a4132 2018-10-17 10:54:19 +02:00
Christophe Simonis 1ade6675c3 [MERGE] forward port branch 11.0 up to 717f458394 2018-10-11 16:29:46 +02:00
Christophe Simonis 717f458394 [MERGE] forward port branch saas-15 up to 93c22558f3 2018-10-11 14:48:49 +02:00
Christophe Simonis 93c22558f3 [MERGE] forward port branch saas-14 up to 77286e4296 2018-10-11 12:15:02 +02:00
Christophe Simonis 77286e4296 [MERGE] forward port branch 10.0 up to c2688e45f3 2018-10-11 10:34:48 +02:00
tutran81 c2688e45f3 [FIX] maintenance: make write override multi-compliant
The write method called self.stage_id which caused singleton error when
self contains more than one record
2018-10-11 10:02:27 +02:00
Nimesh Jethva a308506051 [IMP]hr_*: Improvement in model description
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
2018-09-21 11:45:15 +02:00
Christophe Simonis 86ff929ad6 [MERGE] forward port branch saas-11.4 up to 1199451606 2018-09-10 17:06:18 +02:00
Yannick Tivisse 7978d4ba0f Revert "[IMP] *: Define groups on res.users models"
This reverts commit 99f497b390.
2018-09-10 14:23:42 +02:00
Priyanka Kakadiya 8b355457c4 [IMP] maintenance,hr_maintenance: notify user assigned to a request
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
2018-08-30 15:32:42 +02:00
Akash Bhavsar 2407b4d457 [IMP] maintenance: added effective date field in equipment & tools
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
2018-08-22 10:48:13 +02:00
Prakash Prajapati 1cb0b831ae [IMP] maintenance: improve rescheduling of automated activities
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.
2018-08-10 15:36:05 +02:00
Christophe Simonis 49f634e472 [MERGE] forward port branch saas-11.4 up to 1f7a39964b 2018-07-19 16:36:03 +02:00
Christophe Simonis 1f7a39964b [MERGE] forward port branch saas-11.3 up to 0c42dcfc22 2018-07-19 15:36:54 +02:00
Martin TrigauxandTommy Tran 1969168aff [IMP] maintenance: better label
Closes #25767

Co-authored-by: Tommy Tran <tu.tran@tvtmarine.com>
2018-07-16 10:59:28 +02:00
Akim Juillerat 25d63b97a0 [IMP] maintenance: restrict deletion of equipment if requests exists
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 .
2018-06-13 12:54:48 +02:00
Yannick Tivisse 473c74f636 [IMP] various: Override _(name_)search instead of (name_)search
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.
2018-05-23 11:15:46 +02:00
Yannick Tivisse 99f497b390 [IMP] *: Define groups on res.users models
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
2018-04-26 15:13:38 +02:00
Thibault Delavallée b6d2351df4 [REF] mail: improve implementation of message subscribe
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.
2018-04-03 17:11:43 +02:00
Thibault Delavallée d0e2caee4e [IMP] maintenance: improve activity management on maintenance request model
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;
2018-03-27 16:31:05 +02:00
Christophe Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis 512fd20dfd [IMP] maintenance: allow cross-company usage
Company fields should not be required.
2018-03-16 13:37:59 +01:00
Thibault Delavallée 9581eb9c63 [REM] maintenance: remove dead code about responsible auto subscription
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.
2018-03-14 10:57:28 +01:00
Kinjal Mehta 89c07862d5 [IMP] crm, project,...: Prevent stage deletion when there's a linked record
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.
2018-02-06 08:56:54 +01:00
Christophe Simonis e00a447e2c [MERGE] forward port branch saas-11.1 up to 7e469eb77a 2018-02-01 18:20:28 +01:00
Martin Trigaux ed54418d62 [FIX] maintenance: translate team name
If the name of a crm.team is translated, why not the one of a maintenance.team

opw-805838
2018-01-30 14:42:09 +01:00
Christophe Simonis a98b46b8f5 [MERGE] forward port branch saas-11.1 up to fa1f2132e7 2018-01-22 18:44:05 +01:00
Christophe Simonis 2f95cfb8ed [MERGE] forward port branch saas-16 up to f99c4f2b48 2018-01-19 12:43:58 +01:00
Christophe Simonis f99c4f2b48 [MERGE] forward port branch saas-15 up to 0c54862cbf 2018-01-19 11:30:35 +01:00
Christophe Simonis 3e197bf000 [MERGE] forward port branch saas-14 up to 4887a75e2c 2018-01-18 16:27:43 +01:00
Christophe Simonis 4887a75e2c [MERGE] forward port branch 10.0 up to ea700016dd 2018-01-18 14:30:51 +01:00
Christophe Simonis e72eb4f38d [MERGE] forward port branch 9.0 up to 74b564cf8d 2018-01-17 18:00:05 +01:00
Kinjal Mehta cb34934f3b [IMP] maintenance: On equipment, rename the field Warranty to "Warranty Expiration Date" 2018-01-10 13:53:54 +01:00
Kinjal Mehta a0e7c0d91c [IMP] maintenance: multi company aware
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).
2018-01-10 13:53:53 +01:00
Fabien Pinckaers b341b5ca73 [IMP] Remove duplicate fields names 2018-01-07 19:28:03 +01:00
Kinjal Mehta 33e1105cec [IMP] maintenance: changed duplicate field label in the same model 2018-01-04 17:56:55 +05:30
Kinjal Mehta 22a4ac1b30 [IMP] maintenance: Add archive/unarchive on teams and equipments
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.
2017-12-21 13:54:40 +01:00
Martin Trigaux e1e3b5a56e [IMP] i18n: better terms and labels
add missing string labels
rephrase the error message
add missing _description
removed forward-ported hr_equipment.pot

was unclear, courtesy of the translators
2017-10-30 10:40:01 +01:00
qsm-odoo 09c35696a3 [FIX] *: dashboards automatic colors
* 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.
2017-09-20 12:32:48 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Haresh Shyara 9e9d9e6490 [IMP] maintenance : team form and team members
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.
2017-04-27 17:38:15 +02:00
Haresh Shyara e98f28671f [IMP] maintenance : add unscheduled maintenance
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.
2017-04-27 17:38:15 +02:00
Haresh Shyara 441f934d41 [IMP] maintenance : responsible added as follower
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.
2017-04-27 17:38:14 +02:00