Commit Graph
117975 Commits
Author SHA1 Message Date
Haresh Shyara 5fcbc116f1 [REM] stock: removed upstream and downstream traceability in report 2018-01-31 14:14:59 +01:00
Haresh Shyara 90333dc0a4 [IMP] stock: added and arrange some columns on traceability report 2018-01-31 14:14:59 +01:00
Haresh Shyara 53ac302eab [REM] stock: removed stock_quant on traceability report 2018-01-31 14:14:59 +01:00
Martin Geubelle 5d463d2c03 [FIX] base: correctly delete required many2one
In the transient model 'Change Password Wizard User', the many2one
`wizard_id` was not set as ondelete cascade even though this field was
required.

This was causing issues in the auto-vacuum cron if by chance this model
was cleaned up before the wizard ('Change Password Wizard').

Courtesy of @rco-odoo

Issue #813289
2018-01-31 14:12:53 +01:00
Yenthe V.G 897b84b37b [IMP] base: remove deprecated colors tag
Cleaning leftovers

Closes #22678
2018-01-31 13:55:26 +01:00
Nicolas Martinelli 513fad42a0 [FIX] barcodes: delay between keys
In order to detect if a barcode scanner is being used, we detect the
delay between keypresses. The value is hardcoded to 55 ms. However, in
the case of a bluetooth scanner, this delay is often not enough,
resulting in an incorrect capture of the barcode.

We add the config parameter `barcode.max_time_between_keys_in_ms` which
allows the user to fine tune this delay for his hardware.

opw-806398
2018-01-31 13:47:17 +01:00
Haresh Shyara f003216f74 [IMP] l10n_ch: removed taxes using deprecated rates
- Removed old taxes of sales and purchase with percentage 8 and 3.8 that cannot be used anymore since 2018

Was PR #22040. Was task 39836
2018-01-31 12:05:43 +01:00
Nguyen Tan Phuc 00a10fdd00 [FIX] point_of_sale : wrong currency decimals
To have the same behavior as `_compute_decimal_places` in python
When setting rounding of currency > 10, POS will get negative decimals
instead value 0 and crash

