Commit Graph
78 Commits
Author SHA1 Message Date
ram c89e6587a9 [IMP] rating: update stored rating keys
Purpose is to lessen used storage space by shortening rating keys. See related
branches for more details.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
UPG PR odoo/upgrade#2302

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-26 14:10:20 +00:00
ram ddf7195ae3 [IMP] rating, project, im_livechat: improve handling of ratings
RATING

Rating texts currently have a negative skewness. Indeed apart top rating
all ratings have a negative feeling. In this commit we update them
to match more closely a 1-5 range from dissatisfied to satisfied, ok being
the middle value.

PROJECT

Filter customer rating were taking in account ratings from first e-mail
instead of current satisfaction.

IM LIVECHAT

Livechat did not catch feedbacks without comment.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
2021-04-26 14:10:20 +00:00
Thibault Libioulle b1f0e1a42a [REV] project: following a private project no longer required
This reverts commit odoo/odoo@7059b17.

This commit translates tests introduced in this reverted commit to be
aligned with the current workflow.

This commit reverts functionality or business logic linked to the
reverted commit :
- odoo/odoo#47248 : You no longer have to be an allowed user to see the
timesheets but only a message partner.
- odoo/odoo#49021 : We no longer deal with allowed_user_ids or
allowed_portal_user_ids
- odoo/odoo@f2a1a00 : We no longer deal with the allowed users lists.

This commit removes the button project_privacy_visibility for functional
reasons.

Closes: #65367
task-2439329

Related: odoo/upgrade#2128
Related: odoo/enterprise#16067
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-09 12:12:54 +00:00
Thibault Libioulle 8bbf0e9e64 [IMP] project*: improve sub tasks workflow
We want to ease user experience regarding sub task creation and
management. We thus enforce the values of subtask stage, project and
parent task. we want to remove the ability of a user to choose a
third-party subtask project different than the actual one. Also, we want
to remove the ability to make one sub task recurrent. In general, We
want to improve and strengthen the relation parent-childs for Tasks. A
sub task is dependant of its parent all along the workflow.

This commit address those needs and, especially, removes the subtask
project configuration discussed in :
- odoo/odoo@66a0e5a
- odoo/odoo@b709e22

1) With this commit we want to change the way to link a subtask with its
project	for UI reasons, we want to be able to easily distinguish
subtasks that are linked to the project of their parent from subtasks
that are linked to another project. To do so, the idea is to create a
field display_project_id not required. Only relevant tasks are linked
to their project through this display_project_id, the other are linked
to their project only via project_id. As a result, domains in the
application are only based on the fact that tasks have
display_project_id. The other are simply hidden.

2) The number of subtasks is shown on kanban and list views with a
   wigdet to easily render it and extend the UI.

3) The default sub-task assignee is the assignee of the parent task.

4) Task form is modified to integrate those changes.

5) Various searches on project task are restricted with a clause where
display_project_id must be not null. Except in portal, in which context
we always display all tasks and subtasks.

PR community: #62577
PR enterprise: odoo/enterprise#15043
PR upgrade: odoo/upgrade#1984

task-2388034

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-26 13:51:39 +00:00
YOGRAJ TANDELandMohammed Shekha 7da9c296eb [ADD] calendar,lunch,web: weekly recurrent widget
with this commit we adding weekly recurrent widget, currently proeject and
calendar shows boolean for each day vertically but with this widget we displays
week days and its boolean horizontally.

Here widget will display first day as per language's week_start field, also we
adds FieldDependencies on custom widget and consider those FieldDependencies
while processing view node in basic_view.js

We add support of registry to contain owl custom widgets and add support
of rendering owl custom widgets.

Also with this commit we removes fields like sun, mon, tue etc. from view and
instead use "web_weekly_recurrence" custom widget to display boolean for each
week day.

Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-26 12:25:44 +00:00
Odoo's Mergebot c975d128cc [MERGE] project: add task dependencies feature
Purpose
======

