Commit Graph
116102 Commits
Author SHA1 Message Date
Nicolas Martinelli 8dbaaf896e [FIX] stock: assign move
- Create a BOM for Product A, using Component B
  1 Unit of a is built with 1 Unit of B
- Update on hand quantity for B to 3.0
- Create a MO for 5 Units of A
- Update the quantity to produce to 3.0

The button 'Check Availability' never disappears.

The core of the problem is that the move remains "Partially Available".
Indeed, if there is no product available (`available_quantity <= 0`),
the stock move is skipped and its availability status is not updated.

We slightly change the logic by first checking if we need any quantity.
If not, the move can be considered as assigned.

opw-1850499
2018-06-04 08:32:39 +02:00
Odoo Translation Bot 395459d077 [I18N] Update translation terms from Transifex 2018-06-03 04:41:19 +02:00
len-odoo 42aff92a4e [FIX] account, purchase, sale: properly quote the name of the email sender
formataddr (from the email python library) writes email_from as '"name" <email>'
in the email_from field of the mail.compose.message record.
When the mail is rendered, onchange_template_id is triggered.
This then overwrites the values of email_from among other fields.
What happens is that it uses the email_from field from the template to render
the email_from, bypassing what was put by formataddr before.
What happens in some cases is that it is rendered as 'name <email>'
(note the quotes have been stripped away).
If name contains arbitrary symbols, e.g. name = 'pépé [company] <pdg>, ohlala',
then getaddresses which is supposed to parse the (name, email) pairs gets thrown
off (in particular, <pdg> will be interpreted as an email address, and many
other problems with the various special symbols).
It then gives these wrong elements as email addresses, which will usually crash
when getting non-ascii symbols (i.e. these strings don't respect the relevant
RFC for email addresses).

Closes:
https://github.com/odoo/odoo/issues/23502
https://github.com/odoo/odoo/pull/2311823118

opw 815202
opw 1824243
2018-06-01 13:06:09 +02:00
Adrian Torres a5ccc1b6b5 [FIX] orm: re-create constraints of extended fields
Before this commit:

* Module A defines a field X of model M
* Module B inherits from model M without touching field X
* Module C inherits from model M and extends field X by giving an INDEX
/ NOT NULL constraint.
* Module B and C depend from Module A, but not each other

If all three modules are installed and Module B is updated, the INDEX /
NOT NULL constraint could be dropped.

This happens because Module B can be loaded before Module C is loaded,
if that's the case, then after the upgrade of Module B, during the
schema checking, we verify that the field object we have and the field
on the DB are the same, since Module B doesn't introduce the index then
this check is false and we drop the index. When we get to loading Module
C, we do not do any schema checking because the module is not marked as
`to upgrade`, therefore the index is lost forever.

To solve this, we re-init the models that belong to the set of the intersection
between upgraded and modified models and loaded and modified models.

Fixes #24958
2018-06-01 10:55:35 +02:00
Nicolas Martinelli 195c2fc05f [FIX] website_sale: performance with carousel
When the carousel is activated, the following will load all variant ids
in the cache (cf. `_in_cache_without`):
```
<t t-set="variant_img" t-value="any(product.mapped('product_variant_ids.image_variant'))"/>
```

When accessing the `image` field at:
```
<div t-if="variant_img" class="..." itemprop="image" t-field="product.product_variant_id.image" t-options="..."/>
```
All variants in cache will have their image resized by the method
`_compute_images` on `product.product`. In case of a product with
hundreds of variants with images, this will take a major amount of time.

If we replace by `product[:1]`, the system uses another cache, and
doesn't fetch the image of all variants.

opw-1844783
2018-06-01 09:00:26 +02:00
Nicolas Martinelli 074ec1aeae [FIX] account: manual payment method
Commit 5439e72a4e introduces the automatic creation of a journal
for a payment provider. However, the journal created doesn't have a
default payment method, to avoid showing it in the backend.

In the case of the eCommerce with automatic invoice creation, this
set-up returns a 500 error after an online payment. Solving the problem
is not obvious for the end-user.

The error comes from the fact that the 'Manual' payment method is not
available on the journal. We can remove this check.

opw-1853011
2018-05-31 08:23:39 +02:00
Adrien Dieudonne a30d9aa560 [FIX] barcodes: avoid virtual keyboard to show up while scanning barcode
(1) Before this commit, the input barcode was removed from the dom
after each scan but now we want to keep it focused to avoid to
automatically open the virtual keyboard in mobile.
This behavior will be useful in enterprise only.
Another commit will follow in this repository.

As the input is not removed anymore, we had to disable autocomplete
to hide previous entries as suggestions.

