Commit Graph
126133 Commits
Author SHA1 Message Date
Martin Trigaux 339bf145ce [FIX] base: allow languages with iso code of size 6
Some languages like kabyle ou filipino have the iso code kab_DZ and fil_PH
It was not possible to import it.

closes odoo/odoo#31332
2019-02-21 15:51:03 +00:00
Nicolas Martinelli 22a935afd3 [FIX] mrp: clean variant
- Create a product with variants
- Create a BOM for this product
- Add a component, specify a variant in 'Apply on Variant'
- Change the product of the BOM

The 'Apply on Variant' fields remain filled, although it doesn't apply
anymore to the new product.

opw-1943918

closes odoo/odoo#31435
2019-02-26 14:34:16 +00:00
Nicolas Martinelli 489222e373 [FIX] mrp: domain on variant
Make sure there is a product set before searching the attributes, otherwise
it crashes.
2019-02-26 14:34:16 +00:00
Nicolas Lempereur 05533ceda6 [FIX] mail: link mention if it is still working
In some special instance, a mention could get linked and the user would
not really be linked.

This is because of a difference between linking the mention and adding
the user as follower that required a space after the mention.

With this change:

- `[adding mention]@admin [backspace].`: was linked but not added as
   follower => now it is not linked either.
- `[adding mention]@admin [backspace][enter][adding mention]@admin `:
   the first @admin was linked => now the second is linked

Without the change, added test fails with:

 "should not contain a link in the message content"
 "should not have linked mention without space"

opw-1934946
closes #31433
2019-02-26 14:46:25 +00:00
Xavier Morel e36ad5b0b0 [FIX] core: handling of o2m record deletion in SSF
The SSF would properly mark its own records as deleted, but it would
not properly handle deletion requests coming from an onchange, and it
would not necessarily convert DELETE_ALL commands (5) into the proper
sequence of individual (2)s matching existing records.

closes odoo/odoo#31431
2019-02-26 13:18:57 +00:00
Lucas Perais (lpe) ca6d495ebf [FIX] portal: portal share default get
Before this commit, we used dict keys before they existed
And made the share button crash

After this commit, there is no crash

OPW 1943301

closes odoo/odoo#31427
2019-02-26 12:18:18 +00:00
Nicolas Lempereur 08b2d1f9ac [FIX] web: margin-top on top of report
The margin-top/margin-bottom on a address on the top of the report does
not work because:

- display flex on an address in wkhtmltopdf is not perfectly implemented
  and seems to remove vertical margin
- margin-top on the page first visible element is removed

To fix this issue, this code remove the display:flex on the address
widget and add an empty "visible" element at the start of pages.

opw-1925894
closes #31184
2019-02-18 10:46:41 +00:00
Lucas Perais (lpe) 6af6da5c59 [FIX] sale: mail notification pay now translatable
Before this commit, the template that was rendered when sending
an email to a customer to invite hime to pay online
was not translatable
This was because the override of the template did not have an xml_id

After this commit, it is translatable

OPW 1944258

closes odoo/odoo#31396
2019-02-25 09:18:49 +00:00
Julien (juc) Castiaux 01405ca1ab [FIX] account: currency of reconci. suggestion
When the currency used for a payment/internal transfert is not the same
as the company currency, the prices shown in the reconciliation
suggestions are computed using the company currency.

1) Enable multi-currency.
2) Setup two bank, one in USD, the other in EUR.
3) Leave the company currency to USD.
4) Create an invoice for a partner targeting the EUR bank and
   validate it.
5) Create a bank statement for the EUR bank amounting the **exact**
   value of the invoice for the **same** partner and reconcile it,
   this will create the payment behind the hood.
6) In the reconciliation the invoice appears as suggestion, if the
   currency symbol is correct, the amount is shown as USD.

opw-1937202

closes #30623

closes odoo/odoo#31290
2019-02-26 08:23:16 +00:00
Lucas Perais (lpe) 6530f1253d [FIX] web: list editable create then escape
Have an editable list that begins with a date/time field
create a line.
The first field is focused and the datetimepicker is popped up

Now, stroke ESC key

Before this commit, there was a traceback because the datetimepicker received an erroneous
BLUR/INPUT event

After this commit, there is no traceback as we detroy the widgets of the line
(including the datetimepicker) before removing the row from the DOM

OPW 1932409

closes odoo/odoo#31342
2019-02-26 07:07:09 +00:00
Nicolas Martinelli cf6fa5f0e5 [FIX] sale: salesperson
Fallback on the salesperson of the commercial partner if no salesperson
is set on the order partner.

opw-1909177

