Commit Graph
115675 Commits
Author SHA1 Message Date
Thibault Delavallée 561ae286f9 [MOV] hr_expense: split data to separate mail data from other data
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.
2018-02-21 16:51:38 +01:00
Thibault Delavallée 0e595ee81a [MOV] hr_holidays: split data to separate mail data from other data
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.
2018-02-21 16:46:53 +01:00
Thibault Delavallée 634a688653 [MOV][IMP] project: improve action to configure activity types and move in its own file
Purpose of this commit is to ease project managers in their daily job
organization by ensuring that newly created activities in project
configuration are by default associated to tasks, and not global.

Activity types actions and views are moved in their own file in order
to match the guidelines.
2018-02-21 16:43:26 +01:00
Thibault Delavallée 883f634ec8 [IMP] hr_recruitment: add menu to configure activity types
Purpose is to ease HR recruitment people in their daily job organization
by allowing to tune activity types. A menu is added in configuration to
access activity types. Those are by default associated to the applicant
models.
2018-02-21 16:41:53 +01:00
jem-odoo 95f6743054 [FIX] sale_timesheet: improve new demo data
Some label or name for new demo data are not clean.
This commit imrpoves them by:
- rewritting clean descirption for timesheets
- set negative amount for expenses analytic lines
2018-02-21 14:04:00 +01:00
Thibault Delavallée 1feeff4deb [FIX] mail: fix display of unnecessary : in message about activity done
If the activity had no summary the messages has a : leading to nothing
which is not very nice. If there is no summary, only display the "done
by" message followed directly by the feedback.
2018-02-21 13:35:11 +01:00
Nicolas Martinelli 8796211c36 [IMP] account: payment receipt translation
The payment receipt should be printed in the partner's lang.

opw-810450
2018-02-20 15:31:08 +01:00
Thibault Delavallée e9734f4975 [MERGE][IMP] mail: add a new notification template and use it to notify people of assigned document
Purpose of this merge is
 * to introduce a new notification template much more up to date with
   modern convention about emails;
 * to introduce a new method allowing to push notifications to recipients
   that are not necessarily linked to a document. Those notifications
   can be either Inbox or email according to user existence and
   notification type choice;
 * to make assignation email use this notification mechanism instead of
   an hardcoded email;

Please see commits under this merge for more details about why, what and
how it was done. This merge is related to task 51517. #Closes #22670 .
2018-02-20 14:40:41 +01:00
Thibault Delavallée a6e1324873 [IMP] mail: make assignation email a notification
Current behavior when assigning someone as responsible of a document is
to send him an email if he works using emails. Technically it is done
when writing on user_id field and based on notification_type field value
of the user.

This commit changes that behavior to push a notification to the new
responsible. It uses the recently-introduced message_notify method
allowing to push notification to recipients without being linked to
a document. It means people working in Odoo receive a message in their
Inbox while people working by email receive an email.

Assignation message contains a link to the document meaning it is always
possible to go to the document. Notification email uses the new template
defined recently. It allow to have a notification email a bit classy.

This commit implies that more notifications are created. Indeed previously
to this commit no notification were created for partners without user
or for users working in Odoo. There is therefore a performance test whose
counter increases and a slight increase in query count when installing
all modules, about 1K queries on 581K.
2018-02-20 14:39:02 +01:00
Thibault Delavallée b6e621717e [IMP] mail: add method to notify recipients of content not related to a document
Mail API contains a message_post method allowing to post a message on a
document. In some cases we would like to push notifications to recipients
that are not necessarily linked to a document. For that purpose we
introduce message_notify. It is a shortcut that prepares the message and
speeds up the computation by pre-computing message values. This method
calls message_post and therefore the whole notification process. It
means no custom code for pushing inbox or email notifications is necessary.
2018-02-20 14:34:54 +01:00
Thibault Delavallée 8a026e26c6 [IMP] mail: update _notify API
Purpose of this commit is to allow to give additional values when rendering
notification emails and to make some parameters explicit.