(2) We also add z-index property to avoid to click on the hidden input
located in the middle of the page.
2018-05-30 14:13:28 +02:00
Olivier Colson 4a1bc45934 [FIX] base: set vat number field as readonly on children partners; as it is a commercial field, it should always have the value defined on the parent partner.
(this is a manual forward port from https://github.com/odoo/odoo/commit/98b1fffd4e99cc8ad2862c56fbd727979c38c48b , as a new view is defined in 11.0, needing this correction too)
2018-05-30 10:50:50 +02:00
Géry Debongnie d1125cbc9f [DOC] fix supported browsers list 2018-05-30 10:44:38 +02:00
Nicolas Martinelli 3c48eaf5af [FIX] account: partner read-only
Partner should be read-only on a posted AML.

Fixes #24423
opw-1849177
2018-05-30 10:00:31 +02:00
Christophe Simonis 4ea3838d89 [MERGE] forward port branch saas-15 up to 6be9593a0c 2018-05-29 19:24:08 +02:00
Christophe Simonis 6be9593a0c [MERGE] forward port branch saas-14 up to 459efb4276 2018-05-29 19:02:43 +02:00
Christophe Simonis 459efb4276 [MERGE] forward port branch 10.0 up to 2288a89564 2018-05-29 18:45:00 +02:00
Christophe Simonis 2288a89564 [MERGE] forward port branch 9.0 up to ea0fcd52d9 2018-05-29 17:52:20 +02:00
pimodoo fedec79a8b [FIX] base: missing rng attribute 'force_save' on fields
Th view validation when attribute force_save is set on a field raise an
'Invalidation error' because there is no rng attribute for 'force_save'.

This attribute disappeared during the refactoring in rev: https://github.com/odoo/odoo/commit/70942e4cfb7a8993904b4d142e3b1749a40db806
2018-05-29 17:18:49 +02:00
Martin Trigaux dcd708d133 [FIX] web_planner: add missing context
To have the translated version of tooltip_planner displayed

opw-1850066
2018-05-29 14:34:13 +02:00
Odoo Translation Bot ca653c8c44 [I18N] Update translation terms from Transifex 2018-05-29 14:14:28 +02:00
Goffin Simon f349d2f3ab [FIX] mrp: A traceback was raised when creating a warehouse
When creating a warehouse, a traceback was raised if the xml_id: mrp.route_warehouse0_manufacture
was not found.

opw:1852761
2018-05-29 14:14:24 +02:00
Goffin Simon b5ea61bf72 [FIX] product: Print "Products Labels"
The number of characters must be taken into account to print the
barcode. With 13 characters -> EAN13, with 8 characters -> EAN8 else
-> Code128

Backport of 12b11c1e6f

opw:1849965
2018-05-29 14:06:06 +02:00
Lucas Perais (lpe) 94a7bef5db [FIX] web: domain evaluation in parented m2o in o2m list
Model A has a o2m to model B
Model B has a m2o parent_id on B

In A's form, add a B item,
then in the m2o, create record
Save and New
Click on the m2o

Before this commit, the python crashed on name_search.
This was because we sent the virtual ids to it

After this commit, there is no crash

OPW 1850212
closes #24948
2018-05-29 13:44:23 +02:00
Nicolas Martinelli 32821843c4 [FIX] payment: pre_msg
The `pre_msg` field was removed from the payment process in commit
14081b848f. We hide the field since it is confusing for end users. A
proper refactoring will be done in master.

opw-1849413
2018-05-29 13:02:39 +02:00
Goffin Simon 12b11c1e6f [FIX] product: Print "Products Labels"
The number of characters must be taken into account to print the
barcode. With 13 characters -> EAN13, with 8 characters -> EAN8 else
-> Code128

opw:1849965
2018-05-29 12:27:58 +02:00
qdp-odoo 7bd1694008 [FIX] hr_payroll: removed deprecated-and-broken menuitem 2018-05-29 10:44:56 +02:00
Goffin Simon fce72f902e [FIX] delivery: Translate the delivery method on SO line
In this way the name of a delivery method can be translated on a SO line.
Inspired from function 'product_id_change' in model 'sale.order.line' where
the description of a SO line must be in the language of the partner.

opw:1849656
2018-05-29 10:11:00 +02:00
Josse Colpaert eabcb9ff1a [FIX] stock_account: setting standard price with multiple real-price outs with negative quants fixes #24925
Somehow the function treated multiple records with
 the new api translation from 9 to 10.

Steps to reproduce:
This applies to delivery orders and manufacturing orders. As an example:

Create an MO with 2 products on the BOM
Both products must have real time costing with FIFO
The first product on the bom must not be available
For the second product on the BOM, the standard_price must be different from the cost of the next quant to be consumed
Complete the MO, letting the first product result in a negative quant
Current behavior:
The standard_price of the second product on the BOM does not get updated.

Behavior after this fix:
The standard_price of the second product on the BOM gets updated.

Thanks to matt454357.
2018-05-29 08:24:02 +02:00
Lucas Perais (lpe) 9654f6b8e0 [FIX] web: o2m editable decorated, paged, ordered supports adds/cancel
Have a decorated (conditional on field) editable list, with a default_order.
Have more records than the pager allows.

Add an item, and hit escape to cancel addition.

Before this commit, the cancellation crashed because the first record on the other page
was trying to evaluate the decoration for its row, which is wrong in the first place.
This was because creating a record increases the limit of the list, to be able to see the record
being created.
At cancellation though, that limit was never decreased.

After this commit, the whole flow happens without problem.

OPW 1844495
closes #24682
2018-05-28 17:25:51 +02:00
qsm-odoo ea0fcd52d9 [FIX] web_editor: properly save a t-field in a t-ignore environment
When a t-field element was in an editable t-ignore environement,
modifying it was leaving the edit mode style attached to it. This
was because of:
1) When the t-field element was changed, it was marked dirty but
   also its parent editable container. Fixing this, only solves
   the case where only the t-field (and not one of its neighbors)
   is changed but it was worth fixing anyway.