Closes #22199
2018-01-31 11:45:31 +01:00
Thibault Delavallée d19195de0d [DOC] test_mail: update performance counters after last commits
Commits improving performance counters related to mailing

 * introduction of message_log (https://github.com/odoo/odoo/commit/8ddca6f95a52d36c4a8731dcf93413e8206dce81) and its application in
   the mail_thread (https://github.com/odoo/odoo/commit/99be64dc174af9ad7eb739575215aa03260e833b and https://github.com/odoo/odoo/commit/74ec8a95a0f7b1aadd847a728b4d9bc24daca495). This
   commit has a big impact on the runbot installation query count (110K on 700K, about 15%);
 * moving templates from mail.templates to qweb (https://github.com/odoo/odoo/commit/2f7593761c1ea432e2e58045150150356816f868). This
   merge has an impact on the runbot installation query count (10K on 680K);
 * removing (un)follow buttons in notification emails (https://github.com/odoo/odoo/commit/11d2d30e91758baaa9c6241a86f97ae3dfe52ad2).
   This commit has an impact on the runbot installation query count
   (8K on 690K);
 * removing 'always' tracking option, meaning less tracking values are
   created when writing on a record (https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da). No impact is given
   as it is mixed with another commit that decreases performances.

Commits decreasing performance counters related to mailing

 * adding the discussion subtype consideration in data send to the bus
   (https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da). Future improvements will come that improve bus
   management in chatter and channels.

Apart from those commits there are several commits notably from @rco-odoo
that improves performances that are not listed here.
2018-01-31 11:44:22 +01:00
qsm-odoo d295b4360d [FIX] website_sale: properly switch images when selecting a variant
When using product variants, the product page shows:
- The product variant if different from the product image
- The product image
- Extra product images

The product variant image has to be switched dynamically when the user
choose another variant. This was broken with commit https://github.com/odoo/odoo/commit/f98bb2b86bb7c3ff0a549f24b31616c1539420a7
Indeed, it was switching the product image with the product image
variant instead.

This was because the variant/template order changed without switching
their classes. This commit changes their order again.

Also see opw-784737
2018-01-31 10:59:19 +01:00
adekock11 9dce2be273 [FIX] mail: display notification when explicitly grant it
Instead of looking for the "denied" permission, rather look for the "granted"
since there are three permissions: "default", "denied", "granted" - only
"granted" counts toward permission actually being granted

Closes #22633
2018-01-31 10:44:00 +01:00
moutio 8c941cbfb1 [CLA] signature for MouTio
Done at #22605
2018-01-31 09:56:58 +01:00
kaberer c07f78db17 [CLA] signature for kaberer
Done at #22641
2018-01-31 09:56:15 +01:00
Lucas Perais (lpe) 8b97a39907 [FIX] mail_template: replace local links except mailto
Before this commit, all the mailto:xx@ww.com in emails were transformed into
http://web.base.url/xx@ww.com

This was due to the url parsing of werkzeug urls.py, which definitely get the scheme
(mailto), but doesn't get the netloc of the url -- because it has no //

Ater this commit, we transform links to local ones, except if the scheme is mailto,
and the issue disappears.

OPW 807795
2018-01-31 09:20:13 +01:00
Nicolas Martinelli c52b18e65f [FIX] account_check_printing: multiple partners
- Create a bill for partner A of an amount X
- Create a bill for partner B of an amount Y
- Validate both bills
- Select both and register a payment by check.

Two payments are created with the same amount in words: X + Y.

In this specific case, we recompute the amount in words automatically.

opw-805842
2018-01-31 09:14:57 +01:00
RomainLibert a5cbf2105c [FIX] resource: _interval_and not working with disjoint intervals
When we pass two disjoint intervals the behaviour of _interval_and is a
little strange, it returns an interval wich begins after it finishes.
In order to fix that we return None when the intervals are disjoint.
2018-01-30 17:38:30 +01:00
Thibault Delavallée 74ec8a95a0 [IMP] mail: make tracking without subtype a notification log (note)
This message is not linked to any real subtype and will never be notified
to someone. It creates a notification with subtype note. It is however
different from user-created notes and should not be propagated.

Tracking triggering subtypes are managed differently as they have a
business related meaning. It makes sense to notify them to followers.
2018-01-30 17:22:12 +01:00
Thibault Delavallée 99be64dc17 [IMP] mail: make 'Doc created' message a notification log (note)
This message is not linked to any real subtype and will never be notified
to someone. It creates a notification with subtype note. It is however
different from user-created notes and should not be propagated.

New record creation suck as new task or new ticket are linked to subtypes
people can follow and defined in their own module.
2018-01-30 17:22:11 +01:00
Thibault Delavallée 8ddca6f95a [IMP] mail: introduce _message_log as shortcut when logging notifications
This commit introduces _message_log to use when logging notification-based
notes on a document. Its main purpose is to provide a shortcut to the
complex mechanism of message_post. As it is a lighter code and as it
performs less checks and value computation it allows to clearly gain
queries when logging notes.

It does

 * skip the notification process completely. Side effect is that followers
   following note subtype are not notified of document created and pure
   note tracking. This is considered more as a fix than a feature change.
   Indeed following notes means that followers want to receive notes
   logged by other users. The fact that system notifications without a
   specific subtypes are also notes is a side-effect of the current
   implementation;
 * support only notification-based notes and should not be used currently
   when logging real notes as those could trigger the notification
   process;
 * skip access rights checks as it creates the message as superuser. It
   is therefore defined as a private method and should be called within
   a method where access rights are already granted;

On community runbot installing all 203 modules takes 580K queries instead
of 690 at the time of testing. It is a 15% performance increase based on
the 'all modules installation' metric.

In a distant future message_post and message_log could be merged after
some cleaning but it is easier currently to have this shortcut available.
Moreover as there are clouds on the mail module some developers prefer
to already have some optimization and code cleaning done to avoid
loosing all their hair.

This commit includes a small test. In a same distant future more tests
will probably be added depending on how mail API evolves.
2018-01-30 17:20:45 +01:00
stefanorigano 139737dbeb [IMP] web: tables :hover state
Properly style table’s rows ‘:hover’ state to let people understand
that it’s clickable
2018-01-30 16:09:04 +01:00
Nicolas Martinelli 93c4c5cfb1 [FIX] mrp: multi-company bom find
- Create 2 companies A & B
- Create a product P with 2 phantom BOMs:
  Component C1 for company A, with sequence = 10
  Component C2 for company B, with sequence = 0
- Create a SO in company A for P, validate

The picking contains C2, while one would expect C1 since C2 is only for
company B.

opw-807640
2018-01-30 15:20:17 +01:00
Xavier-Do c99de45515 [IMP] chatter: improve chatter readability
Only messages as comments and email template should keep a white backround since they are not internal.

It is also enough to display fields that changed on subtypes (update message) since emails will be reworked soon and more information will be given there. The support of 'always' track can be removed. (is now considered as a simple tracked field)

The use of self.env.ref('mail.mt_comment').id add some query and the performance tests needs to be update since message_format is called by notify_by_chat. This code will be refactor later
2018-01-30 14:49:03 +01:00
Dipalee Bhalodia c4895c2f2b [FIX] portal: enable rating on website will show the rating chatter
This commit moves all the events from willstart to start because the widget is not able to find $el in willstart so events will not bind.

(PR #22626)
2018-01-30 14:44:38 +01:00
Martin Trigaux ed54418d62 [FIX] maintenance: translate team name
If the name of a crm.team is translated, why not the one of a maintenance.team

opw-805838
2018-01-30 14:42:09 +01:00
Martin Trigaux 5ae494f2bb [FIX] stock: more flexible xpath
If you have stock installed before 0322f6e5 and try to install stock_account
today, the installation fails.

Should not rely on a field added after the stable freeze

Fixes #21823
opw-802767
2018-01-30 14:35:25 +01:00
Thibault Delavallée ba5133dc63 [IMP] mail: add two performance tests
This commits adds two tests in test_mail performance tests related to
the write operation. Indeed create a often tested but there are less
performance tests related to the write. Those two tests are

 * first one is a simple write on a chatter-enabled model without any
   tracking or specific feature; nothing should happen when performing
   a write in that kind of model;
 * second one is a write on a complex tracking-enabled model linked to
   templates and auto subscription. It allows to have some figures for
   real world use case.
2018-01-30 14:23:04 +01:00
Xavier-Do 3ac2e42a3a [IMP]portal: remove is portal flag
The is_portal flag was used before to define if a group is a portal group. This is not true anymore since the default portal group should be used for this purpose. All logic associated to this flag can be removed.

TASK: 47937
2018-01-30 11:43:33 +01:00
Thibault Delavallée f408fffbc0 [DOC] test_mail: update performance counters after last commits
Due to last commits that aim at improving Odoo performance all complex
tests of test_mail now take less queries to execute. Counters are
updated to match the current runbot behavior.

There is quite a big improvement when posting using a template compared
to other tests. As there are not enough tests to ensure all results
are correct let us stay careful by saying "it seems there are
improvements".
2018-01-30 10:42:55 +01:00
Nicolas Lempereur 109ecd5205 [FIX] web_editor: firefox RTEWidget if hidden
It seems that firefox has some difference of behavior from other
browsers as said in:

- https://bugzilla.mozilla.org/show_bug.cgi?id=548397
- https://github.com/whatwg/html/issues/1813
- https://github.com/w3c/csswg-drafts/issues/571

It seems that at least in one instance (a html field hidden on the pos
configuration), firefox fails because of something similar:
window.getComputedStyle(element) returns `null` instead of the element
styles.

In my tests, using the parent window (possible if current frame and
parent have the same origin which should be the case) worked in this
instance, this is examplified by this jsfiddle:
 https://jsfiddle.net/Lpv898ve/2/

This work with window.parent and not using window directly.

So this commit adds fallback on doing getComputedStyle from the parent
window (when testing on chromium this gave exactly the same result that
before).

opw-813363
fixes #22211
closes #22610
2018-01-30 10:37:53 +01:00
Martin Trigaux 622b1d2370 [I18N] l10n_be_hr_payroll_fleet: export translation source terms
Will not be published on Transifex as for Belgium only

opw-805838
2018-01-30 09:39:08 +01:00
jem-odoo 8f94e542e3 [MERGE] sale,sale_*: computation of delivered quantity on sale line
This commit refactors the computation of the delivered quantity
on sale order line, using a computed field and a manual field.
This quantity is automatically computed when using stock moves,
timsheet or expenses (through analytic line).
This simplify code, avoid having trigger in `create` and `write`
method of many models, ...

Once this big clean done, we wanted to go futher and clean the
reinvoice flow for analytic line (vendor bills and hr expenses)
by :
- using the reinvoice policy has it should be
- flagging sale order line generated from expenses
- clarify 'reinvoice policy' and 'can be expensed' fields usage
- erase some usability issues (with onchanges and views reoganization)

This commit also add tests suites for reinvoice flow, and
delivered quantity computation.

See sub commits for more details.
Thanks @rco-odoo for the onchange fix, and @tde-banana-odoo for its
review.

Task 40226
2018-01-30 09:20:41 +01:00
Nicolas Martinelli 14c6968224 [FIX] point_of_sale: data translation
- Create a product with name 'EN' in English and 'FR' in French
- Connect to the POS interface with a user having the French language
  set up.

The product name is loaded as 'EN' instead of 'FR'.

The language is missing from the context of the `search_read` calls.
Therefore, the product names (as well as categories, UOM...) are loaded
in the default language.

opw-805431
2018-01-30 08:53:58 +01:00
jem-odoo 5b42cf64b3 [IMP] product: cost price field place on form view
Since we need to set the cost price when reinvoicing
'at cost, the field should be displayed almost
everytime.

This commit is thus a partial undo of 6ba6ff8e8c
2018-01-29 17:16:27 +01:00
jem-odoo 6eed6a503b [IMP] sale_timesheet: class tests
This commit adds tests for reinvoicing flow,
to check reinvoice service does not generate
task/project and delivered quantity still
depends only on analytic entries and not
timesheet.

This commit also unify tests in sale_timesheet,
by making them extend the sale common class.
They are now launched at module installation.
2018-01-29 17:16:27 +01:00
jem-odoo d6ff8ddb97 [IMP] sale: tests for reinvoice flow
Since the reinvoice policy and delivered quantity fields
on SOL have been refactored, it is now time to provide
some tests for the new reinvoice flow.

The reinvoice test should be execute at install, since
delivered quantity computation change when stock/service
are installed. They should provide their own test suite
for reinvoicing flow. Here, we test the vendor bill
mecanism: setting an AA on invoice lines will create
SOL when validating invoice.
2018-01-29 17:16:27 +01:00
jem-odoo 75995f5965 [IMP] sale,sale_*: correct use of expense_policy
A product can be sell or expense, but for some cases the product
configuration make both flow incompatible. Indeed, when expensing
the delivered qty was computed based on the AAL total amount, and
manually editable.
Before the delivered qty refactoring, reexpensing erased the manual
value.

This came from the fact product expense policy is wrongly used: the
delivered qty of expensable product is not manually editable, which
is a problem for milestones (and other consumable product when stock is
no installed).
The new refactoring of deli qty API force the expense line to be
completely
readonly, but the problem is not completely solved; we still can't sell
properly a expensable product.

To do so, the SO line must be flag as coming from an expense or vendor
bill, and the reinvoice product policy should only be used to calculate
the price of new SO line.

This commit:
1) reinforces the readonly caracter of expense SO line, by making the
expense policy independent of the computation method for delivered qty
on SOL.
2) prevents generate picking when updating ordered quantity on a expense
SOL with a stockable product.
3) allows service to sell a task with zero hours as ordered quantity.
(it still prevents task/project creation for expense SOL).
4) does not increment anymore an existing line when expensing product
at sales price and invoicing at 'delivered qty'. The only line to be
incremented will be the expense line (and not the native SOL).
2018-01-29 17:16:27 +01:00
jem-odoo aaced1542c [IMP] sale,hr_expense: reinvoice policy and 'can be expensed'
Impacted modules: sale, hr_expense, sale_stock and
sale_expense.

The reinvoice policy has nothing to do with the
fact a product can be expensed or not by employee,
because of the vendor bills use case.
You can only choose reinvoice policy of your product
when hr_expense is installed, which is not very intuitive
for users. So this commit makes reinvoice policy field
always visible when sale is installed. 'can_be_expensed'
field determines if the product can be used in HR expense.

However, since reinvoice policy does not make much sense
for stockable products, we hide this option and reset
it to 'no' when sale_stock module is installed, as we
don't handle stock for those expensed products (when
confirming expense, the product is already delivered).
2018-01-29 17:16:27 +01:00
jem-odoo 9b04a2448b [IMP] sale_expense: add stat button on SO
We want to see the related expenses from employee
linked to the current SO, even the ones having
no reinvoice policy (so no SO line created) for
reporting purpose.
We can not group them by SO line yet, it could be
a futur improvement.
2018-01-29 17:16:27 +01:00
jem-odoo 3bf8a62e0d [REF] sale,sale_*: delivered qty API
Impacted modules: sale, sale_timesheet, sale_expense, sale_stock
and sale_mrp

