Commit Graph
117975 Commits
Author SHA1 Message Date
Priyanka Kakadiya 7f632f909e [FIX] website_forum : fix karma alert-box position
Currently, if user does not have enough karma to perform specific action on
forum, alert-box with appropriate message is displayed to the user.

There are several issues with these alert-boxes, like :
- Click on same CTA multiple times, creates multiple alerts
- Click on another CTAs keeps previous alerts on the screen, and adds
  further alerts, which sometimes overlaps adjacent CTA and looks ugly.

After this commit :
- Alerts are displayed below their related CTAs
- Only one alert appears at a time on the screen

Fixes : #23071
PR    : #23800
Task# : 1829835

This commit closes #23071
This commit closes #23800
2018-05-08 12:38:13 +02:00
Arnold Moyaux 4591b9a49a [FIX] delivery: test robust to installed localization
related to 9e5c1f68a5

opw-1841170
2018-05-08 12:02:34 +02:00
jem-odoo 1591d3e19e [FIX] sale_timesheet: SO line of subtask
When creating a subtask (or a task), parent_id is passed in the create values.
Howver, when the task is not a subtask, we might want to set the SO line directly
and not erasing it with the one from the inexisting parent. So the values of
parent_id is required to force the so line value when creating a task.

Closes #24592
Closes #22707
2018-05-08 11:18:03 +02:00
jem-odoo aee95705d2 [FIX] sale: normalize domain is smart
When manipulating domain, this is always better to
normalize them, otherwise we can have strange behavior
when handleing them with `expression.OR` and
`expression.AND`.

For instance:
domain = [('so_line', 'in', [91]), ('amount', '<=', 0.0)]
timesheet_domain = ['&', ('so_line', 'in', []), ('project_id', '!=', False)]

`expresion.OR(domain, timesheet_domain)` will give
['|', ('so_line', 'in', [91]), ('amount', '<=', 0.0), '&', ('so_line', 'in', []),
('project_id', '!=', False)]

And this is not what we attempt.

Closes #24038
2018-05-08 11:17:54 +02:00
Nicolas Martinelli a0f8a06079 [FIX] website_sale: fallback on payment term
If `account.account_payment_term_immediate` doesn't exist, the `.id`
will crash.

opw-1841141
2018-05-08 09:27:38 +02:00
Nicolas Martinelli 5a1c789861 [FIX] web_editor: drag and drop
Commit 6494f51171 introduces an access token to read images inside an
email. This avoids access errors when accessing the email through a
proxy (e.g. Gmail). That implies that all images are added as
attachments.

When going through the usual media dialog, the form is submitted to
action '/web_editor/attachment/add', creating the attachment. However,
the copy or the drag and drop of an image completely fails. Indeed,
the same method `_onImageUpload` is called, but with a completely
different argument type: `attachments` is a `FileList`, not a list of
attachments.

To solve this, we only call `_onImageUpload` on a the custom `onUpload`
callback, which is not triggered during a drag and drop or a copy. Any
image included thanks to these methods will be post-processed in the
`create` method of `mail.message` (`base64_to_boundary`).

Unfortunately, it's not possible to simulate an actual drag and drop or
a copy, so we cannot add a test.

opw-1840237
opw-1840411
2018-05-08 08:58:22 +02:00
Aaron Bohy 013baed413 [FIX] web: navigate through records in Kanban with progressbar
Recently, rev. c0809dd41 removed a protection in the reload of
Kanban views with progressbars. This protection ensured that the
manual reload of the progressbars was only done when one of the
records of the Kanban view was updated (and not when a column, or
the whole view was).

However, removing it highlighted a bug linked to the manual reload
of progressbars, which messed up the list of ids in the
environment. As a consequence, for instance, if the user archived
the records of a column, and then opendc a record in form view,
it couldn't use the pager anymore.

Besides fixing this bug, this rev. re-introduces the protection,
and refines it to prevent 2 useless RPCs when the whole Kanban
view was reloaded.

