Commit Graph
228 Commits
Author SHA1 Message Date
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
xmo-odoo 2e6a589f41 [FIX] builtins removed from Python 3
* Reverse wrapper courtesy of @rco-odoo's original P3 branch
* thin compat module stripped down from werkzeug (to augment as needed)

issue 8530
2017-04-27 13:59:33 +02:00
Christophe Simonis 4441237b0a [MERGE] forward port branch saas-15 up to ab68a1c674 2017-04-25 12:36:02 +02:00
Christophe Simonis ab68a1c674 [MERGE] forward port branch saas-14 up to 64b7d4e8a8 2017-04-24 13:24:13 +02:00
Christophe Simonis 64b7d4e8a8 [MERGE] forward port branch 10.0 up to 3f6e573c67 2017-04-24 12:53:34 +02:00
sap e59c1b49c2 [IMP] web, various: apply kanban card color on header instead of whole card
Currently applying a color to a kanban item applies it to the whole
card. This creates usability issues as the content is not dynamically
updated to match the chosen color.

This commit proposes to apply the color only to the header and let the
card content standard. It helps designing cards that are always usable
and readable.
2017-04-24 10:36:29 +02:00
Pierre Masereel 93714790c1 [FIX] stock,mrp: copy move when push rules
When you have push rules on move having a 'production_id', the
'production_id' is copied on the generated moves. So it generate a
traceback when we check the tracking method of 'product_id' on
produce_move.

This issue is caused because we get multiple produce_move instead of
one.

To fix this issue, we don't copy the production_id anymore on moves
generated by push rules.
2017-04-19 14:44:22 +02:00
Goffin Simon fbbe9b54d4 [FIX] stock: package with different products
In function _get_top_level_packages, when checking that all the products
have the same destination, the destinations must be stocked in a set
instead of a list because with different products it could return a list
with duplicated destinations.

opw:725720
2017-04-19 13:03:25 +02:00
Nicolas Martinelli 1463c76c1a [FIX] stock: return location browse record
Return a browse record instead of an idea, to be consistent in the case
of not putaway found.

opw-727582
2017-04-18 13:17:13 +02:00
Christophe Simonis b0992d082d [MERGE] forward port branch saas-14 up to 8f30e707e5 2017-04-13 15:31:27 +02:00
Christophe Simonis 13ad16104a [MERGE] forward port branch 10.0 up to 00e169c05a 2017-04-13 13:22:27 +02:00
Christophe Simonis 9e159ef204 [MERGE] forward port branch saas-11 up to f830c7c3e3 2017-04-12 18:51:16 +02:00
Nicolas Martinelli b1ba17deab [FIX] stock: reordering rules of archived products
When the scheduler is run, the reordering rules of archived products are
selected.

opw-728316
2017-04-11 13:18:29 +02:00
Christophe Simonis aea68e4730 [MERGE] forward port branch 9.0 up to 51fe54dd8d 2017-04-07 17:34:51 +02:00
Pierre Masereel 8d65763f93 [FIX] stock: MTO move status
When we validate a SO with an MTO product, then an RFQ and a delivery
picking are created. The status of the delivery picking is in state
'confirmed', but should be 'waiting' as the delivery waits for a
specific delivery input.

The problem is caused by the unreserve method, which is called in the
'procurement_jit' module. This method only checks that a move has
ancestors to determine if the move should be in waiting or in confirmed,
which is not the case for our delivery move because the RFQ has not been
validated yet so there is not ancestors yet.

To fix this issue, we check the 'procure_method' of the move, and if it
is in 'make_to_order' we put it in 'waiting' instead of 'confirmed'.

We also fixed the function recalculate_move_state that could cause the
same problem.
2017-04-07 16:35:57 +02:00
Nicolas Martinelli 300c678ade [FIX] stock: recompute on picking assign
- Create a kit (phantom BOM), composed of 2 different products A and B
- Create a SO, sell a random stockable product, confirm and validate the
  picking.