This commit uniformizes the API of computing the delivered quantity on a
SO line for expense, manual, service and stock lines.

The delivered qty of so line can be computed differently. This is the
role of the 'qty_delivered_method' field:
- manual: the quantity is set manually, when creating or editing the
line
- analytic: handle in sale module, the quantity is the sum of the
unit_amount of analytic lines coming from expense or vendor bills
- timesheet: handle by sale_timesheet module, the quantity of a product
service with timesheet is compute as the sum of the hours of timesheet
lines linked to the SO line.
- stock_move: handle by sale_stock module, the delivered quantity comes
from the validated pickings of the SO line, for stockable or consummable
products.

When the computing method is 'manual' the value is stored in
'qty_deliverec_manual' field. This field is 'technical' and should not
really be used, as the real field to read/write is 'qty_delivered'.

To extend the mecanism of computing delivered quantity on SO line, a
module should provide its own method for 'qty_delivered_method' and extend
'_compute_qty_delivered' method to compute the effective quantity.
2018-01-29 17:16:27 +01:00
rco-odoo 5f660cdb28 [FIX] models: avoid wild prefetching when serializing onchange results
We fell on a strange situation in method `onchange`, where some data was
missing from cache when serializing the result. In that case, the
prefetching
overwrites so many stuff in cache that the results of the onchanges are
lost.
Don't let that happen.
2018-01-29 17:16:27 +01:00
Thibault Delavallée 2f7593761c [MERGE][REF] mail, various: move email notification templates from jinja to QWeb
This merge changes the templates used to send notification emails. They
are currently defined as mail.template using jinja. We choose to make
them QWeb views. There are several reasons to do so

 * those are not real mail.template records. Indeed they cannot be used
   outside of the notification process as some values are computed
   and not available on the mail.message record used to render the
   template;
 * we do not really need other fields than body. Indeed fields like
   subject, email_from or email_to are computed from the notification
   process;
 * we do not want people to update the mail.template without knowing
   the consequences, especially for fields like recipients that may
   broke the mail gateway;
 * using the html editor easily break the mail.template as it is very
   custom and very to break without really realizing it.