Sometimes, a task can only be completed once another is (e.g. 'install boiler' can only be done once 'order boiler' is complete). Communicating this information is key to organize a project and for the users to know on what they can start working when.

## Settings in Project App

- Add a 'Task Dependencies' setting under the 'Tasks Management' section
- Add the same setting on the project form view.
- As for the sub-tasks feature, enabling this feature in the settings of the app, should enable it on all existing and newly created projects with is_fsm = false.

## Task form view

- Add a 'Blocked by' notebook.
- In this notebook:
    - add new many2many field called *depend_on_ids* containing the tasks in which the current task depends on these tasks with the following fields displayed by default: name, user_id, date_deadline, stage_id.
    - add a 'view task' button on each line that should open the corresponding form view.
- Filter task list for depend_on_ids Many2many field.
- Check no cyclic task dependencies.

task-2387984

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#66740

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-26 11:08:10 +01:00
Xavier BOL (xbo) 63777d3c3f [IMP] project: check no cyclic task dependencies
Before this commit, if we have for instance 3 tasks called A, B and C
where A depends on B and B depends on A then we have a cyclic dependency.
Another example with the same tasks, we can have a cyclic dependency if
A depends on B, B depends on C and C depends on A.

This commit checks we have no cyclic dependencies when the user adds a
dependency on a task.

task-2387984

closes #66740
2021-03-12 14:15:36 +01:00
Xavier BOL (xbo) d2dadbcc3b [IMP] project: add task dependencies feature in project.task model
This commit adds two new fields in the project.task model.
The first one called 'allow_task_dependencies' is a related field to the
one project.project model. The other field called 'depend_on_ids' is a
Many2many field will contain the tasks which the current task depend on.

In the form view of project.task model, these fields are added.

task-2387984

closes #66740
2021-03-12 14:15:36 +01:00
Thibault Delavallée 7991118bfe [REF] mail, various: remove support of channels from message_subscribe API
RATIONALE

Channel model is a mail.thread enabled model behaving strangely with followers,
notifications and discuss. Its code should however be simplified to be more
self contained and avoid unwanted side effects on other models.

SPECIFICATIONS

Remove ``channel_ids`` argument and support from ``message_subscribe`` and
``message_unsubscribe`` API. Indeed we do not support adding channel-based
followers anymore. Only partners should be added or removed from followers.
It also allows to simplify API and understanding of both methods.

Various addons are updated to match the simplified (un)subscribe API. Some
enterprise addons may also be impacted.

LINKS

Task ID-2070632 (main task)
Task ID-2419762 (followup task)
COM PR odoo/odoo#62859
ENT PR odoo/enterprise#15172
UPG PR odoo/upgrade#2005
2021-03-17 18:16:11 +00:00
Victor Feyens bc2a8dd04d [FIX] project: fix infinite recurring tasks creation
for repeat_type = 'forever' recurrences.

Consider a recurrence creating a task every 15th day of the month.
When the cron runs, it updates the next recurrence dates of the
recurrence.

But currently, the updated "next_recurrence_date" can be set to an
earlier date than today, if the fixed day of the recurring task is
earlier than the current day.

This means that the recurring task to create every 15th of the month
will be created the 15, the 16, the 17, the 18, ... until the next month
begins (no task will be created when the cron runs before the 15th of a
month).

This commit enforces the next recurrence_date to be set after the
current cron run, to ensure a task isn't wrongly created multiple times.

This commit also includes the tests that led to the discovery of this
bug.

closes odoo/odoo#63989

X-original-commit: e4943afef0f66703bafd78780764ff6f0b039d3e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-01-04 10:19:30 +00:00
Victor Feyens 5fc28342a2 [FIX] project: fix infinite recurring tasks creation
For recurrences of repeat_type = 'after', the daily cron would create
tasks infinitely.

* The cron creates recurring task for all recurrences for which
next_recurrence_date < today.
* next_recurrence_date was never updated.

