Commit Graph
222 Commits
Author SHA1 Message Date
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
Christophe Simonis 998723b909 [MERGE] forward port branch saas-11.3 up to e980af9df0 2018-10-01 11:27:51 +02:00
Christophe Simonis 5f08d82bcd [MERGE] forward port branch 11.0 up to fd122aec52 2018-09-26 19:37:29 +02:00
Martin Trigaux c3270c4998 [FIX] project: default value should be translatable 2018-09-24 16:26:38 +02:00
Martin Trigaux 6ce2354d68 [I18N] project: make label_tasks translatable 2018-09-24 15:45:55 +02:00
Nicolas Martinelli d5c16cdadf [FIX] project: copy project
- Create a project
- Create some tasks with followers
- Create an outgoing mail server with active = False
- Copy that project

When copied, the project tries to send emails to followers using the
inactive mail server. This leads to a traceback.

The addition of the context key dates back to 2009 with 853789d0aa.
The purpose was to copy all tasks, including the archived ones.

We keep this behavior, but without propagating the `active_test` during
the copy of the tasks.

opw-1887354

closes odoo/odoo#27192
2018-09-24 13:22:42 +00:00
Nimesh Jethva 7046479365 [IMP]project_*: 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 a12c4d284c [MERGE] forward port branch saas-11.4 up to a1b384d66b 2018-09-18 11:42:52 +02:00
Christophe Simonis a1b384d66b [MERGE] forward port branch saas-11.3 up to 2de573440e 2018-09-17 19:40:47 +02:00
Christophe Simonis 0942a57b5a [MERGE] forward port branch 11.0 up to f2b8caff07 2018-09-17 18:03:41 +02:00
Christophe Simonis 9c77066f34 [MERGE] forward port branch saas-11.4 up to 6c103589c1 2018-09-14 16:00:17 +02:00
Christophe Simonis 6c103589c1 [MERGE] forward port branch saas-11.3 up to ea0b3d600d 2018-09-14 14:56:51 +02:00
Martin Trigaux a47f7ee0e4 [FIX] product: do not translate at code import
Defined as this, the label of the selection field were translated during code
import, when building the python model, not when a user access the field values
as it should (and is already the case thanks to the ORM).

Trying to translate a string when no user-context is available is not only
useless but may cause bug on services with multiple databases (e.g. a SaaS).

In a multi-worker environment, when the code is imported, the _ method will use
multiple scenarios to detect the language and get a cursor.

As we have no available cursor in the frame (method _get_cr from GettextAlias),
the fallback is made on the cursor of the request.
In a multi-worker environment, this could be a cursor linked to a database in
another language than English.
In such scenario, the selections would be translated in the language of the
other database instead of displaying it in English

opw-1881956
2018-09-14 11:20:38 +02:00
len-odoo c8441a69c2 [FIX] project: remove group_by from the context
The group_by was passed from context from the action spawning a new view.
This meant that it could give a group_by a field that was not defined on the
destination view, causing a js traceback.

opw 1884035
2018-09-14 08:34:42 +02:00
jem-odoo 6a2b4827d4 [FIX] sale_timesheet: duplicate project remove tasks SOL
When duplicating a task, we want the copy to have
the same sale order line then the original.
However, we duplicating a project, the tasks are
copied too. But, in that case, we don't want them
to be linked to any sale line, as the copy project
will not be.

This commit fixes that use case, and provides a test.

Task #1883640
2018-09-13 11:44:13 +02:00
Raphael Collet fa6774b899 [FIX] models: make log_access fields readonly, and remove useless definitions 2018-09-11 17:25:07 +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
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
Christophe Simonis 49c3264ce0 [MERGE] forward port branch saas-11.3 up to 4850fb0838 2018-09-07 14:43:48 +02:00
Toufik Benjaa ec324fdd04 [FIX] project: allow portal customers to post on task chatter 2018-09-06 15:57:27 +02:00
Christophe Simonis f19e6ce561 [MERGE] forward port branch 11.0 up to 213759b03e 2018-09-05 18:52:27 +02:00
Moises Lopez e68350fcb5 [FIX] project: iterate on a single task
Do not retrieve the attachment of all records
Performance impromevement when iterating on a large number of records

