Commit Graph
126133 Commits
Author SHA1 Message Date
RomainLibert da15493d14 [FIX] hr_holidays: remove double label and fix default value
Default value of interval_number and number_per_interval was overriden
and set to 0 by _onchange_holiday_status_id this would then crash at
creation because of the sql constraint.

In the form view of allocations, the duration label was duplicated,
solution was to remove labels and simplify the view.
2018-07-20 11:58:35 +02:00
Xavier Morel b67209b001 [FIX] : and / are not safe in content-attachment filename
Browsers accept it as they are wont to do, but the Content-Disposition
lib (introduced in 35d452cffb) does
not. Simply don't mark them as safe when %-escaping the filename so
they do get %-escaped properly.

RFC5987 states

ext-parameter = parmname "*" LWSP "=" LWSP ext-value
ext-value     = charset  "'" [ language ] "'" value-chars
value-chars   = *( pct-encoded / attr-char )
attr-char     = ALPHA / DIGIT
              / "!" / "#" / "$" / "&" / "+" / "-" / "."
              / "^" / "_" / "`" / "|" / "~"
              ; token except ( "*" / "'" / "%" )

Neither : nor / are in attr-char. This is further confirmed by
checking out RFC2616:

CTL            = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
token          = 1*<any CHAR except CTLs or separators>
separators     = "(" | ")" | "<" | ">" | "@"
               | "," | ";" | ":" | "\" | <">
               | "/" | "[" | "]" | "?" | "="
               | "{" | "}" | SP | HT

Here we can see "/" and ":" are both in "separators", which are
specifically *not* in token. attr-char restricts token further, so an
invalid token char can't be a valid attr-char.
2018-07-20 11:36:31 +02:00
Deep Patel 5ef8300cdd [ADD] web_unsplash: Find free high-resolution images from Unsplash
This commit:
1. Adds settings to install the new `web_unsplash` enterprise module.
   See counterpart commit on enterprise for details.
2. Export `ImageWidget` and `update_control_panel` to be able to override them.
3. Add the unsplash access key rights to website designer. (see related OE
   commit)

task-35060
Closes #25825, closes #25637
2018-07-20 10:16:59 +02:00
Christophe Monniez 23d840ddce [DOC] cmdline,testing: add documentation for test-tags
Closes #25789
2018-07-20 08:17:21 +02:00
Thibault Delavallée 624d75ca94 [IMP] mail: store activity creator on activity record
Currently due to technical reasons all activities are created using the
superuser. It means we have no idea who created an activity. This
commit fixes that by adding a field used to store the activity creator.
It is also displayed in the vignette displayed in chatter giving details
on the activity.

This commit is related to task ID 1865557. Closes PR #25842.
2018-07-19 17:22:18 +02:00
Thibault Delavallée 513fac6230 [MERGE] mail, various: do not display 'Pay Now' in payment emails
Several addons (account, sale, purchase) use specific 'send by email'
templates to send the invoice / SO / PO to the customer as well as
holding a view / payment button.

Purpose is to separate the template content (payment information) from the
payment button (Pay and sign online) when sending those documents by
email. Composer and chatter should not hold the button. It should be added
only in notifications emails.

Technical solution is to move the button into the notification template.
Model template holds the content (document and text) and notification
template holds the payment button.

This merge is related to task ID 1860049 and closes PR #25824.
2018-07-19 17:16:28 +02:00
Thibault Delavallée a2403b0695 [REF] purchase: clean send by email templates
Purpose

 * use the new notification template allowing to display the payment button
   only in emails;
 * reorder the fields definition to ease the reading;
 * slightly clean the email body using a maximum of div and br tags as it
   seems better integrated with Odoo edition capabilities;

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:14:33 +02:00
Thibault Delavallée 14a3fd6018 [REF] account: clean send by email template
Purpose

 * use the new notification template allowing to display the payment button
   only in emails;
 * reorder the fields definition to ease the reading;
 * slightly clean the email body using a maximum of div and br tags as it
   seems better integrated with Odoo edition capabilities;

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:14:33 +02:00
Thibault Delavallée bc79f92481 [REF] sale: clean send by email template
Purpose

 * use the new notification template allowing to display the payment button
   only in emails;
 * reorder the fields definition to ease the reading;
 * slightly clean the email body using a maximum of div and br tags as it
   seems better integrated with Odoo edition capabilities;

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:14:33 +02:00
Pierre Masereel 28eb461242 [IMP] purchase_requisition: validate demo data purchase tender
In the demo data, some requests for quotations are linked to the demo
purchase tender, but this one is in draft state. It is inconsistent with
what can be done in odoo, because draft purchase tender never generate
requests for quotation.