This commit updates the _notify API. It allow to propagate a dictionary
containing values given to the rendering of the notification template.
This allow to have more complex templates and/or to control the rendering
depending on some parameters. Indeed currently only some fixed values and
values coming form the message to notify are given to the rendering
context.

First use will be soon when pushing notification emails not necessarily
linked to documents. In this process some values will be given by the caller
and not only by the message context anymore.

This commit also moves some context key used to control the notification
process directly in values given to the _notify method. It allows to make
those parameters explicit and rely less on context.

The _notify method now takes a values dictionary that may contain

 * add_sign: add user signature to notification email, default is True.
   It replaces the ``mail_notify_user_signature`` context key;
 * mail_auto_delete: auto delete send emails, default is True. It
   replaces the ``mail_auto_delete`` context key;
 * other values are given to the context used to render the notification
   template, allowing customization.

It allows to remove some context switch notably in the composer. A values
dictionary is computed and given to message_post and then propagated to
the notification mechanism.
2018-02-20 14:32:09 +01:00
Thibault Delavallée 2709ffe0e2 [IMP] mail: add new classy layout for email notifications
This commit adds a new QWeb layout mail_notification_light. It is a new
lighter template using more modern styling. Its purpose is to be used as
a basis for all future templates used in notification mechanism (chatter,
sale orders, ...). During some time all templates will exist separately.

Future commits will gradually improve or add various notification
mechanisms. This new template will gradually be used more often in order
to replace old ones.

Thanks to @est-odoo for its in-depth testing of the template.
2018-02-20 14:30:06 +01:00
Mehul Patel 257bf539d5 [IMP] sale_timesheet: add demo data
This commit adds demo data to populate
the project overview with billable
timesheet on sold projects and tasks.
This will ease the testing and reinforce
the wow effect during demonstration.

Note: those demo data should never be
involved in python test cases.

Closes #21132
2018-02-20 09:34:56 +01:00
Fabien Pinckaers 0273e41656 [FIX] web: CSS glitch in kanban column settings dialog
[IMP] account: better copywriting when no reconciliation model set
2018-02-20 07:21:22 +01:00
Laurent Smet 2ded1015d6 [IMP] account_voucher: improve processing of 'pay directly' vouchers
For a better tracability, we will have 2 journal entries directly created from the validation of a voucher in 'pay directly' method:
- one regular for the sale/purchase in the selected journal
- one for the payment in the selected payment journal
both being processed normally and automatically reconciled together.

This allows to have no difference, in terms of existing document and tracability, between a voucher created with payment set to 'pay directly' and another, paid in another mean afterwards.

Was PR #22108. Was task 43712
2018-02-19 17:17:54 +01:00
RomainLibert 05bb9848a2 [IMP] resource: add time_type field on resource.calendar.leaves
We would like to have an overview of project forecast that include
leaves, for this we need to implement several kind of 'leaves' directly
in resource module.