This commit ensures that next_recurrence_date is set to False for
repeat_type = 'after' recurrences, when the last recurrence is created.

X-original-commit: e7be857bea964628b80d4d3c1314dc231e0da947
2021-01-04 10:19:28 +00:00
Raphael Collet 1398b6b44c [IMP] tests: deprecate SavepointCase
closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-24 13:23:32 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Dominik RuboandKevin Baptiste a93f1e8d9b [IMP] project: enable config-selected features in projects
This change ensures that when the user activates optional features of the
project app, they are enabled in existing projects as well as newly created
projects automatically, which is likely what the user expects.

For most optional features, this behavior was already in place. It was not in
place yet for the sub-tasks and timesheets features, which this change fixes.

Two added tests check the behavior described above for features that are
activated through a `group_*` field on `res.config.settings` (sub-tasks,
recurring tasks and ratings). The tests do not cover features that are
activated through a `module_*` field, as such fields require the installation
of further modules and we cannot simulate this.

Task 2297054

closes odoo/odoo#60106

X-original-commit: 8dd0edae898a532dbe7e4f18c9118b9b68e57900
Related: odoo/enterprise#14119
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Kevin Baptiste <50135801+kba-odoo@users.noreply.github.com>
2020-10-15 14:18:30 +00:00
Kevin Baptiste 1b62bd9508 [IMP] project: add recurring tasks
Some interventions are done on a regular basis (e.g. maintenance of
fire alarms, safety inspections). Having tasks auto-generate would
facilitate the process and would ensure that the next intervention
isn't missed/forgotten.

closes odoo/odoo#55517

Taskid: 2172156
Related: odoo/enterprise#12246
Related: odoo/upgrade#1604
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-12 08:39:32 +00:00
Rémy Baranx (bar) 972e097dbe [IMP] project: convert onchange to stored-editable computed fields.
The 'stage_id' field is now a stored-editable computed field.

The 'company_id' has been converted to a stored-editable computed field.

The modification of the 'partner_id' field in the onchange method has been
moved and merged into the _compute_partner_id method.

Remove the empty 'onchange' method from the project.task model and also remove
this method call from the sale_timesheet module, which inherits from the project.task model.

Adapt the _compute_partner_id to retrieve exactly the behaviour before the onchange
method deletion.

Update code and tests of the task/subtask partner_id management after discussion with Alexandra to clarify the behavior.

Add the 'multi_edit' attribute to tree views.
2020-06-23 08:57:08 +00:00
Benjamin Frantzen (bfr) e4a4ffb974 [IMP] customer ratings flow improvements
- Rename the 'Use Rating on Project' feature into 'Customer Ratings'
- Rename the 'Set Email Template to Stages' link to 'Set a Rating Email Template on Stages'
- Add an optional list view for the Stages menu
- display warning if the rating_template_id field is set and if one of the selected project_ids doesn't have the rating_status field set to true
- Project form view revamp
- rename the '% on tasks' stat button into 'Customer Satisfaction'
- Remove the 'no option' for the rating frequency field because it is required
- project form : Add a 'Go to Website' stat button
- Project dashboard: remove the 'Customer Ratings' menu item in more
- Ratings page: the 'Last 30 days' filter include ratings from today
- remove the Appointment / Helpdesk Customer Satisfaction / Live Support menu items

TASK ID : 1251
2020-05-08 12:17:20 +00:00
Thibault Delavallée d53150dd6f [FIX] project: fix ACLs tests
Currently there are some issues wiht ACLs tests, notably transaction errors
due to new_test_user helper tool. Standard new_test_user tool allows to speedup
user creation in tests. It may cause issues if reset password is involved as
there is a savepoint done. Mail has an improved helper allowing to avoid that.

Also tests were actually not working due to cache being invalid. First fix
allowed to spot it and this is fixed now.

Followup of 7059b177ee .

Closes PR #49485

closes odoo/odoo#49504