2) Before saving an element, the potential 'o_editable' and
   summernote classes were not removed of its descendant and were
   thus saved.

Bug found with task-38069, merged in stable as it might occur there
too.
2018-05-28 12:20:07 +02:00
Odoo Translation Bot a89e46fdc0 [I18N] Update translation terms from Transifex 2018-05-27 04:10:26 +02:00
Odoo Translation Bot 63401868a5 [I18N] Update translation terms from Transifex 2018-05-27 00:26:12 +02:00
Fabien Meghazi 32c5392f5f [ADD] http: addons preload opt-out for socket activation
Before this patch, early connections made to a 11.0 Odoo server running
on Python 3 and deployed in threaded mode with socket activation would
generate invalid registries.
With this patch it is now possible, when this deployment mode is used,
to opt-out addons preload by setting the following environment variable:

    ODOO_PRELOAD_ADDONS=no

Note: this environment variable is only available for v11.0 as later
versions does not preload anymore (cf: 1a39c9b)
2018-05-25 15:33:31 +02:00
Nicolas LempereurandGoffin Simon 7703f1fb16 [FIX] mass_mailing: have unsubscribe in multi lang
Since 953a693df link not corresponding to a route are tought multilang
by default.

Thus in the mass mailing, if the user had not the default language on
the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder
in the mail.

The placeholder is replaced by a real link pinpointing to the items the
given person would unsubscribe to, but having /fr_FR/ part prevented
that.

With this PR, there is a dummy route so /unsubscribe_from_list is
explicitely known as not multilang.

opw-1850696
closes #24912

Co-authored-by: Goffin Simon <sig@odoo.com>
2018-05-25 12:16:30 +02:00
Christophe Simonis 2ca7296000 [MERGE] forward port branch saas-15 up to dbb2b9bf73 2018-05-25 11:08:39 +02:00
Aaron Bohy 04ba755f82 [FIX] web: AbstractController: handle concurrent reloads
Let's assume the following scenario in a Kanban view with a default
filter. The user removes the filter, and quickly adds a new one.
On a slow network, it may happen that the second reload request
returns before the first one. On odoo.com, this is easy to
reproduce on the tasks Kanban view.

Before this rev., when this occured, the result of the first
request was displayed, whereas it should have been ignored as
another request was done later on.
2018-05-25 08:11:49 +02:00
Christophe Simonis dbb2b9bf73 [MERGE] forward port branch saas-14 up to cafe56da80 2018-05-24 19:40:05 +02:00
Christophe Simonis cafe56da80 [MERGE] forward port branch 10.0 up to 3051d1dd2f 2018-05-24 18:24:12 +02:00
Christophe Simonis 3051d1dd2f [MERGE] forward port branch 9.0 up to 34f567dd39 2018-05-24 16:55:28 +02:00
Christophe Simonis 34f567dd39 Revert "[FIX] mass_mailing: unsubscribe not working in multi lang"
commit a3ab33f212 introduced invalid code
2018-05-24 16:50:09 +02:00
LofbergValentin 6e1b660f9c [FIX] hr_attendance: Keep the kiosk session alive
closes #1800442

Purpose
=======

Odoo sessions are expired when no action has been triggered
for the last 7 days. For kiosk mode, this doesn’t make sense.

It means that once a week, a person with the rights to the
employee under kiosk mode, has to come to the screen and log in again.

Specification
=============