closes odoo/odoo#31341
2019-02-22 08:07:39 +00:00
Martin Trigaux 06d73eab62 [FIX] models: do not erase master version
For a translated field with a callable method (e.g. xml_translate), when
modifying the value of this field in another language than en_US, the master
version was lost.

Before this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Titre</h1>"
>>> record.arch
"<h1>Titre</h1>"  # lost English version

After this patch:

>>> record.arch = "<h1>Title</h1>"
>>> record.with_context(lang='fr_FR').arch = "<h1>Titre</h1>"
>>> record.with_context(lang='fr_FR').arch
"<h1>Title</h1>"  # write had no effect
>>> record.arch
"<h1>Title</h1>"

When modifying a translated HTML field in English, a matching to detect the
difference and avoid losing the translations is done.
This is not supported for update in another language.
The main reason is the difficulty to detect changes in the architecture.

To update translations, the supported way is to go to the list of translations
and update them there.

Before this patch, the given value in another language was given to the SQL
query and made an update in database:
if single_lang or not (has_translation and field.translate is True)
-> True or not (True and False) -> True

If a field is callable, it should also be ignored, the same way than
translate=True fields

opw-1887162

closes odoo/odoo#31330
2019-02-21 15:13:51 +00:00
Nans Lefebvre c38a0d6768 [FIX] mail: allow to assign an activity to an user currently in another company
Let users A, B be in in companies C1 and C2,
such that A is currently in C1 and B in C2.
User A tries to assign to B an activity on record R belonging to C1.
It fails because at the time of the check B is not in the correct company,
even if B could handle the activity after switching company.

The _check_access_assignation was added in commit 96a223a5f0,
to avoid activities to be created for records that the target user can't read.
Previous use-case is a legitimate one where we want to bypass this restriction.
Note that the systray notification widget is not company dependent,
and there is no way to remove a notification on a record the user can't read.*

In case where the record is company dependent and on a different company,
we skip the record rules check.
It is assumed that the check would fail because or company-related record rules.
It will create some unwanted activities, but only the minimal number we can let
through while allowing for all legitimate flows.

*Better solution for master is to give the user some more explicit message
if reading the record, suggesting to switch company,
or to allow to dismiss the notification altogether.

opw 1933862

closes odoo/odoo#30810
2019-02-22 13:08:16 +00:00
Jorge Pinna Puissant 6b7bb096e1 [FIX] sale: transfer's transaction status in SO
Have a SO; accepted and signed; and the client choose to pay with wire
transfer.

Before this commit, the transfer's transaction is never updated to 'done'.
Even after the invoice is created and the payment is encoded and
reconciled. The client will continue to see the pending message.

Now, when the SO is confirmed, the transfer's transaction is set to 'done'.
The client will see the done message.

opw-1935516

closes odoo/odoo#31352
2019-02-22 10:41:31 +00:00
Yenthe666 cc0e654876 [FIX] doc: replace from_string methods to native datetime calls
closes odoo/odoo#31093
2019-02-25 15:14:09 +00:00
Nicolas Bayet aa5de574aa [IMP] doc: add email gateway documentation
Explain how to use addons/mail/static/scripts/odoo-mailgate.py through
an incoming mail server like Postfix or Exim.

closes odoo/odoo#31363
2019-02-22 12:43:19 +00:00
Lucas Perais (lpe) dd28160c28 [FIX] stock_account: search view for current valuation
Before this commit, it was impossible to search anything in the list view
when doing a Inventory Valuation > Current Inventory

After this commit, a few meaningful fields are searchable

OPW 1943676

closes odoo/odoo#31356
2019-02-22 10:45:12 +00:00
Odoo Translation Bot 917ad03026 [I18N] Update translation terms from Transifex 2019-02-24 01:37:50 +01:00
Jeremy Kersten 96dc825c8c [FIX] website: reset template
fix retro compatibilty

Old qweb template http_error_debug was wrong, but we never entry in the if.
Now that we fixed to enter in the if, we need to make retrocompatible code to
be able to display the QWebException from v9 with the old view from v8.

odoo.exceptions.QWebException
  vs
odoo.addons.base.models.qweb.QWebException

closes odoo/odoo#31383
2019-02-14 13:39:55 +00:00
Nathan de Pryck 9434ee850f [FIX] sale: Correct fiscal position access right
The issue happened when a user which does not have access to some fiscal
position try to print a sale order. In this case a traceback is generated.
In order to avoid the traceback and to be able to print the report
the access rights are bypass thanks to a sudo() in the report.

OPW-1943727