X-original-commit: 2c766fa8b66c4e05d373ae550a2d43fa2500616c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-14 10:15:07 +00:00
Lucas Lefèvre 900f0175db [FIX] project: Allow multi company ir rule relaxion
If you want to de-activate the multi company ir.rule, those checks will
still raise an error.

Task 2198433

closes odoo/odoo#47291

X-original-commit: 12a81a3a5265cbd18f5c00ab439cd1486696521b
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-10 13:44:20 +00:00
Kevin BaptisteandYannick Tivisse 2ac06038dd [IMP] project, industry_fsm: Improve subtasks and configuration UX
Purpose
=======

In Project, the configuration has to be done twice: in the settings of the
app and on each project.

During the onboarding, the user won't understand that a feature has to be
enabled at both places and will think that the system just doesn't work.

If the user enabled a feature, he most likely intends on using it for most
of his projects. Therefore, having to do a double configuration for each
new project is annoying.

By the way, sub-tasks is the only global feature (it can't be enabled or
disabled by project), so we are breaking it down by project to remain
consistent with the rest.

Specification
=============

1/ Enable subtasks per project
Before this commit, sub-tasks were a global feature (i.e. once enabled
they were enabled for all projects). This commit gives the ability to
enable/disable sub-tasks per project.

2/ Make project_id on planning required

3/ Change default rating status on new projects

4/ Default value for allow_subtasks

5/ Enable timesheets on existing projects

6/ Hide Total Hours if subtasks are disabled

7/ Create project in the company context.
Otherwise some records generation could use a default company which is not
the company for which we want to create a project.

8/ Default value for allow_forecast, is_fsm

9/ Change reference to timesheet product

10/ Fix tracback on industry_fsm_report.
Before this commit, there was a traceback when enabling "Worksheets"
(industry_fsm_report) after "Time and Material" (industry_fsm_sale).

11/ Convert some onchange method into computed editable stored fields

closes odoo/odoo#41218

Taskid: 2146474
Related: odoo/enterprise#6998
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2020-01-31 15:35:54 +00:00
fw-bot fccaa703c4 [MERGE] project, hr_expense: Fix several multi-company issues + tests
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
2020-01-15 15:11:50 +01:00
Lucas Lefèvre 7059b177ee [IMP] project: Following a private project no longer required
=======
Purpose
=======

Currently for a user to be allowed to see a private project they must follow the
project. This means that they will be added as a follower of all new tasks in the
project which causes them to receive 1000000 notifications, especially if there are a
lot of tasks in a project.

==============
Specifications
==============

1) Add an Employee m2m field on project next to 'Invited Employees'
    - only visible if the 'Invited Employees' option is selected
    - the project should only be visible to employees selected there (regardless if they
      are followers or not)
2) Add an Employee m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Invited Employees' option is selected on the related project
    - should be pre-filled with what is set on the project
    - the task should be visible to employees selected there (regardless if they are
      followers or not)
3) Add a Portal users m2m field on project next to 'Portal users and all employees'
    - only visible if the 'Portal users and all employees' option is selected
    - the project should only be visible to portal users selected there (regardless if
      they are followers or not)
    - rename the option into 'Invited portal users and all employees'
4) Add a Portal users m2m field on tasks below the 'Email cc' one in debug mode
    - only visible if the 'Portal users and all employees' option is selected
    - should be pre-filled with what is set on the project
    - the task should be visible to portal users selected there (regardless if they are
      followers or not)
5) Following a project/task should not grant the user/employee the ability to see the
   project/task

Task 2031527

closes odoo/odoo#40505

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-14 16:26:32 +00:00
ryv-odoo c7a1a2d964 [REF] rating, various: improve rating.rating ACLs
PURPOSE

Rating model should be available only for internal users. External users
access them only through dedicated routes or controllers using sudo and/or
granting access through tokens. Therefore simplifying ACLs should be feasible.

SPECIFICATIONS

Remove access to rating.rating for public and portal users. Only employees
can access it, with full access given to system admins.