- Edit the SO, add the kit and save.

Two pickings are created, one for product A and one for product B.

Commit 8fe8ca9948 forces the recomputation of the stock moves, in order
to be able to find a newly created picking. This should actually be done
after each picking creation.

opw-725929
2017-04-05 08:12:10 +02:00
Christophe Simonis 2df5faa551 [MERGE] forward port branch saas-14 up to 2f68e9e93a 2017-03-28 18:05:31 +02:00
Christophe Simonis 2f68e9e93a [MERGE] forward port branch 10.0 up to 72fa3e8bda 2017-03-28 17:27:19 +02:00
Christophe Simonis c37f1f6cb9 [MERGE] forward port branch saas-11 up to 8bab7aebd6 2017-03-28 16:17:09 +02:00
Christophe Simonis 8bab7aebd6 [MERGE] forward port branch 9.0 up to e876becada 2017-03-28 16:14:34 +02:00
Christophe Simonis 27496730d8 [MERGE] forward port branch saas-11 up to c2569b9df1 2017-03-28 14:51:14 +02:00
Pierre Masereel 7a039c730d [FIX] stock: multiple global push rules with same origin
When you have multiplle global push rules with the same source location,
a traceback is raised because the '_apply' method of
"stock.location.path" is called with more than one record, and doesn't
handle multiple record.

To fix this, we limit the number of records returned when a global rule
is searched to 1 (as for other 'search' of push rules in this file).

This bug has been introduced during migration in rev: https://github.com/odoo/odoo/commit/cb486d7eb6353a66eea2cb3610141b4f3a778791

opw-725874
2017-03-27 17:36:25 +02:00
Christophe Simonis c8f01e3b62 [MERGE] forward port branch saas-14 up to b2fa9f2ad1 2017-03-17 18:03:00 +01:00
Christophe Simonis b2fa9f2ad1 [MERGE] forward port branch 10.0 up to 31ebb07773 2017-03-17 17:57:52 +01:00
Christophe Simonis 31ebb07773 [MERGE] forward port branch saas-11 up to aefdf96c25 2017-03-17 17:55:30 +01:00
Pierre Masereel a5b9d05b66 [FIX] stock: multi-step routes
When we are changing the incoming and outgoing routes steps of a
warhouse through its settings, the push/pull rules are actually deleted
and recreated, which raise a traceback if we have some move validated
that are using those rules.

The problem came after rev: https://github.com/odoo/odoo/commit/b1b3de1339a13504ac5e223aec465bd70417d11e
Because we restrict the deletion of rules when they are used in stock
moves.

To fix this issue, we deactivate rules when we change the incoming and
outgouing rules instead of unlink them
2017-03-16 17:39:59 +01:00
Simon Lejeune be9dce625c [FIX] stock: inventory adjustment and negative quants
It is still possible to have negative and positive quants in the same
location because of returns: if you send something to the customer that
is not there and you return it, you will still be able to reserve the
returned goods to send to another client.

Before, if you would do an inventory adjustment, it would not take into
account these returned quants and their negative counterpart, which made
them difficult to get out of the system.

This fix takes them into account by creating two movements for one
inventory line: move the positive counterpart to the inventory location
before getting back from this location the same quantity.

This way, even if you have 0 as quantity on hand but you have those 2
quants, it will eliminate them. (if you are increasing the stock, part
of the process might have done it automatically already).

Test cases contributed by @jir-odoo
2017-03-16 17:30:02 +01:00
Pierre Masereel 945679176a [FIX] stock: warehouse check_reception_resupply
When we are trying to change the reception route of a warehouse when
there are existing resupply routes, we are getting a traceback.

This bug comes from a migration error introduced in rev: https://github.com/odoo-dev/odoo/commit/70e1d5d5bc1a3cb325dbcb091fc2135e23084145
2017-03-14 16:46:42 +01:00
Martin Trigaux 8adc2ef440 [FIX] stock: do not write on picking type
When creating a stock.picking, the related fields picking_type_entire_packs and
picking_type_code were both updated.
This was an issue was required write access on stock.picking.type (warehouse
manager) to create a stock.picking (warehouse user).