opw~1841276
opw~1841342
2018-05-08 08:39:23 +02:00
Christophe Simonis 9d6ea8ef3e [FIX] api: do not prefetch new records.
New records (with a NewId) are not necessary in the cache, but should
not be prefetched.
This check has been omitted during optimisation in b0c08a6846.

opw-1843566
opw-1843636
opw-1843683
opw-1843548
opw-1843629
opw-1843657

Closes #24595
2018-05-07 18:58:27 +02:00
odooqs 55891b6f4e [FIX] base: place CNY symbol in front of the number
cf Currency section in
https://lh.2xlibre.net/locale/zh_CN/

Closes #24609
2018-05-07 17:36:44 +02:00
Denis Ledoux da6b4add23 [FIX] account: avoid cache invalidation at the opening of an invoice
* Avoid to invalidate the cache if no actual deletion has been
made when recomputing the taxes

* Avoid to create analytic entries to delete them right away
few lines further in the same method:
 - Analytic entries are created at line 903
   - account_invoice.py:751 `move_line_dict['analytic_line_ids'] = [(0, 0, line._get_analytic_line())]`
   - account_invoice.py:840 `iml = inv.invoice_line_move_line_get()`
   - account_invoice.py:886 `line = inv.group_lines(iml, line)`
   - account_invoice.py:894 `'line_ids': line,`
   - account_invoice.py:903 `move = account_move.with_context(ctx_nolang).create(move_vals)`
 - Then, at line 907, they are deleted and others are created again:
   - account_invoice.py:907 `move.post()`
   - account_move.py:130 `move.line_ids.create_analytic_lines()`
   - account_move.py:1258 `self.mapped('analytic_line_ids').unlink()`
   - account_move.py:1262 `self.env['account.analytic.line'].create(vals_line)`
  Deleting these analytic entries indeed implies the invalidation of the cache.
  Besides, generally speaking, we should avoid to waste resources
  by creating/unlinking records without a good reason.
2018-05-07 17:02:02 +02:00
Denis Ledoux a8ab14a672 [FIX] stock: prevent to create the reception route over and over when deleted once
When the reception route of a warehouse company is deleted by the user
e.g. My company, Chicago Receipt in 1 step is deleted,
and then changing the given warehouse `Incoming Shipments`
multiple times
e.g. from `one_step` to `two_steps` multiple time,
the reception route is created again and again and again.

This is because the reception route which is created for the
warehouse is not being assigned to the warehouse
as the `reception_route_id` once newly created.

opw-1836544
2018-05-07 17:02:02 +02:00
Priyanka Kakadiya 5a05381a1d [IMP] base: rename mass mailing into email marketing
Users will be more likely to look for a module named email marketing
than they would be searching for a module named mass mailing.

Task #1825294
Closes #23634
2018-05-07 17:00:37 +02:00
Prakash Prajapati 7c7b099273 [FIX] stock: Quantity available according to the warehouse or location
The goal of this change is not to be able to search a location_id/warehouse_id
but to properly make these fields "dummy": only used to put some keys in context
from the search view in order to influence computed field.

Use case:
In function _compute_quantities_dict, the quantity available for a product is computed
according to the warehouse or the location. But to compute this quantity, the specific
warehouse or location must be in the context.

Steps to reproduce:

- In the tree view of product.product, write the name of a warehouse W
- Click on dropdown menu "Search warehouse"
- Click on W

Expected behavior: the quantities available for W are displayed.

NB: search=lambda operator, operand, vals: [] must be written to
ensure these fields to be searchable. Otherwise "Non-stored field
product.template.warehouse_id cannot be searched." was logged.

opw:1839961
2018-05-07 15:41:31 +02:00
Christophe Matthieu b8006bfb1c [FIX] mail tools: html_sanitize must keep useful styles from mass mailing
Issue: The clean removes too many tags so emails sent do not resemble the
preview.

opw-1841138
opw-1841105
2018-05-07 15:34:40 +02:00
Josse Colpaert 468e2e454e [FIX] sale: creating invoice name from SO ref
Steps to reproduce the bug:

- Create a SO with 2 lines and confirm it
- Set a Customer reference on the SO with "This is, a ref"
- Deliver it
- Create an invoice from it with all the invoicable lines