TASK-ID 1864372
2018-07-19 17:12:29 +02:00
Thibault Delavallée 3da7340bf5 [IMP] mail: add a new payment-specific notification template
This commit introduces a new notification template. Its target is to be used
when sending payment-based templates like 'Send by email' for sale orders,
invoices or purchase orders.

Purpose is to separate the template content (payment information) from the
payment button (Pay and sign online) when sending those documents by
email. Composer and chatter should not hold the button. It should be added
only in notifications emails.

Technical solution is to have a somewhat-generic template available in mail
to be used in some specific actions. Another solution is to hide the
button but it breaks if people edit or remove the hidden content when
editing the mail in the composer without knowing it. As the button is
mandatory in those actions we choose to have it added by the notification
email.

Future commits will gradually use this template in some addons.

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:05:20 +02:00
Thibault Delavallée dd72fef73f [IMP] base: do not format email for partners not having email
Currently if a partner has a void email, its email_formatted field holds
a value like "Raoul Grosbedon <False>" which is quite rarely considered
as a valid email address.

Minimal fix for this field is to return a void value if there is no email.
Having a void return is easier to manipulate for callers in order to
handle it.

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:05:20 +02:00
Pierre Masereel 844024214c [FIX] stock: put in pack cancel
When you click on put in pack in a ppicking, you can uncheck the
checkbox 'Done', this doesn't have any sense, and doesn't do what you
expect. So the checkbox is always checked for new packages, and you can
simply click on the dustbin to cancel your put in pack.
2018-07-19 16:42:08 +02:00
Pierre Masereel 03384e3fc9 [FIX] stock: confirmed package reservation when done
When a package level is confirmed and is set to done, if you try to
reserve it after, it won't have the correct location of the reservation
because there are still move lines (forced) with the wrong location.
2018-07-19 16:42:08 +02:00
Pierre Masereel 2e4ab78ce7 [FIX] stock: update location depending on state
maybe we should compute
2018-07-19 16:42:08 +02:00
Pierre Masereel 5f83c59f75 [FIX] stock: assign move line to package_level_id
When the move lines reserved are assigned to a package level, it wasn't
taking into account the package level of the parent move if it has any.
So this could lead to package level state error, if we have two package
level with the same package_id.
2018-07-19 16:42:08 +02:00
Christophe Simonis 49f634e472 [MERGE] forward port branch saas-11.4 up to 1f7a39964b 2018-07-19 16:36:03 +02:00
Rémi Rahir 4cb9194275 [ADD] snailmail: new iap module to send letters by post 2018-07-19 15:54:00 +02:00
Rémi Rahir 01efffc472 [FIX] iap: fix url generation
Added missing part of the default url in get_credits_url
introduced in af2f12b136
2018-07-19 15:54:00 +02:00
Christophe Simonis 1f7a39964b [MERGE] forward port branch saas-11.3 up to 0c42dcfc22 2018-07-19 15:36:54 +02:00
Rishabh Jadia b942a5c131 [IMP] product, stock: hide qty_on_hand and forcasted on views
Hide value of the column when the product is consumable or service in
tree views.

TASK-ID: 1864329
2018-07-19 15:15:23 +02:00
Akim Juillerat 3869cdf7d8 [FIX] purchase: Restore push rules behavior in 2 steps reception
Due to this commit: https://github.com/odoo/odoo/commit/ab5fcb29650349fa641c6130bf6dcbdc1ec28a07
When confirming a PO with two lines having the same product,
the stock moves were not merged anymore in the putaway
(input to stock) picking.

Reason:
When confirming the PO, odoo creates first a receipt
(vendor to input) picking and its stock moves matching the PO line.
Then it applies the push rule on each move. Both putaway
(input to stock) moves are created by copying the receipt
(vendor to input) moves, but when the second is created,
odoo check if there's another move to merge sharing same
properties to merge into it. As purchase_line_id is now copied
in both cases, both putaway moves include a different
purchase_line_id and won't be merged together, since this field
is in _prepare_merge_moves_distinct_fields() on stock.move.

opw:1854387
2018-07-19 15:03:11 +02:00
Arnold Moyaux 202b0515c8 [FIX] purchase_stock: post init hook for warehouses rules 2018-07-19 14:43:08 +02:00
Darshil Trivedi 827958a890 [REF] stock: rename procurement.rule to stock.rule
This commit is related to task ID 1852969.
2018-07-19 14:43:08 +02:00
Arnold Moyaux c93ae01986 [MOV] stock, mrp, purchase_stock: rename procurement in stock_rule
Procurement rule do not reflect reality anymore since it is common for
push and pull rules. We decide to rename it stock rule instead.
2018-07-19 14:43:08 +02:00
Darshil Trivedi a35df8d371 [IMP] stock: merge push and pull rules
Usability improvement:
- Common view for push and pull rules
- Add an help text in order to describe the rule
- Rules menu
- Warehouse checked by default on route created by a warehouse
- Lower the MTO route sequence in order to take it first.
- Tooltip cleaning