The fields were updated as they were present in the view and filled with the
related value. Even if the value was unchanged, it was triggering a write
anyway.

The two fields were in invisible="1" and used only in attrs for other fields.

Making these two fields in readonly does not prevent to use it in the attrs but
avoid to send a value to the server and trigger a useless write.

Fixes #15769
2017-03-14 15:58:42 +01:00
Christophe Simonis 65a5ced979 [MERGE] forward port branch saas-14 up to 777a87cde8 2017-03-13 17:37:20 +01:00
Christophe Simonis 777a87cde8 [MERGE] forward port branch 10.0 up to 2ef43281c2 2017-03-13 16:22:57 +01:00
Nicolas Martinelli beaea311e6 [FIX] stock: typo
In method `_check_delivery_resupply`, `new_location` is used in a
`write` call. This expects an integer (id).

However, `new_location` is the result of `_get_input_output_locations`,
which returns a recordset.

opw-716141
2017-03-10 10:39:20 +01:00
Christophe Simonis cb00be643a [MERGE] forward port branch saas-14 up to a4d5e64a4c 2017-03-06 15:46:24 +01:00
Christophe Simonis d08ecdc3b8 [MERGE] forward port branch 10.0 up to 1279f82e12 2017-03-06 13:52:06 +01:00
Martin Trigaux 2d199ed460 [FIX] stock: do not compute unrelevant inventory quantity
The total quantity of an inventory only makes sense if the same product is
counted.
This commit avoids useless recompute of the field when a ligne is changed.
The trigger were missing meaning it was recomputed after any change, slowing
down already unefficiant large inventory.
2017-03-02 10:37:57 +01:00
Simon Lejeune fbae45703b [FIX] stock: settings: multi location and advanced location
Disabling multi location should disable advanced location, the same way
disabling multi location disable the multi warehouse.
2017-02-17 13:21:58 +01:00
Dhaval Panchal b1b3de1339 [REF] stock: no more global push/pull rules
Global push/pull rules are error prone and can be replaced efficiently
by creating a "global" route.

There was an odd behavior when you delete a route, the different rules
of this route were'nt deleted and thus became global. A lot of users
didn't understand that, so to avoid this unexpected behaviour, we
delete on cascade the push and pull rules when a route is deleted.

To avoid inconsistencies in the system, we also restrict the deletion of
rules when they are used in a stock move or in a procurement. We also
restrict the deletion of routes used in warhouses and order lines.

We change the global pull rule test by applying the procurement rule on
a route and apply this route on a product.

Menu items related to global rules are removed, so are the logic to look
for them in the methods looking for which pull/push rule to apply.

joint work by @dpa-odoo, @pimodoo and @sle-odoo
2017-02-17 13:21:58 +01:00
Dhaval Panchal f5b0ec4de3 [REF] stock: picking: rename delivery type by shipping policy 2017-02-17 13:21:58 +01:00
Dhaval Panchal 5c837dec2a [REF] stock, etc: rename picking type by operation type
As picking types aren't always used in a picking context, and picking
aren't really meanigful for a lot of people, we rename this concept as
"operation type" in views and in the planner.
2017-02-17 13:21:58 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00
Christophe Simonis cbdd0b20dc [MERGE] forward port branch 10.0 up to ffd4442b06 2017-02-10 13:17:02 +01:00
Goffin Simon bd01714388 [FIX] stock: Inventory adjustments in multi company
When making an inventory adjustment in multi company,
the default location_id was all the time taken from
'stock.warehouse0' even if the user was not allowed to read
the warehouse. Inspired from _get_default_location in pos_config.py

Backport of 8955d15e9d