It also simplifies template management as it lessens number of mail
templates people have in their list view of mail.template. It avoids
mixing technical and functional templates.

We move to QWeb templates as those are not too hard to customize and
allow to perform body rendering which is what we really need when
notifying people of a new message.

This merge also factorize the "custom layout" used in several addons
to use a single secondary template defined directly in mail. Indeed they
are using the same template. Therefore having it defined only once helps
editing or fixing it.

Please see sub commits for more details about the merge.
2018-01-29 17:06:26 +01:00
Thibault Delavallée 885e7fcda9 [REF] various: use secondary notification template
All those templates are basically the same except some bug fixes that
were not propagated about company. Let us use just the one we just
defined in the mail module.
2018-01-29 16:56:04 +01:00
fda-odoo 11effd7bd1 [IMP] project: remove task stat-button if there is no task linked to project
We shoud not display stat_button tasks on project kanban card if there is no task linked to the current project
2018-01-29 16:54:42 +01:00
fda-odoo 6fc2cc65d9 [IMP] web: rename o_project_kanban_colorpicker to generic name
o_project_kanban_colorpicker had its less file in web module. As we need it in helpdesk too, I rename it to o_no_padding_kanban_colorpicker.
2018-01-29 16:54:39 +01:00
fda-odoo 276cb317c3 [IMP] rating: text alignement and comment title for feedbacks
Aligne Satisfaction text under the smiley on the rating form view, and add the "Comment" title above the comment of the customer
2018-01-29 16:54:36 +01:00
Thibault Delavallée 2f6a661fe9 [REF] mail: add a secondary notification template in mail
Various modules use another template when sending notification emails
for some specific case. For example sending sale orders or invoices
using the 'Send by email' button encapsulates the content in a layout
different from the base one.