Trigger an action to keep the Odoo session alive.
2018-05-24 16:47:12 +02:00
Christophe Simonis 299b613da3 [MERGE] forward port branch 9.0 up to 919a1af936 2018-05-24 16:31:23 +02:00
Goffin Simon f9ce42c763 [FIX] sale_timesheet: ZeroDivisionError
To avoid a division by zero.
Courtesy of @tbe-odoo

opw:1850023
2018-05-24 16:29:12 +02:00
jem-odoo 919a1af936 [FIX] purchase: correct product cost in reporting
product.product inheritS from product.template, and they both
define the 'standard_price' field, but implement it differently;
 - product: the field is a company dependent one (so non stored)
 - template: the field is a computed one based on tis variants

For the first case, since the field is not stored in database, when
doing SQL query, we have to get the value from the table ir_property.
That is what purchase report does, but instead of searching on resource
'product.product', it does it on 'product.template'. There are
obviously no entries in ir_property table for 'standard_price' field
on product template. As consequence, the "product value" (cost)
is always null in purchase reporting.
This commit fixes that by modifying SQL query to get the good
value from ir_property table.
2018-05-24 16:21:06 +02:00
Yannick Tivisse 28179bc8cb [IMP] base: Add support for private addresses
This is a backport of commit https://github.com/odoo/odoo/commit/2f15a5fa647d55df36c9019df467802a3aa9b4e3

Purpose
=======

Add the possibility to create private addresses, only accessible for a subset
of users.

Specification
=============

- Add a new 'Private' partner type
- Add a res.groups in base 'Access to Private Addresses'
- Add ir.rules for the following behavior:
    - Every employees/internal users can read non-private addresses
    - Only users in group_private_addresses can access private addresses
- Add in base a simplified form view for private addresses

The following points won't be backported:
- A HR Officer is automatically granted in group_private_addresses
- Use the simplified form view to open the address_home_id form on employees
That's because it requires to update 'base' to make it work. If a user only
update 'hr', this will break his instance while 'base' isn't updated.

But these modifications can be applied manually quite easily.
2018-05-24 13:53:46 +02:00
Rémi Rahir 4c08e2a945 [FIX] iap: install web_settings_dashboard along with iap 2018-05-24 09:56:02 +02:00
Goffin Simon a3ab33f212 [FIX] mass_mailing: unsubscribe not working in multi lang
When installing the website with a lang  different than the one set
on the user, the button unsubscribe in the mass mailing snippets
didn't work because the unsubscribe link contains the code of the
language. The function send_get_email_dict in model mail.mail didn't
expect this behavior and so couldn't set the right unsubscribe link
in the mail.

opw:1850696
2018-05-24 09:46:36 +02:00
Joren Van Onder 1e21b79feb [FIX] website_quote: install sale_payment together with website_quote
Stable version of 65a589eb54 (reverted
at 935043dda1) that doesn't cause the
following errors:

odoo.modules.graph: module website_quote: Unmet dependencies:
sale_payment

on existing databases without sale_payment installed.

A downside of this approach is that sale_payment can be uninstalled
without uninstalling website_quote. Adding an uninstall_hook to
sale_payment could solve that, but it wouldn't warn the user
website_quote would be removed in the "Uninstall module"
wizard. Keeping in mind this is only a temporary hack for stable,
keeping sale_payment installed in this case shouldn't cause any
issues.

opw-1847977
2018-05-23 13:51:15 -07:00
Christophe Simonis 02ee3fd88e [MERGE] forward port branch saas-15 up to 1b81f1a5c9 2018-05-23 18:36:28 +02:00
Christophe Simonis 1b81f1a5c9 [MERGE] forward port branch saas-14 up to 373a1c1128 2018-05-23 18:34:28 +02:00
Christophe Simonis 373a1c1128 [MERGE] forward port branch 10.0 up to 682ae1cc64 2018-05-23 18:30:36 +02:00
Christophe Simonis a496ca981c [FIX] stock: move company initial setup logic in model
Followup of 4e71bd5caf
2018-05-23 17:07:28 +02:00
Josse Colpaert 73e213edef [FIX] stock: non-tracked products should follow FIFO removal strategy too
In a warehouse, mostly most of the products have no lot.  It stays
important however to avoid having old products in stock, certainly if
we can distinguish them by pack or location.

As now in stable, in_date is not put on the quant for non-tracked products,
databases might mix quants with and without in_date of the same product.
We should see those without in_date as the oldest.
That is why we need to be able to apply a ASC NULLS FIRST (ASC is NULLS LAST by default) for FIFO
or DESC NULLS LAST for LIFO.

In order to do that, we copied the code from the _search method of the ORM to
be able to do this special order as the orm itself is restrictive as it
supposes the order itself has no spaces.

We adapted and added some tests to check it handles the combination of NULL/NOT NULL well.
2018-05-23 14:38:13 +02:00