Update various functional flows to use sudo() and check that access is
verified before using sudo.

Impacted modules

  * rating / mail: add groups on some rating related fields as only
    internal users should access them now;
  * rating / mail: set some statistics fields using compute_sudo as their
    value should be accessible for external people even without access to
    the underlying rating.rating records;
  * project: makes some use of rating and has to be updated, notably for
    the public rating page;
  * website_{livechat, rating, slides}: add sudo in public routes as access
    is already granted;
  * website_slides: set statistics field using compute_sudo as their
    value should be accessible for external people;

TASK ID 2053096
PR #36592

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 15:46:51 +00:00
Yannick Tivisse bae2d9f717 [IMP] crm, product, ...: Clean some common test classes 2019-11-12 11:34:36 +00:00
Andrea Grazioso (agr-odoo) a128fb5b03 [FIX] project: can delete archived project with tasks
Create a Project with tasks, archive it, delete it.

The project is deleted, but this should not happen:
tasks are present, but they are hidden because when the project is
archived all its tasks are archived too (active flag is set to false).
On project unlinking only active tasks are checked, thus allowing the
deletion. Using a context flag to avoid filtering the non active tasks.

opw-2080515

closes odoo/odoo#38320

X-original-commit: 71a79f26e6319c6987397950c7f9df6c61dfb0d9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-10 06:28:20 +00:00
jem-odoo 0fdee29bb4 [IMP] project: multi company subtasks
This commit makes possible the task delegation in a multi company
environement. A subtask is a normal task with a parent, but can
now be in a different company, to be use as subcontracting task in
another company.
Tests are added to check multi company consistency for the project
app in general and for the subtask cases.

Task-1999686
2019-09-27 11:43:13 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Raphael Collet b7fd679a6c [FIX] *: sudo() -> with_user() 2019-07-04 11:32:22 +00:00
Sébastien Theys df7326f0be [IMP] tests, *: add start_tour helper
Before this commit, the syntax to start a tour was extremely verbose.
With this new method, it is possible to start a tour by just giving the
essential parameter: the tour name.
The full set of features from browser_js are kept by using **kwargs.

closes odoo/odoo#32316

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-04-04 08:44:59 +00:00
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
jem-odoo 52e2ec2ef9 [IMP] project: make project use rating parent mixin
No functionnal changes are done in this commit. Everything
stays the same, but use the parent mixin mecanism.

Task-1903565
2018-12-04 12:48:19 +00:00
jem-odoo 47479401cb [IMP] rating: introduce the parent mixin
When creating a task, the satisfaction of the project is recomputed even
if the task has not rating. This can lead to performance issue:
concurrency error in Postgresql can happen if a task is created when
somebody else tries to update the project.
The satisfaction recomputation will give and concurrency error whereas
it will return the same satisfaction percentage, since the task has no
rating.  The same problem will happens in every modules implementing
the rating feature: project, helpdesk and livechat.

This problem leads us to create the rating.parent.mixin in order to
retrigger the computation only when a new rating appears on the
parent object. We also unstore the field to make its computation lazy.
Maybe in a near future, this field will be computed in SQL directly.
The parent mixin allow us to standardize the behavior to all parent
rating models.
These optimizations should reduce the number of computation and speed
up the task creation.

opw-1902502
Task-1903565
2018-12-04 12:48:13 +00:00
Florent de Labarre 561d22feb7 [IMP] project: cleanup in test mail
Coutersy of @tde-banana-odoo

Closes #25792
2018-07-17 11:47:47 +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 b227f6e759 [REM] project: remove assigned subtype and keep only classic tracking
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.

In project module the task opened subtype was linked to task creation and
task assignation. This subtype is now used only for task creation. It also
fixes a strange behavior. Changing assigned user in an ongoing task was
trigerring the task opened subtype which was strange. This is not the case
anymore.