As all modules basically uses the same copy-and-pasted template we choose
to define another email template directly in mail.
2018-01-29 16:54:18 +01:00
Thibault Delavallée 0f301bec25 [REF] mail: move email notification templates to QWeb
In this commit we change notification templates used to render
notification emails from jinja-based mail.template to pure QWeb
templates.

There are several reasons to do so

 * those are not real mail.template records. Indeed they cannot be used
   outside of the notification process as some values are computed
   and not available on the mail.message record used to render the
   template;
 * we do not really need other fields than body. Indeed fields like
   subject, email_from or email_to are computed from the notification
   process;
 * we do not want people to update the mail.template without knowing
   the consequences, especially for fields like recipients that may
   broke the mail gateway;
 * using the html editor easily break the mail.template as it is very
   custom and very to break without really realizing it.

It also simplifies template management as it lessens number of mail
template people have in their list view of mail.template. It avoids
mixing technical and functional templates.

We move to QWeb templates as those are not too hard to customize and
allow to perform body rendering which is what we really need when
notifying people of a new message.

This commit does not change the functional purpose and layout of the
templates. Behavior should be the same before and after this commit.
2018-01-29 16:48:23 +01:00
qsm-odoo 81ae0a862a [MERGE] *: convert sass files to less files
* note, payment, sales_team, website_forum, website_sale(_options)