From #26446
2018-08-30 13:33:52 +02:00
Christophe Simonis 31679cd81b [FIX] project: correct syntax
Oversight of previous forward-port
2018-08-22 13:19:36 +02:00
Christophe Simonis 4f62d6dd8f [MERGE] forward port branch saas-11.4 up to ef6b574eda 2018-08-22 12:02:30 +02:00
Christophe Simonis ef6b574eda [MERGE] forward port branch saas-11.3 up to 6cc7d3f945 2018-08-21 18:48:13 +02:00
Toufik Benjaa a05ae78abd [FIX] mail & project: Display access button on mail notifications
This commit fixes two issues:

	- If a partner has multiple users and if any of these users is a
          share user, then the access button on mail notifications is not displayed.

	- If a project.task is either assigned or has its stage folded
	  the access button may not be displayed for certain users.
	  The users affected by this bug are the one who have their user's
	  partner is linked to multiple users with at least one flagged as a share user.
2018-08-21 11:58:50 +02:00
jem-odoo 3e1207c4ac [IMP] project: task log settings 2018-08-13 17:32:22 +02:00
jem-odoo 12430b59f3 [FIX] project,sale_timesheet: default partner on billed task 2018-08-13 17:32:22 +02:00
jem-odoo 772bebede5 [MOV] project,hr_timesheet: move project_time_mode_id field
'project_time_mode_id' is the field used to determined the UoM to
use when logging timesheets. It is not used in project alone, but
in timesheet. Moving it make sense, and does not cause any problems.
For now, no UI allow the end user to change it: it is set with the
Hours UoM (hardcoded).
This is a technical move to prepare the feature that will allow
people timesheeting in Days or Hours.

Task #39079
2018-08-13 14:33:48 +02:00
Thibault Delavallée 689a496f1c [REF] mail: propagate recipient data through notification process
Purpose of this commit is to avoid browsing and prefetching data about
recipients when notifying a message to partners and channels. Mail message
_notify computes all necessary data in a single query. This commit allow
to re-use this data by propagating it through the call chain.

Addons inheriting from classification methods used when sending notification
emails are updated accordingly to the API and data update.

This commit is linked to task ID 47934 and PR #24033. No functional change
should occur with this commit.
2018-08-07 15:43:06 +02:00
Mitali Patel 84f528bcff [IMP] Portal - Share link : Easily share the url of a document
Purpose
=======
- Quickly share the url to someone else (a client, a colleague,...)
- Ensure that the recipient can access at least
  the portal view of the shared record.
- Typically used when a client cannot retrieve the mail to access his order.
  The share link can be used in this case.

Specifications
==============
For any object inheriting form portal.mixin:
    - Add a button SHARE (not visible in edit mode)
    - When clicking on this button, a popup opens with :
        - A warning message for tasks and projects only (see below)
        - the link (like in gmail) that can be copied
        - Recipients
        - mail composer (with preselected template) ==> see below
        - button [Send Link] [Copy Link] Discard
        - After sharing document, put internal note like
          "Document shared to xyz,...." with template message
    - Anyone with the link, even anonymous user (not logged in) can have access
      to the document with the access token provided in the url.

Impacted models:
    - account.invoice (Community)
    - project.project (Community)
    - project.task (Community)
    - purchase.order (Community)
    - sale.order (Community)
    - helpdesk.ticket (Enterprise)

Warning messages and access rules:
    Allowed :
        - SO canceled or draft will be accessible with the link
          with access_token
        - If the customer account is B2B (signup not enabled), the recipient
          will anyway see the document as the user specifically wants the
          recipient to see the document.
    Restrictions :
        - For Project and Task, if the privacy is not public, then, there is a
          contradiction between the access_token mechanism
          and the privacy of the document.
        - A warning message will be displayed in the share wizard to inform the
          user if the document cannot be visible by the recipients and to
          ask him to set the privacy to 'Visible by following customer'.
          The send button will, in that case, be hidden.
        - To avoid to block the share for a new project, default privacy value
          is now set to 'Visible by followong customer'

Technical implementation
========================
- Move the access_token mechanism (field + methods + mail controller)
  to the portal.mixin to be able to use it in a generic way for each object
  inheriting the portal.mixin
- Generalise a part of the _*model*_get_page_view_values method
  into a single one in portal
- Generalize the _*model*_check_access into the portal controller of the
  portal module
- Remove the init_column + default value for the access_token
  > old records have an access_token,
  > new one won't but it will be generated on demand via the get_access_token
  Done for performance reasons
- Add share button into action menu separately. + kanban view context menu
  (except for task and project where button not in action menu but 'simple'
  button for task and project because other modules already provide action
  to send documents by email, which is not the case for project and task.)
- Add a sign_token used to authentify the recipient in the portal view chatter,
  if any. The message will be posted as if the user was logged in.
- Set the _get_share_url as private for security reason
- Add a redirect parameter to _get_share_url to get
    If false : The direct portal view url
    If True : The redirect url (mail/view/?)
- Cleaning up unnecessary code