This commit is related to task ID 60790. Closes #23244 .
2018-03-20 13:55:52 +01:00
RomainLibert 12b580c953 [IMP] rating: Parent document name update
For objects inherting from rating.mixin, when their parent model change
(e.i.: task from a project to another), the "Parent document name" does
not change. The rating is still considered belonging to the old parent
object (rating stat of project is not correct).

Change the rating API. In rating mixin, instead of having 2 methods
returning parent id and parent model (rating_get_parent_id and
rating_get_parent_model_name), we should have one method returning the
'parent relation field' (inevitably m2o field). Then we can deduce its
parent_res_id/parent_res_model, and check this parent field is in values
of write to trigger the recompute of parent_res_name.

Also, add "ondelete=cascade" on parent_res_model_id

Impacted modules: project, rating, helpdesk, livechat
2018-02-23 16:13:03 +01:00
Christophe Simonis 3b959c313d [MERGE] forward port branch saas-11.1 up to a277b58507 2018-02-15 11:52:10 +01:00
Christophe Simonis a277b58507 [MERGE] forward port branch 11.0 up to 259686ba78 2018-02-15 10:58:08 +01:00
Nicolas Martinelli f19e0f8047 [FIX] project: set as favorite
- Connect as a user with only 'User' rights on projects
- Set a project as favorite (click the star)

The project is not set as favorite.

Since only project managers are allowed to write on projects, the field
`is_favorite` is set as read-only. Therefore, it is filtered out by
`_generateChanges`, and nothing happens.

First step is to set the attribute `force_save` in the view, so the RPC
`write` call is forced. Second step is to compute directly the inverse
thus bypassing access rights.

Co-authored-by: Nicolas Lempereur <nle@odoo.com>
opw-814604
opw-801587
closes #22938
2018-02-13 16:07:21 +01:00
Christophe Monniez b356b19033 [IMP] tests: Add the possibility to tag tests
Purpose: When running tests, all the tests for the installed/updated
files are done. This commit adds a 'tagged' decorator that can be used to
tag tests. Combined with a new 'test-tags' CLI option, it adds the ability
to filter which tests are executed. For example, @tagged('slow') will
add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will
only run tests tagged 'slow'.

One can use prefixes to select cases with tags.
'+' or no prefix means that the tests tagged with this tag are selected
for execution. '-' prefix will exclude the tests tagged with this tag.
Exclusion takes precedence over inclusion.

Also, by default, all Odoo tests cases are tagged 'standard' and with
the technical name of the module.
This means that when selecting tests with the 'test-tags'
parameter, if '-standard' is not specified, all tests tags are
going to be executed.
When tagging tests, one can remove such automatic tag by prefixing the
tag name with '-'. E.g. @tagged('-standard') will remove the standard
tag from the test.

Another example, if one wants to test the 'sale' module alone,
even without adding any 'tagged' decorator thos tests can be selected
like that: --test-tags="sale"

Tests are selected or deselected using a TagsSelector. When instanciated,
 a string is passed with comma separated tests selectors like
'+slow,-standard'. When the 'check' method is called  with a test as argument,
it returns True or False if the test has to be executed or not.
2018-01-18 13:20:37 +01:00
Akash Bhavsar 66a0e5a541 [IMP] project: drop project substask constraint
This commit improves subtask mecanism, on several points:
1) Drop the project constraint: before this commit, creating
subtask in non parent project was not possible. Now you can move
subtask to any project.
The default project of a subtask is the one from the parent.
2) When setting a parent task, we want to force some field to have
the same value as its parent, like `partner_id` or the `sale_line_id`.
The idea is here, we work for the same client; a subtask count for the
same goal (SO line or customer). Those fields should be readonly on the
view.
3) Refactor some methods