Get rid of the remaining sass files and their corresponding css files
and convert the meaningful ones to less files. Ironically, this is done
in prevision of converting all less files to scss (a sass syntax).

One sass file remains though: description.sass. This file is indeed
particular and needs more work to be correctly converted (odoo.com/apps
semi-depends on it and the file is not used in an asset bundle).
2018-01-29 16:37:02 +01:00
Thibault Delavallée d1ec600c43 [IMP] mail: move custom_layout context management in wizard
Purpose of this commit is to clean the use of custom_layout in context
in order to have more explicit argument.

Several mail.compose.message instances are called using the
custom_layout magic key. As this parameter is now managed directly
by message_post API we can remove its management in the notification
process and add it explicitly in the wizard's message_post call.
2018-01-29 16:35:36 +01:00
Thibault Delavallée cae1c3977f [REF] mail: rename notification methods and make them private
Purpose of this commit is to perform a light cleaning of the email
notification process. It renames method by prefixing them by _notify
in order to easily spot them. It also makes them private because they
should not be called outside of other methods. Indeed those methods
are technical and do not provide useful information to external
people.

Future commits will probably improve the notification process in order
to clean it and try to reduce its query count.

This commit perform the following renaming

 * message_get_email_values -> _notify_specific_email_values
 * message_get_recipient_values -> _notify_email_recipients
 * _message_notification_recipients -> _notify_classify_recipients
 * message_get_reply_to -> _notify_get_reply_to
2018-01-29 16:33:07 +01:00