These kind of 'leaves' can be defined via the hr.leave.type model (only
visible in base.group_no_one (choices currently are 'leave' and 'other')

    * Add field time_type on resource.calendar.leaves
    * Add a domain restriction that allows for filtering on this field
    * Add tests
2018-02-19 10:43:25 +01:00
RomainLibert 6d870463d0 [IMP] resource: Add possibility to pass in a domain
It will enable to retrieve data from the resource module based on a
domain that we pass to the model. It can be used in order to filter on
certain leave types only.

  * In resource_mixin and resource add a way to use a domain in order to
  filter the leaves
  * In resource_mixin add a method to get the work/leaves hours count
2018-02-19 10:43:25 +01:00
XavierDo 813065cb5b [IMP] mail: add settings button on channels
The settings of a channel were available in debug mode only. Adding a settings button on each channel allows to read/edit a channel settings easily.

Remove the unsubribe button and the settings button from the top of the page since they can be acceses another way now.
2018-02-19 09:48:38 +01:00
Christophe Simonis 71c36f608b [FIX] hr_holidays: use renamed model. 2018-02-15 16:35:09 +01:00
Thibault Delavallée 6a1047111a [MERGE][IMP] portal, various: add access tokens in document access button for customer notification emails
Previously to this merge portal customers receiving a notification email
on a shared document could not directly reach the document on the portal
as the access token was not given to them. The only way to give access
to portal was done using the specific email implemented for sale orders
or invoices. This behavior is now extended to notification emails.

This merge adds the token support for customers through inheritance in
portal mixin. It also fixes inherit order so that the call chain
effectively goes through portal before calling the mail.thread base
implementation.

This merge is related to task 40064. #Closes #21426.
2018-02-15 14:57:31 +01:00
Thibault Delavallée 398c126cfa [IMP] account: display access buttons in notification email only on not draft not canceled invoices
Indeed draft and canceled invoices should not be displayed to customer or
portal customers.
2018-02-15 14:50:36 +01:00
Thibault Delavallée 467e490e5d [FIX] project: reorder inherit to be able to pass through portal before mail thread
Purpose is to enable override of mail.thread methods in portal mixin.
An example is the _notification_recipients method defined in mail.thread
and customized in portal.mixin.
2018-02-15 14:50:36 +01:00
Thibault Delavallée 2bf370ac28 [FIX] account: reorder inherit to be able to pass through portal before mail thread
Purpose is to enable override of mail.thread methods in portal mixin.
An example is the _notification_recipients method defined in mail.thread
and customized in portal.mixin.
2018-02-15 14:50:36 +01:00
Thibault Delavallée 75ec7ab257 [FIX] sale: reorder inherit to be able to pass through portal before mail thread
Purpose is to enable override of mail.thread methods in portal mixin.
An example is the _notification_recipients method defined in mail.thread
and customized in portal.mixin.
2018-02-15 14:50:36 +01:00
Thibault Delavallée 0e22ccb721 [IMP] portal: add access token link in notification emails for customers
Purpose of this commit is to allow customer portal to have an access link
containing an access token. Portal mixin now override the default mail.thread
behavior when classifying recipients of a notification email in groups.

If the model has an access_token and a customer field correctly defined
the recipient that matches the customer will have an access link in its
notification email holding the access token. It will also contain an
auth signup token if it is enabled.
2018-02-15 14:50:36 +01:00
Thibault Delavallée 7176d04f3b [IMP] mail: allow parameters to /mail/view link
Purpose is to allow to add parameters to the view link. Currently it is
formatted like '/mail/view?model=model&res_id=res_id'. We would like to
be able to add parameters like access token for example. It will allow
to create view links specifically tailored for some people like customer
portal.
2018-02-15 14:50:36 +01:00
Christophe Simonis 806f42b065 [MERGE] forward port branch saas-11.2 up to 8b9e854be4 2018-02-15 13:46:23 +01:00
Alexandre Kühn 8b9e854be4 [FIX] im_livechat: livechat button not rely on JS services
Revision of https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

One of the purposes of the previous commit was to test discuss.
There was an attempt to test im_livechat, but it has been aborted due to the possibility
to use livechat on an external website.

However, some bits remain from this attempt, such as LivechatButton becoming a JS service
provider in order to use those services with the external lib. LivechatButton was not working
for the following reasons:

    - ServiceProviderMixin.init was not called (so it couldn't load any service);
    - On website, there are two service providers (LivechatButton & websiteRootInstance).

This fix ensures that LivechatButton does not rely on JS services, such as the bus_service.
2018-02-15 13:24:37 +01:00
Martin Geubelle 995d08b79a [FIX] web: factorize some doAction preprocessing
This preprocessing also needs to be done in Studio so it's factorized in
a separate function.
2018-02-15 12:39:19 +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
jem-odoo 93da579623 [FIX] hr_expense: missing file in manifest 2018-02-15 09:56:54 +01:00
Christophe Simonis 259686ba78 [FIX] account_voucher: avoid double xml attribute definition 2018-02-14 19:00:22 +01:00
Christophe Simonis 72508cc241 [MERGE] forward port branch saas-16 up to 7792755946 2018-02-14 18:26:57 +01:00
RomainLibert df324c8857 [IMP] hr_holidays: Improve leave type: limit date, visibility, usability
In order to help limit leaves recording errors. We need to add some
configuration on leave type object. For example we need to avoid people
taking legal leaves 2016 on 2017.

  * Add validity dates : start and end dates on the leave type. An empty
    end date means forever
  * Double validation : change the checkbox into a radio button with now
    three choices :
  	- Human Resource Responsible
	- Manager
	- Double Validation
  * Add a sequence field, using handle widget
  * Add a field, to specify if the employee can select the leave type in
    his allocations, requests or in both of them
2018-02-14 17:26:31 +01:00
Christophe Simonis 7792755946 [MERGE] forward port branch saas-15 up to d24bdbde81 2018-02-14 17:18:59 +01:00
RomainLibert b4bda28f0d [FIX] resource: _get_leave_intervals
We were using start_datetime instead of end_datetime. Which resulted
into wring results if we passed in datetimes with different date parts.
2018-02-14 16:53:00 +01:00
Christophe Simonis d24bdbde81 [MERGE] forward port branch saas-14 up to 9d0de61114 2018-02-14 16:34:13 +01:00
Christophe Simonis 9d0de61114 [MERGE] forward port branch 10.0 up to 73c2ac451a 2018-02-14 16:04:23 +01:00
Christophe Simonis 73c2ac451a [MERGE] forward port branch 9.0 up to b7b82f1267 2018-02-14 15:32:37 +01:00
Raphael Collet e9d944f960 [FIX] product: product with single value for a "nocreate" attribute
The use-case is: update a product template by setting an attribute with
create_variant=False and a single value.
2018-02-14 15:29:43 +01:00
Raphael Collet 90bfad0e34 [FIX] product: unshadow test 2018-02-14 15:29:43 +01:00
fda-odoo f2bcebb9f2 [FIX] payment_paypal: make IPN work again (revert fix) (#23048)
Revert fix from xmo
(https://github.com/odoo/odoo/commit/29b9b74ceac86a17897eff032a24416fb26b38d1) that broke the IPN flow.
2018-02-14 15:03:56 +01:00
Laurent Smet 0f4333ddf1 [FIX] account, account_voucher: fix payment generation in pay directly
-opw: 779688
2018-02-14 15:03:26 +01:00
Christophe Simonis b7b82f1267 [FIX] core: call migration end- scripts with the previous version number 2018-02-14 14:58:16 +01:00
RomainLibert 9717026dcc [IMP] Resource: Expand testing on timezones
We need to check if resource module takes into account the timezone of
the employee taking a leave and the timezone of the user asking to see
when this employee has taken some leave.

Basically everything should be done in UTC internally and then converted
back to the user's timezone.
2018-02-14 14:43:38 +01:00
Denis Ledoux 0db75089ef [FIX] base: prevent PhantomJS tests to send emails
The emails sending is skipped during the tests.
The mecanism to determine if the server was running tests
was to check if the attribute `testing` was set for the thread.

Unfortunately, this `testing` attribute is removed/set to false after the loading/installation
of the modules is done, and phantomJS tests are ran post-installation,
and therefore the emails that were potentialy sent following an action
performed in a PhantomJS tour were not skipped.

This occurred for instance in the tour `project.tour`,
when the responsible of a task was changed,
the sending of the assignation notification email was not skipped.

In the case the machine on which the tests are ran does
not have an smtp server (or mailcatcher) running on the port 25,
this resulted in a test fail.
2018-02-14 14:26:39 +01:00
Haresh Shyara 3a38080ff5 [IMP] account : change unit price according to UoM
It was already the case with the sale order but not on invoices

Task-id: 35387
Closes #18719
2018-02-14 18:49:14 +05:30
Kinjal Mehta 102bb626f0 [FIX] account: changed the name of date filter in journal items search view.
As the old name 'date' of the filter was the same as the field date, the context key 'search_default_date':1 was ambigous and not well processed by the web client.
It was indeed considering on field by default and was trying to set value 1 on date field, which is not possible and it gave traceback.
2018-02-14 14:06:30 +01:00
Mehul Patel efe0112527 [FIX] account: recurring bills filter option always visible.
Previously, the installation of account_3way_match module was loosing these filters
2018-02-14 13:57:11 +01:00