opw:706704
2017-02-08 16:49:33 +01:00
scosist 07cf30064d [IMP] purchase,stock: armonize _select_seller calls
If the data is available in the current context it should be passed to
_select_seller. The calls to _select_seller throughout the lifetime of a
purchase should be consistent (as possible) or the result of
_select_seller could be inconsistent when dealing with multiple sellers
(product_supplierinfo).

Modify a few signature of private methods to pass available information.

Closes #11414
2017-02-07 10:52:56 +01:00
Christophe Simonis 9ec95b2a68 [MERGE] forward port branch saas-11 up to 51b79a7ee1 2017-02-06 17:18:24 +01:00
Simon Lejeune 7d2cccfc12 [FIX] stock: manually process a pack
Before this patch, it was not possible to manually process a pack (i.e.
checking the "is_done" box), because the field was always reset
*before* saving. It was still possible to process it by hitting
"validate", but it was not possible to put a pack in a pack.

Manually process a pack means hitting the checkbox "is_done" on the pack
operation. This "is_done" field is a boolean computed field with a reverse
function, and this reverse function set the "qty_done" on the pack
operation to 1.0.

The compute field doesn't have any depends declared, so the value was
invalidated after any changes in the form view. The computed method was
used to check the checkbox is the "qty_done" is set to 1.0. It was
probably used to check the checkbox when opening later a picking for
which the pack was already processed.

The issue is that the "qty_done" was never updated, because the inverse
method is only called when saving, and the compute method already reset
the "is_done" field to False, as the "qty_done" was not updated.

To fix this issue, we do not use an inverse method but an onchange.
Indeed, this was the expected behavior: hitting the checkbox should
change the "qty_done".

We already have a test covering this use case, committed in v9 [1]. It
didn't discovered this regression because the test was using directly
the "qty_done" field on the pack operation, not the "is_done" field used
in the view. We change the test to use the "is_done" field and manually
trigger the onchanges.

This is due to a bad new API migration [2].

[1] rev e248420348
[2] rev d8548e0771
2017-02-06 12:00:36 +01:00
Florent de Labarre 3d3920dfbc [IMP] stock: most recent inventory first
Was: last inventory first which is not very usable as soon as there is many inventory registered.

Closes #15324
2017-02-03 09:20:13 +01:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Christophe Simonis b7c7591bfb [MERGE] forward port branch saas-11 up to 71773e1f1c 2017-02-01 19:08:14 +01:00
Martin Trigaux 365d6a888d [FIX] stock: correctly compute custom search method
The search on qty_available was refactored twice:
- b9853db8 to split the method
- a989680b to remove the eval operator

At b9853db8 the order of evaluation introduced a bug so that the domain
   ('qty_available', '=' 10.0)
was evaluated
   if product[qty_available] = 10.0:
which crashed (`=` instead of `==`).

Before b9853db8, this code did not crash as the operator was converted via
  if operator == '=':
    operator = '=='
which is no longer executed after the split

a989680b replaced the eval by a dictionnary that replaced the eval error by a
KeyError when searching with `=` operator.

This commit changes several things:
- replace the `operator in ('==', '>=', '<=')` as this was evaluated before the
  operator replacement code mentionned above
- remove the replacement code as no longer justified since a989680b
- replace the OPERATOR key `==` to always match given key
2017-02-01 16:09:10 +01:00
Nicolas Martinelli ac66f296aa [FIX] stock: qty in pack operations
- Enable lot tracking on Product A
- UoM of Product A is kg, but Purchase UoM is lb(s)
- Create a PO for 200 lb(s) of Product A, confirm
- Go in the picking: 200.01 lb(s) shuold be received according to the
  pack operation, while 200.00 lb(s) are expected in the stock move.

The field `product_qty` on the sotck move contains the quantity in kg,
but already rounded from the value in lb(s). If we convert it back to
lb(s), there might obviously be a rounding error, since we do:
lb(s) -> kg -> lb(s)

To solve this, we recompute the quantity in the UoM of the product
without rounding, as a temporary computational value.

opw-705259
2017-01-31 15:33:10 +01:00