closes odoo/odoo#31357
2019-02-22 10:55:56 +00:00
Jorge Pinna Puissant a1e6a0f0c5 [FIX] account: price_unit report decimal precision
Before this commit, the unit price in the invoice's reports, had the
same decimal precision as the currency and not the one specified for the
unit prices.

Now, the reports shows the unit prices with their specific decimal
precision.

opw-1940406

closes odoo/odoo#31314
2019-02-21 08:35:09 +00:00
Aaron Bohy 7ffe3ce5c6 [FIX] web: kanban: rendering of async widgets
This rev. fixes 3 issues with async (field) widgets in the kanban
view.

From rev. 5faec34a, widget'$el doesn't exist before start. This
means that for async widgets, one can't interact with the widget's
$el right after calling appentTo. In KanbanRecord, this is exactly
what we did for both field widgets (<field name=.../>) and widgets
(<widget name=.../>).

Moreover, when the kanban view was updated (e.g. when the user
refined the search using the search view), and the rendering was
async (because of the presence of an async widget), the renderer
didn't wait at all for the widget to be ready before updating the
view. This caused flickering, mostly, but also a crash in
accounting with the JournalDashboardGraph widget (because
on_attach_callabck was called before the widget was ready). To
reproduce this particular issue, go to accounting, add a filter
that doesn't match any record and save it as favorite (default),
press F5 (no record is displayed), remove the filter.

opw-1925079
opw-1925479

Fixes #30087
Closes #31254

closes odoo/odoo#31327
2019-02-21 13:54:47 +00:00
Lucas Perais (lpe) 6fc08a88ae [FIX] web_unsplash: save image for res_model
Go on the website, create a new product from there
Click on the image to change it, select an unsplash image

Save your product.

Beforer this commit, the image wasn't saved because the qweb field image
did not know what to do with /unsplash/ urls

After this commit, the image is saved on the product (or any object...)

OPW 1936191

closes odoo/odoo#31328
2019-02-22 08:14:10 +00:00
Nicolas Martinelli 27f8bb8913 [FIX] stock: inventory on category
- Create a product category A
- Create a product category A1
- Add a product in A1
- Launch an inventory adjustment on A, and select 'Exhausted Products'

All products (even from other categories) are included.

Since there is no product found in the category `products_to_filter`
and `quant_products` are empty. Therefore, we fall back on
`[('id', 'not in', [])]`, which selects everything.

The root cause is that we don't include child categories. There is no
real point of doing so.

opw-1932192

closes odoo/odoo#31322
2019-02-21 10:41:45 +00:00
Andreas Perhab eb11b465dc [FIX] odoo: fix addons paths on windows with use of normcase
This is necessary to get --dev=xml working on windows, because the xml
import uses normcase in file_open and the case normalized filename is
then used to find the addon path (which was not found before on windows)
With this fix arch_fs is now correctly filled in windows and --dev=xml
works.

closes odoo/odoo#28331
2018-11-01 10:41:58 +00:00
Jorge Pinna Puissant c5a3b607e6 [FIX] website_sale: empty error message
opw-1918450

Before this commit, the error message wasn't shown when a field was
empty.

Now, the error message shows correctly.

closes odoo/odoo#29993
2019-01-07 13:13:47 +00:00
Arnold Moyaux df7953f303 [FIX] stock: unreserve drop all the processed work
Usecase to reproduce(or any other way to lower initial demand on move):
- Build a MO with 5 products to do
- Produce 3
- Update the quantity on the mo to 3
-> All the consumed quantity on move lines is dropped.