Technical improvement:
The purpose of this task was also to merge stock.location.path(push rule) and
procrement.rule. Those two model were design to execute the same task
but in a different direction. Thus it contains duplicate code.

Task ID 1852969.
2018-07-19 14:43:08 +02:00
Christophe Simonis 0c42dcfc22 [FIX] board: adapt test. 2018-07-19 14:32:26 +02:00
Laurent Smet 02ccb58401 [IMP] l10n_nl: improve tax report/tags
Improvement in tax report
Make the distinction between services and products

Was task: 35554
Was PR #23439
2018-07-19 14:30:55 +02:00
Simon Lejeune 22062d9efc [FIX] stock_landed_costs: wrong price_unitupdate when multiple landed costs
`new_landed_cost_value` was added to `value` to recompute the
`price_unit` field. The issue is that when applying multiple landed
costs, `value` and `new_landed_cost_value` already contains the previous
landed costs, resulting in an erroneous `price_unit`.

This patch only adds `cost_to_add`, which is the current landed cost, to
`value`, which contains all the previous one.

To reproduce:
- Create a product FIFO / AUTOMATED
- Purchase 50 units@$2 and receive them (total value=$100)
- Add a landed cost of $100 on those 50 units and a landed cost of $50 on those 50 units
  (total value = $100+$100+$50)
- Sell 15 units (the value on move out =$75 > $75/15 = $5 unit cost)

The standard_price on the product = $7 while I expect to have $5

opw-1867002
2018-07-19 14:29:34 +02:00
Alexandre Kühn 766df6de29 [MERGE] mail, *: several improvements and bug fixes (JS)
*: im_livechat, im_support, website_livechat

Improvement on top of this commit: https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

=============
Improvements:
=============

1. New thread models "abstract threads" and "website livechat"

    new modeling:

                        0..1   0..1
    AbstractThreadWindow <-----+
                               |--->  Abstract Thread
         AbstractMessage <-----+       /      \
                         *     *      /        \
                                     /          \
                                  Thread     Website Livechat
                                   /  \
                                  /    \
                                 /      \
                  Thread With Cache     Document Thread
                   /      |       \
                  /       |        \
            Mailbox    Channel    Support Channel
                          |
                          |
                          DM

  - Thread is used in the backend, while Website Livechat is used in the frontend.
  - The main distinction is that Thread relies on mail_manager, while Website Livechat doesn't.

2. Thread widget has its file renamed (from thread.js to thread_widget.js)
3. Most templates in thread.xml now handles Abstract thread

==========
Bug fixes:
==========

1. [FIX] Mail failures from channels were not grouped together.
2. [FIX] Channel names in the discuss sidebar were displaying their escaped representation.
3. [FIX] Thread was rendered several times when receiving a new message.

=======
Others:
=======

1. Removed unused code.
2. Fixed some classnames and corresponding style.
2018-07-19 14:02:53 +02:00
Alexandre Kühn d7741c7c55 [FIX] im_support, mail: correct style and classname
The style for preview info in the systray were incorrect.
Also, mailbox had the old classname ('o_channel_name'), instead of the new one ('o_thread_name')
2018-07-19 14:01:58 +02:00
Alexandre Kühn a5be128bb1 [REMOVE] mail: fix from forward-port
`documentModel` is already declared and assigned the same value, so this
part is not necessary inside this conditional branch.
2018-07-19 14:01:58 +02:00
Alexandre Kühn 4bcfcb9aa4 [FIX] mail: unescape channel name in discuss sidebar
When the user creates a channel by providing a name, the name is escaped
in order to avoid XSS attacks. As a result, the logic make use of escaped
string, which may be different from the provided string by the user.

As a result, if we do not unescape the string when necessary, the user may
see the escaped version. For instance, if we creates a channel named 'R&D',
it may display 'R&amp;D' to the user.

This commit plays safe by still keeping the handling of channel names in
their escaped form, but unescape it just before displaying it on the sidebar
of the Discuss app to the user.
2018-07-19 14:01:58 +02:00
Alexandre Kühn 04c98eeb48 [FIX] mail: replace _lt to _t for mailboxes' name
Since mailboxes are added after the rpc 'mail/init_message', the translations
are loaded. Therefore it is not necessary to lazily load the translations.
2018-07-19 14:01:58 +02:00
Alexandre Kühn 0f65c4ab3b [FIX] mail: group mail failures of channels
Before this commit, mail failures were correctly grouped in the
systray messaging menu, except for mail failures coming from channels.