Bug: The name of the invoice was: "This is, a ref, This is, a ref"

Expected behavior: The name of the invoice is: "This is, a ref"

opw:1840738
2018-05-07 15:19:32 +02:00
chirag cf1b1b6e2c [FIX] l10n_multilang: overwrite existing translations
When a record is created in a different language than English, empty
translations are created using the _set_ids method for translatable fields.

l10n_multilang makes the account translatable, an empty translation is created
when the CoA data is processed.

After the CoA installation, l10n_multilang transfer the translations of the
account templates to the related accounts.

No need to create translation terms again, use _set_ids to update the existing
translations.

This will prevent a cause of translation duplication, forbidden in the future by
160d657704

opw-1832071
Closes #24158
2018-05-07 14:43:28 +02:00
Randall Castro 9da8378a0a [FIX] l10n_cr: adapt state code
Change res.country.state code to follow ISO 3166-2:CR
https://www.iso.org/obp/ui/#iso:code:3166:CR
2018-05-07 13:46:47 +02:00
xmo-odoo 0767d35805 [IMP] base_automation: warn when using on_change trigger w/o "code" type
Task 37742

closes #21446
2018-05-07 13:31:45 +02:00
Pierre Masereel 0ae3e5a8b4 [FIX] stock: change uom on product constraint
When we change the the uom of a product, a user error is triggered if
there are already moves created for this product. But if the product is
archived, the call to mapped('product_variant_ids') doesn't return any
product ids, so no moves are found and you can change the uom.

To fix this behaviour that can lead to bad configurations, because
quants and moves won't be in the same unit than the product's one.
2018-05-07 13:22:14 +02:00
Christophe Simonis 89819c6f42 [MERGE] forward port branch saas-14 up to 1f74b878f4 2018-05-07 12:21:05 +02:00
Christophe Simonis 1f74b878f4 [MERGE] forward port branch 10.0 up to 0aeb92ccbc 2018-05-07 11:54:15 +02:00
Christophe Simonis 0aeb92ccbc [MERGE] forward port branch 9.0 up to 4e5119c6e5 2018-05-07 11:47:44 +02:00
xmo-odoo 4e5119c6e5 [IMP] warn when using logrotate in multiprocess
The built-in log rotation is *very* unreliable in a multiprocess
context, which can lead to significant data loss (up to hours of log
missing) right after rotation[0][1].

Technically, according to the cookbook even filehandler does not
support multiprocess logging[2].

Either way, we should at the very least warn that logrotate is a Bad
Idea in multi-workers scenario. Ideally we'd just fall back on regular
file/stream logging but that likely could & would break existing
deployments, so maybe implement that for master instead?

Alternatively: implement it properly in multi-worker scenario with
only the "root" process actually logging to whatever output was set
up, and all workers sending stuff to log to it via a queue or network
socket or w/e.

[0]
https://stackoverflow.com/questions/34186774/why-doesnt-timedrotatingfilehandler-work-properly-and-how-to-solve-this-issuer
[1] https://github.com/odoo/odoo/issues/16566
[2] https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes
2018-05-07 11:24:06 +02:00
Christophe Simonis a10240c019 [MERGE] forward port branch 9.0 up to d13ce05c96 2018-05-07 11:02:00 +02:00
Thibault Delavallée 324ae5ed8f [REF] mail: get rid of thread_model context key
message_post and various mail.thread related code still support a thread_model
context key allowing to redirect message post on another model. Purpose of
this commit is to get rid of that context key and support model / res_id
fields coming from either the record on which we run, either parameters of
message_post. Indeed those parameter match the one used as fields on mail
message. It makes sense to support them for customization if necessary
instead of using a context key.

This context key exists since a lot of time. It is difficult to find the
source as history is quite complex when the mail was refactored in 2012.
See notably 6aa4f80b2d and 2c4ed841b9 for example.
2018-05-07 11:00:03 +02:00
Thibault Delavallée 282733cf8d [REF] mail: make notification methods semi-generic
mail.thread mixing class defines several methods used in notification process
that are not specific to mail.thread enabled models. It means some models
could override it while some other models do not even have a direct access
to that method.