It happens because lowering the initial demand on a move
will call unlink on its move lines. (increase it will
update the move's state and reassign if it comes from a supplier)

Instead of dropping and reassign the move in order to change
the reservation, it is possible to directly write the new
reserved quantity on the move lines and that will update the
reservation on qaunt directly. Also we don't want move lines
without reserved quantity and quantity done thus we drop them.

closes odoo/odoo#29941
2019-01-04 13:57:49 +00:00
Odoo Translation Bot e2afb0755d [I18N] Update translation terms from Transifex 2018-11-01 02:44:41 +01:00
Christophe Simonis f6ca72b3ce [MERGE] forward port branch saas-11.3 up to 21eb31d804 2018-10-31 20:43:03 +01:00
Christophe Simonis 21eb31d804 [MERGE] forward port branch 11.0 up to a587325ca7 2018-10-31 19:22:21 +01:00
Christophe Simonis a587325ca7 [MERGE] forward port branch saas-15 up to 00829a0beb 2018-10-31 18:31:53 +01:00
Christophe Simonis 00829a0beb [MERGE] forward port branch saas-14 up to c552e368b3 2018-10-31 17:58:05 +01:00
Christophe Simonis c552e368b3 [MERGE] forward port branch 10.0 up to 93d69933ac 2018-10-31 17:23:32 +01:00
Antoine Prieels (ANP) 96a795f177 [FIX] partner_autocomplete : Do not crash other tests when partner_autocomplete server fails
Add a check to see if we're in test mode that returns an InsufficientCreditError to avoid failing other tests if partner_autocomplete server fails

closes odoo/odoo#28324
2018-10-31 16:11:31 +00:00
Romain Derie 7aa2136938 [FIX] website: avoid using self if not an existing view
web_editor dirty elements are saved by calling the ir.ui.view `save()` method.
As this method is called through call_kw _rpc on the ir.ui.view model, self
is binded to the view which has the `id` sent in the request.

In some cases, when editing a field for example, the id sent is the id of the
field's record (eg: product.template for price field).

In that case, the view binded on self will be the view with the id of the
field's record being edited.

If there is no ir.ui.view with the same ID as the field's record, self won't
exists.
This misbehavior resulted in no error luckily since we only use self to call
ir.ui.view methods without ever using self properties.

Since multi-website 47b00c5d53 overrided the `save()` method and used self.key
it was crashing when the self record did not exists.

This commit will fix that by doing the multi-website check only when it is a
view and not a field that is being edited. (We know that if xpath is set)

opw-1904637

Step to reproduce:
  - Go to a product on ecommerce, eg product.template 13013
  - Edit the product price field, the oe-id attribut is 13013
  - Delete the ir.ui.view that has the same ID than the product (13013)
  - Save -> It will crash since self is binded to "ir.ui.view(13013,)" but it
    does not exists and we try to access key

closes odoo/odoo#28469
2018-11-08 10:52:44 +00:00
Goffin Simon 47959438b6 [FIX] sale_stock: Impossible to ship a kit with different uoms
Steps to reproduce the bug:

- Let's consider three products P1(in Unit), P2(in kg), P3(in Unit)
- Create a BOM kit for P1 whit 1kg of P2 and 1 Unit of P3 as components
- Create a SO with P1 and validate it
- Go to the shipment and validate

Bug:

An error was raised saying:

The unit of measure kg defined on the order line doesn't belong to the same
category than the unit of measure Unit defined on the product. Please
correct the unit of measure defined on the order line or on the product,
they should belong to the same category.

PS: The quantity delivered on a SO line must only be computed for the product
defined on the SO line. Otherwise with a BOM kit, the sum of all its components
was done instead.

opw:1905223

closes odoo/odoo#28460
2018-11-07 08:12:38 +00:00
Julien (juc) Castiaux 60d519b890 [FIX] web: format function missing in percentage widget
The format function was missing for the percentage widget type, so
`field_utils.parse[this.formatType]` (see [1]) resolved as
`undefined` which is not a function and so raised an error when
the user was trying to update the field.

This PR add that parsing function. Both `xx%` and `0.xx` are
understood by the parser and resolve to the correct float value.

opw-1895979

[1] https://github.com/odoo/odoo/blob/e220721a8ee80c02fe5aba5ed8c9f3f4ae54ea97/addons/web/static/src/js/fields/abstract_field.js#L399

closes odoo/odoo#28431
2018-11-08 09:51:38 +00:00
qsm-odoo 566cece592 [FIX] website, *: review auto light and dark colors
* web, web_editor

The logic which chose if the user text color was supposed to be used as
bootstrap "dark" text color or bootstrap "light" text color
(https://github.com/odoo/odoo/commit/8b2dbd1441d6713d9072db03e8d3cb6c2246410f)
was fine when using the default theme with default bootstrap but was not
working as intended in some themes.

This commit also introduces a more accurate and complex method to
determine the correct contrasted color in most cases.

closes odoo/odoo#28468
2018-11-07 17:41:08 +00:00
Julien (juc) Castiaux 8108a60dc3 [FIX] purchase: access forbidden for product image on order line
When a user accesses a PO through the portal thanks to an access token
(without being connected), the product image on each order line is
rendered using the image placeholder with a size of 48x48.

This raises a 403 Forbidden at image retrieval since the access token is
not passed as a parameter. This commit corrects that behavior by sending
the resized image along with the rendering of the template instead of an
url.

Another solution could be to generalize the access token check to any
model in:
https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/models/ir_http.py#L303-L311

But this seems overkill regarding this specific error.

opw-1902741

closes odoo/odoo#28479
2018-11-08 07:37:23 +00:00
Nicolas Martinelli 99a7b44a06 [FIX] sale: reference for Wired Transfer
- Configure custom payment instructions
- Create a SO, send it by email to the client (do not validate)
- As the client, open the link received by email and 'Accept & Sign'
- Click on 'Pay Now', choose 'Wire Transfer'

The page reloads and shows the message:
> Pending... The order will be validated after the payment.

along with the custom payment instructions. However, no communication is
provided for the payment.

First, the `reference` is never set when calling the
`payment_confirmation_status` template, as it is done in
`portal_invoice_page_inherit_payment`. Moreover, in this workflow, the
reference is never set on the SO because of an incorrect filtering in
`_set_transaction_pending`.

opw-1906464

closes odoo/odoo#28466
2018-11-07 10:37:49 +00:00
Sébastien Theys 45dec698ee [FIX] product: pricelist item deterministic order
Following commit b43151c11c

The order of the pricelist items on the interface was made deterministic, but
there was still a problem with the actual computation because the SQL was
created manually and used a different order than the _order of the model.

Moreover, it is better to use id DESC instead of ASC to make sure the
automatically created default rule matching everything is actually applied last.

PR: #28476
2018-11-07 14:30:06 +00:00
qsm-odoo 0662a1948b [FIX] website: recompute carousel item heights on image loading
Some code is in charge of setting the same min-height for all items of
a carousel to the natural height of the tallest item, once the page is
loaded. This code was not working correctly in the case the natural
height of this tallest item depends on the height of one of its inner
image, as we have to wait for the image to be loaded in that case.

closes odoo/odoo#28159
2018-11-07 09:43:22 +00:00
Nicolas Lempereur 81b6adcda7 [FIX] mail: traceback reply button typo cd34f6de72
There was a typo with msgID at one part called messageID in another.

opw-1904029
closes #28465
2018-11-07 10:38:14 +00:00
Nicolas Lempereur 233bae7de9 [FIX] translate.py: fallback on base lang if noterm
When there is a language and its base language translation files in a
module, in 12.0 an empty translation in the language translation file
will not fallback on the base language.

eg.

 fr.po : {'one': 'un', 'seventy': 'soixante-dix'}
 fr_BE.po: {'one': '', 'seventy': 'septante'}

 => the translation in fr_BE will be {'one': '', 'seventy': 'septante'}

 but before 7288b477 it would have been {'one': 'un', 'seventy': 'septante'}

With this commit, an empty translation is no longer created so does not
override base language.

Also the intention of d84b795b0a that was also lost is restored by
upserting only noupdate==false translation, and inserting the other
ones.

opw-1904638
closes #28297
2018-11-07 09:07:02 +00:00
David Beguin d63e72853b [FIX] mass_mailing : restore import mass_mailing.contact into mass_mailing.list
Since the opt out per mailing list, the intermediate model was used
to list all the recipient of a mailing list. The side effect was that
importing new contacts into mailing list was not possible anymore.
Also, creation of a new contact into a mailing list was made indirectly
by creating a new many2many record between contaxct and list, which was
not really user friendly.

This commit restores the mailing contact model as the view of the mailing
list recipients. In other terms, the contact import is restored.
An opt-out computed field as been added to be able to filter on opted out
contact inside the mailing list recipients view.
This opt_out field SHOULD NOT be used in a form view as it need the active
mailing list id in the context in order to be computable and searchable.
This field has no sense without this active mailing list id context.

Task ID 1891228
Linked with blacklist and opt out per mailing task (ID 33224)
Closes PR #27632
2018-11-05 15:15:43 +00:00
Christophe Simonis d226f8b4ff [FIX] hr_holidays: set leave types as noupdate
They should not be updated using current year.
2018-11-06 20:02:06 +01:00
Nicolas Martinelli 3a74a56b0b [FIX] account: invoice paid at reconciliation
Move the option to `account_accountant`, since there is no way to do it
in `account`, leaving unpaid invoices.

opw-1906544

closes odoo/odoo#28440
2018-11-06 14:24:56 +00:00
Antoine Prieels (ANP) c4270135ef [FIX] snailmail_account: fix error when sending invoice
A compute function was removed in c2b55f3e0c
thus breaking the modal. A test will follow.

closes odoo/odoo#28439
2018-11-06 14:54:24 +00:00
Nicolas Martinelli 0f2e3ab711 [FIX] snailmail_account: do not send by default
Since most of clients don't have any credit, deactivate this by default.

opw-1906566

closes odoo/odoo#28438
2018-11-06 14:01:07 +00:00
Sylvain Van Hoof e07ec6cdb5 [CLA] sign CLA for Okia SPRL
closes odoo/odoo#28415
2018-11-05 15:20:56 +00:00