- Bug fix :
    - Before, if user was not logged and record had partner_id,
      if partner id was null, post message was done as admin.
      Now, the post message is done as public user.
    - If the user had an uid but had no access_token, he could be able
      to gain the access token of the record.
      check_access_rights was missing in the get_access_action.

Task ID : 30985
Closes #25629
2018-08-03 15:20:42 +02:00
Mitali Patel 870b05f693 [IMP] project: implement digest KPIs / tips
Purpose of commit is to implement KPIs about opened tasks for project
digest emails. Opened tasks are nor archived nor in a final stage. Those
are added in the default digest template.

A tip is added to remind to use the mail gateway.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:47 +02:00
XavierDo c8d283a592 [FIX]: mail: storing add_sign on mail message
Only the add_sign from notif_values is usefull for a resend. We can consider
that a mail on resend can be delete in every case, and we can find the
model_description from model since a resend can only be performed on
message linked to a model.

The other notif_values are now parameter in order to ease the understanding
of what can transit through this flow.

Task: #1860054
PR: #25622
2018-07-11 12:25:33 +02:00
Christophe Simonis c8bb02141d [MERGE] forward port branch saas-11.3 up to 3cdcbce93c 2018-06-28 19:01:52 +02:00
Christophe Simonis 40836194c2 [MERGE] forward port branch saas-11.2 up to 12ddec3a76 2018-06-27 13:41:00 +02:00
Christophe Simonis 12ddec3a76 [MERGE] forward port branch 11.0 up to 152519cd65 2018-06-27 11:37:52 +02:00
Nicolas Lempereur 8188e6c802 [FIX] project: default on email as suggested recipient
With 82ca3d3f in 11.0 it was possible to have an email address on a
task, without specifying a partner.

Because of a small issue, this address was not suggested as a possible
recipients like it was in a project.issue object.

opw-1858170
closes #25427
2018-06-25 12:30:45 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis 50860317cc [MERGE] forward port branch saas-11.2 up to b170a753e1 2018-06-15 11:30:27 +02:00
Christophe Simonis af1853775f [MERGE] forward port branch 11.0 up to e3658d6f56 2018-06-12 16:49:11 +02:00
Christophe Simonis e3658d6f56 [MERGE] forward port branch saas-15 up to d44cd77884 2018-06-12 16:31:54 +02:00
Pratima Gupta 9eb89131f3 [REF] rating, project: sending request is now a classic message post
This allows to better control the posting process, notably using custom
layout to encapsulate emails. Previously to this commit a simple email was
send using a template. Now this template is used to post a message on the
record asking for customer request.

New parameters are added on the request send method

 * a subtype, allowing some custom behavior with followers; by default the
   behavior is to log a note with the customer being in the recipients list;
 * composition_mode can be given and propagated to message_post_with_template
   allowing a comment or mass mailing mode;

This commit is related to task 51122 (and PR #24052).
2018-06-08 15:20:04 +02:00
Raphael Collet 975c6c8639 [REF] resource calendar (#24717)
Refactor resource calendar and resource mixin:
 - add a required timezone field on models 'resource.calendar' and 'resource.resource';
 - resource calendar attendances are now computed in the timezone of the resource
   or the calendar;
 - improve API of 'resource.calendar' and 'resource.mixin';
 - avoid other modules from using the implementation methods of 'resource.calendar';
 - refactor implementation of 'resource.calendar' to make it more efficient.
2018-05-31 20:28:12 +02:00
Hiral Bhavsar 9cabc3170e [REF] project: remove settings to (un)install timesheet
Purpose is to limit the uninstallation of modules without being clearly
notified of it. In project ticking timesheet may have a great impact
depending on modules already installed: sale_timesheet, timesheet_grid,
...

We therefore decided to remove those options from settings to prevent
users from uninstalling it.

This commit is related to task ID 1841221.
2018-05-31 14:58:40 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Christophe Simonis 37eed7c509 [MERGE] forward port branch saas-11.2 up to 58e3552246 2018-05-25 14:34:18 +02:00
Géry Debongnie b709e22fa2 [FIX] project: reintroduce subtask_project_id field
The subtask_project_id field was removed by task #38498, amongst many
other changes.

This change makes some workflows much more difficult: for example, using
a different project with its own columns is kind of awkward.  It
requires many more clicks and custom filters to achieve the same result
as previously.

With this commit, we simply reintroduce the field and use it to set the
default project_id of a subtask.
2018-05-22 09:39:41 +02:00
Christophe Simonis 644f0959d0 [MERGE] forward port branch saas-11.2 up to 1655202924 2018-05-17 14:23:37 +02:00