When calling those methods we have to manually check for method being
available on a record or call a default implementation from mail.thread
even if the model does not inherit from the mixin.

In this commit we propose to hide this check in generic wrappers located
in mail.thread class. It checks for method existence on record and call
the model-specific implementation or falls back on standard behavior. It
allows to be sure the right method is called.

Functionally behavior should stay globally the same. However when updating
some addons code has been updated. Previous code could lead to records not
having correct alias which should not be the case anymore. This commit is
linked to task ID 47934.
2018-05-07 10:58:54 +02:00
qdp-odoo f5ab17dd53 [FIX] base_vat_autocomplete: vat field label on res.company form view 2018-05-07 10:40:00 +02:00
Nicolas Martinelli 3c743440fd [FIX] account: default partner
- Go on the partner form view
- Click on the stat button 'Invoiced'
- Create an invoice

The partner is not filled in.

Overlook of 1f277a3572

opw-1839867
2018-05-07 10:38:05 +02:00
Christophe Simonis 78e25605ed [FIX] hr_expense: correct demo data about product category 2018-05-07 10:27:18 +02:00
Yannick Tivisse 6cb5052e85 [FIX] fleet: Fix the _name_search override on fleet.vehicle
Actually _search return a list of ids, not a browse record.
2018-05-07 10:11:58 +02:00
Yannick Tivisse 9e261d0f7d [IMP] l10n_be_hr_payroll: Store the Employee Budget 2018-05-07 10:11:58 +02:00
Yannick Tivisse 5731c10a69 Revert "[IMP] hr_contract: Improve the contract tree views"
This reverts commit ec929342eb.

This wasn't the expected result :)
2018-05-07 10:11:58 +02:00
Jeremy Kersten 612cf8acbf [IMP] website_forum: don't index private profile 2018-05-07 09:09:38 +02:00
Jeremy Kersten 6a0274b300 [FIX] website_sale_[wishlist|comparison]: don't try to add 'undefined' product
In case of a combinaison is not possible, the add to should not be shown.

This commit is related to #23397
2018-05-07 09:09:38 +02:00
Odoo Translation Bot 71419844b3 [I18N] Update translation terms from Transifex 2018-05-06 07:03:46 +02:00
Odoo Translation Bot 98a74c613b [I18N] Update translation terms from Transifex 2018-05-06 04:11:15 +02:00
Odoo Translation Bot 370ed2b66f [I18N] Update translation terms from Transifex 2018-05-06 00:26:43 +02:00
Fabien Pinckaers a5c614db57 [IMP] account: name_search / name_get symetry on account.account
That way, pressing down on a many2one already filled will not propose
to create a new account: "20000 Sales Account" should name_search it.
2018-05-05 08:56:30 +02:00
dip-odoo 362613a2fa [IMP] auth_signup: change email invitation condition
Currently if a user has already been invited you cannot invite him again
via the web_settings_dashboard as it automatically tries to create a new
user.
This commit changes that behaviour in case you have the mail app
installed odoo will now send an invitation email to the invited user as
long as this user has never connected.

1) Mail app not installed:
   - if user is active     > display error (this email is already in use)
   - if user not active    > activate the user
   - if user doesn't exist > create new user

2) Mail app installed:
   - if user is active && state confirmed > display popup (this email is
   already in use)
   - if user is active && never connected > resend invitation mail
   - if user is inactive > activate the user
   - if user doesn't exist > create new user and send invitation mail

This commit is related to task #54023
Closes #23081
2018-05-04 18:07:31 +02:00
Christophe Simonis aeef0c5973 [FIX] hr_expense: remove duplicated defined records 2018-05-04 17:57:45 +02:00
Alexandre Kühn 0275c70f78 [FIX] mail: fix composer style for chat windows
Revision on dd8e95cb1a12603940cc32a3d840b6097515df85

The intent of the commit above was to fix the style of the composer,
which was broken when turning the textarea input into a contenteditable
div. While fixing the style for the composer in Discuss or in the Chatter,
it misplaced the initial position of the caret in a chat window.