Task: 38498
2018-01-17 09:34:11 +01:00
Thibault Delavallée 1fbc29a641 [MOV] base: move ir_* models into models/ 2017-11-27 11:15:03 +01:00
Thibault Delavallée 1b2d58daec [REF] project: tests: make tests independent from mail
Purpose is to be able to move mail tests in a separate module without
breaking other tests. It seems dependency is not real, only some data
to add. It is better to have self contained tests anyway.
2017-11-21 15:00:21 +01:00
Jérome Maes 424c16f115 [MOV] website_project,project: move all features
Making project depending on portal, makes website_project
useless. So move all feature from one module to the other.
2017-08-16 14:56:41 +02:00
Yannick Tivisse 642e6a5314 [IMP] project: Remove default author when going through the mail gateway 2017-08-07 12:15:38 +02:00
Aline Preillon 2950ffaa86 [IMP] mail: improve notification management, either email either inbox
Currently partners have a boolean field to choose whether to receive
notifications only in their Odoo inbox or to receive them in their inbox
and by email. This leads to several issues :

 * if a customer is configured to not receive emails he will not receive
   any notification on sales orders, leads, ... This is not clearly
   indicated to the salesman and it is not easy to know how to change
   that behavior
 * if an user chooses to receive emails and does not use its inbox a lot
   of notifications stay in Odoo. The user has to manually set them as
   done to make them disappear which is redundant.

This commit changes that behavior. From now on customers will always
receive all notifications by email. Indeed Odoo is not a customer oriented
mailbox. Moreover sales orders or discussions on leads send to customers
should always be sent by email as it is the standard communication
mechanism. Users will be able to choose to receive notifications in Odoo
or by email. The choice is no longer inbox or inbox + email, but inbox
or email. Choosing one option or the other one depends on the way the
user wants to work.

Technically the field is moved on the users model and selection keys
are renamed. Notification process is modified

 * notified_partner_ids contains as before specified recipients as well
   as followers matching the subtype
 * customers and users working with emails are notified. During that
   process customers notifications are marked as done to be able to
   track the email state without having needaction. Users notifications
   are currently deleted as we do not track their email state.

The removal of partner field implies changes in various addons that
define partner data with this field set in the values.
2017-02-21 16:42:11 +01:00
Raphael Collet 0783318f97 [FIX] adapt logger names 2016-09-02 17:28:13 +02:00
Thibault Delavallée 029d1baf35 [REF] mail: remove required alias on users
This commit remove required alias on res.users model. It also removes the
inheritance of mail.alias.mixin. The field alias_id is kept and allow people
to use aliases on users if they want. However there is no default void alias
created for each user anymore.

Default from of mail.message does not use user alias anymore. Indeed this
creates issues with aliases not being correctly configured and can be
confusing compared to private channels. Using user aliases is therefore
now done manually instead of being a default behavior.
2016-09-01 13:19:24 +02:00
qsm-odoo f9a84b5ebc [IMP] web_tour, *: allow to properly extend tours
* crm, project, website, website_event, website_blog, website_forum,
website_sale

Eg: the tour 'shop_buy_product' is extended by the website_sale_options
addons to add a step to close a modal.

The current solution was requiring the module that defines the tour
to extend, then add/remove steps in the "step" key of the tour
definition.
Some of the problems with this method were:
* The "register" method calls the "update" method to immediately
search for tip to place once registered (as register may be called
after the DOM is ready). So extensions of tours were happening after
the tours were started (and the tours were not restarted).
* The addition/removal of steps was happening after they were filtered
according to the "edition" key.

To allow extension, the system is changed as follow:
* The "register" method now only saves the steps and options without
modifying them and does not call the "update" method.
* Once the DOM was ready, the tour service started listening to DOM
mutations and called the "update" tour method. Now, this "update" call
is replaced by a "_register_all" call, on DOM ready and at the end of
the current call stack (which makes sure all modules are loaded). This
"_register_all" method marks the registered tours as ready after having
filtered the steps according to the "edition" key and initialized the
current step to trigger.
* Also, tours can now define a "wait_for" option which allow them to
be marked as ready for run and update after the given deferred. Those
tours can now also be extended without having to wait for the deferred.
PhamtomJS must wait for the "ready" key to be true to run the tour.
2016-08-26 13:39:55 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00