This commit fixes grouping for mail failures from channel.
2018-07-19 14:01:58 +02:00
Alexandre Kühn 68c30ef4b3 [FIX] mail: detach chat threads on receiving a new message only if thread is detached
When a new message is received and discuss is not open, any chat thread
containing this message is detached. However, if the thread is already
detached, it should not be detached again.
2018-07-19 14:01:58 +02:00
Alexandre Kühn a203b4a2d1 [REMOVE] mail: remove unused style for 'o_chat_help_message'
This classname is not used anymore, so the corresponding style
should also be removed.
2018-07-19 14:01:58 +02:00
Alexandre Kühn f1ae9369ae [FIX] mail: re-render thread once on newly added message
When we add a new message, it should re-render the thread only once.

The `addMessage` function must handles new messages and updated messages.
Some code for updated messages should not be executed for new messages,
which is what this commit does.
2018-07-19 14:01:58 +02:00
Alexandre Kühn c040994357 [FIX] mail: remove unused LOC
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

The `content_subtype` field has been recently removed, but the commit above mistakenly
added it back on this line.
2018-07-19 14:01:58 +02:00
Alexandre Kühn 55fc06c867 [FIX] mail: clean docstring
- updated docstring
- move function to abstract thread (generalization behaviour for all threads)
- simplify code
2018-07-19 13:58:34 +02:00
Alexandre Kühn 99756a62d7 [FIX] mail: fix small error discuss docstring
The type parameter is optional.
2018-07-19 13:58:34 +02:00
Alexandre Kühn e5039ad7d1 [FIX] im_livechat,mail: clean thread models and windows
- Cleaning website livechat window so that some behaviour are in website livechat instead.
- More shared code in abstract thread / abstract thread windows, thanks to the
introduction of website_livechat model.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 0b6243104e [IMP] im_livechat, website_livechat: rename channel to livechat, use livechat model
In im_livechat, it now handles a {mail.model.WebsiteLivechat}.

Note that this website livechat model is dumb with messages: it stores messages
just before rendering, because this is im_livechat that handles messages.
This should be improved in the future.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 68c5ebbbea [IMP] im_livechat, mail: website livechat model
Make use of a website livechat model, so that im_livechat can make use of this model.
This provides an almost similar model for threads in the backend and in the frontend.

As a consequence, im_livechat and website livechat windows have been adapted to handle
a website livechat model.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 915da49d17 [IMP] mail, *: template rendering with abstract thread, adapt thread instantiation, thread getMessages/fetchMessages, and create mode document thread.
* = im_livechat, im_support

- thread widget now uses abstract thread in `render` method
- thread models have their `init` parameters changed, so that the parent may be optional
- reworked 'creating a new record...' in chatter in create mode:
    > new model CreateModeDocumentThread, which basically is a fake document thread
      with a fake message for its rendering in create mode of the chatter
    > special rendering method of thread_widget for such case: `renderChatterCreateMode`
- renamed thread methods previously named `getMessages` to `fetchMessages`:
    > in order to not conflict with `getMessages`, used for rendering
    > now, `getMessages` always get messages that are locally,
      while `fetchMessages` may fetch messages.

TODO:
    - special thread model for im_livechat (rendering is broken ATM)
2018-07-19 13:58:34 +02:00
Alexandre Kühn ec8c505bc1 [IMP] mail: abstract thread in thread template
With this commit, the template for thread uses a {mail.model.AbstractThread}
object, instead of a list of {mail.model.AbstractMessage[]}.
2018-07-19 13:58:34 +02:00
Alexandre Kühn ac14bcb730 [ADD] mail: abstract thread model
Thread model that group all kinds of threads, including frontend threads
(e.g. website livechat).
2018-07-19 13:58:34 +02:00
Alexandre Kühn 448cceffaa [RENAME] im_livechat,mail: rename widget 'thread.js' file to 'thread_widget.js'
It is a bit annoying to have two files named 'thread.js', one being the widget
and the other the mail model.
2018-07-19 13:58:34 +02:00
Alexandre Kühn cb7add2ebd [MOV] mail: move thread models in specific folder for thread models
The `model` folder contains several files, so this groups files related
to threads directly.
2018-07-19 13:58:34 +02:00
Alexandre Kühn 12f4f9a51d [REMOVE] mail: remove unused 'mail model' class
The intent of this class was to have all mail model be RPC/service calls out of
the box. This is a bit overkill for just 2 lines per new mail models, which is
why this is not used at all.
2018-07-19 13:58:34 +02:00