This commit fixes the issue on chat windows, while also improving the
previous fix.

Known issues:

    In a chat window with more messages than it could be displayed at once,
    when at the bottom of the thread, the line separator of the composer
    and the thread is off by 1 or 2 pixels (vertically).

    > Fixing this issue breaks a lot the alignment of items in the composer
      of Discuss and Chatter, so this small visual glitch is preferred.
2018-05-04 17:23:36 +02:00
Alexandre KühnandNick Booker c3ce712359 [FIX] web: correctly display filename when uploading a file
Before this commit, we had the following issue with binary widget in a form:

Suppose we have a binary field with filename attribute set. When uploading a
new file 'temp.txt' with content 'Cg==', the displayed value is 'Cg=='. When
the changes are saved, the displayed value becomes 'temp.txt'.

It should always display 'temp.txt', which is what is fixed by this commit.

In addition to fixing this issue, we describe what is the expected displayed
value of a binary field. This is based on whether the attribute filename is
provided, and whether the record is in edit or read-only mode.

Fixes #21630
Closes #24275

Co-authored-by: Nick Booker <nick.booker@opusvl.com>
2018-05-04 17:10:29 +02:00
Olivier Colson d13ce05c96 [FIX] account: use company currency in _compute_matched_percentage in case no currency is set on account.move
When a move or move line is supposed to use the company currency, its currency_id field is empty. _compute_matched_percentage did not take this into account, causing the rounding method to sometimes be called with a precision equal to False, resulting in erronous and weird behavior (0 was considered different from 0, causing a division by zero in the following condition).
2018-05-04 16:43:41 +02:00
Christophe Simonis ac63dfc8f4 [MERGE] forward port branch 11.0 up to 8dade01e2c 2018-05-04 16:10:50 +02:00
Christophe Simonis 8dade01e2c [MERGE] forward port branch saas-15 up to 333a58e4ef 2018-05-04 15:13:49 +02:00
Arnold Moyaux 972d8a1108 [FIX] mrp: tracked by product with routing
Use case to reproduce:
- Create a BOM with a byproduct tracked and a routing
- Mark the last workorder as done
- by products move line are not created
With the wizard produce (MO without routing) move lines
are created. Thus there is an inconsistency.

It happpens because workorders and produce button do not use
the same function. commit 1a09bcc622
already fix it for production wizard however it forgets workorders
process.

opw-1838707
2018-05-04 15:03:49 +02:00
Arnold Moyaux aab2ceefec [FIX] stock: prevent to create the reception route over and over when deleted once
When the reception route of a warehouse company is deleted by the user
e.g. My company, Chicago Receipt in 1 step is deleted,
and then changing the given warehouse `Incoming Shipments`
multiple times
e.g. from `one_step` to `two_steps` multiple time,
the reception route is created again and again and again.

This is because the reception route which is created for the
warehouse is not being assigned to the warehouse
as the `reception_route_id` once newly created.

_update_routes should work the same way than _create_routes,
it should return new value to write on the warehouse.

based on preliminary by Denis Ledoux

opw-1836544
2018-05-04 14:20:37 +02:00
Christophe Simonis 333a58e4ef [MERGE] forward port branch saas-14 up to 4e90a676da 2018-05-04 14:19:53 +02:00
Nicolas Lempereur 2b0d68bc41 [FIX] mail: activity in date tz but counts are not
When creating an activity, the date saved will be the choosen one in the
tought in the client timezone.

But when displaying the counts of activities Late/Today/Future, the date
is tought out as the one in the server timezone.

Thus we would have activity today/future/late not corresponding with the
date in the current timezone.

This is solved in this change and follow what was done in 72254129.

A second change is made so the default "Due date" is today in the
timezone and not today in UTC date.

opw-1837894
closes #24554
2018-05-05 00:38:35 +13:00
Nicolas Martinelli c3ddef161e [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.

note: this commit reintroduce the fix c52b18e65 which was lost after
changes in 10.0 (line was removed then brought back with 416d07f0b).

opw-805842
closes #24569
2018-05-04 01:33:55 -10:00