Commit Graph
1109 Commits
Author SHA1 Message Date
Benjamin Stiens 6383120f3b [IMP] all: Improve error messages
Many error messages are misleading or too "vague"
This task aims to improve all error message.

Task #47042
PR #23321
2018-05-28 16:45:48 +02:00
Darshil Trivedi 4699f3c2bf [IMP] stock: scheduled date as current datetime on return.
When a picking is returned, the scheduled date stay unchanged. This date can be
in the past if the return is made at least one day after the transfer. This commit
set the return day as scheduled date
2018-05-22 15:00:30 +02:00
Arnaud Baes 438006b56d [ADD] stock: replenish wizard
This wizard allows the stock users to replenish a product using the
routes applied to this product. A specific route can also be applied
to bypass the default route.

This replaces the "request procurement" wizard from v10, lost during the
stock refactoing.

Task ID: 47938
related to #22041
2018-04-04 16:06:19 +02:00
Christophe Simonis b51f2d38c2 [MERGE] forward port branch saas-11.2 up to 500e3f4970 2018-03-21 11:04:48 +01:00
Christophe Simonis e0345a4a3f [MERGE] forward port branch 11.0 up to 2835d29979 2018-03-20 11:45:11 +01:00
Florent de Labarre dc1681b1f8 [FIX] stock: show complete name of product
In case of changing the quantity on hand of two variants of the same product,
the two inventory adjustment created will have the same name (the name of the
product.template).
Show the name of variant instead.

Closes #23696
2018-03-16 08:58:02 +01:00
Christophe Simonis 0f57bdba72 [MERGE] forward port branch saas-11.2 up to 42659dc70c 2018-03-09 16:25:58 +01:00
Martin Trigaux 56c173af9f [IMP] misc: rephrase
Courtesy of e2f translators
2018-02-27 14:58:29 +01:00
XavierDo 2966d4faed [IMP] product: rename product.uom into uom.uom
Also rename product.uom.categ into uom.category to
 give it a decent name.
2018-02-26 14:27:26 +01:00
XavierDo 6a378e3839 [IMP] product: move uom in a new addon
Moves UoM models, test and data to a new addon in
order to be able to use uom without product.
A simple example is be to be able to use UoM for
timesheets.

This commit only move code, and adapt xml ids
without chaging any feature or functionnal
behavior.
Note: 'product' module now depends on new
'uom' module.
2018-02-26 14:27:26 +01:00
Christophe Simonis 9a84ba5533 [MERGE] forward port branch saas-11.1 up to e750bb6e11 2018-02-22 10:39:15 +01:00
Christophe Simonis ae6a65753e [MERGE] forward port branch 11.0 up to dbb713c2f8 2018-02-21 20:19:26 +01:00
Simon Lejeune 7ed86b53cd [FIX] stock: immediate transfer and unreserved move
Before the patch, validating a picking where one of its move do not
have any quantity done nor quantity reserved resulted in the complete
validation of the said move. This doesn't make sense and does not do
what the help in the wizard indicate (process only *reserved* quantities).

We also use this patch to clarify what the tests on this workflow is
doing (test_immediate_validate_*). We completely replace the 3 as it was
testing the `force_assign` mechanism, which methods are still present in
v11 but unused. Instead this test is now testing the failing flow this
commit is fixing.

We thus adapt the `process` method of the immediate transfer to only
process the move lines (move line = reservation). We also fix a case
where nothing is reserved and nothing is done. In this case, the
backorder wizard should not opens but instead an UserError telling the
user to either cancel or process something. The testcase for this flow
is test_immediate_validate_7.

With these changes, the test `test_04_create_picking_update_saleorderline`
was failing because one of the items in the so lines was a stockable
product without stock. So before this patch, everything was processed,
now there's a backorder wizard. We complete the patch and duplicate it
with enough products in stock, so that the backorder wizard is not
needed.

opw-815056
opw-808126
2018-02-20 14:42:44 +01:00
Arnold Moyaux 18d5b11cb4 [IMP] stock : log a note
The purpose of this commit is to create a generic method in order to
log an activity on following documents or on upstream documents in order
to avoid code duplication.

In order to use it, you have to:
- create a static method in order to generate the string
for the note (it will use an arguement with the format
{'dest_object': ['orig_obejct', (new_qty, old_qty)]}
- 'DOWN' to notify following document. In this case you
have to specify a groupby/sorted method.
- 'UP' to notify upstream document. In this case you have
to specify a specific method call
'_get_upstream_documents_and_responsibles' on the object to
ride up.

Log_activity's operating mode:
destination objects = self.stream_field(passed as arguments)
'DOWN' group destination objects by document on which we want
to log the activity and a responsible to assign.
For each pair (document, responsible) generate a specific note
with only the information relative to object that belong to the current
document. Once the note is returned, it logs the activity on the
document and assign the reponsible.
'UP' instead of sort and group runs the method
'_get_upstream_documents_and_responsibles'. For example on moves
this method is called recursively on all moves orig that are not done or
cancel until it can't find a valid one at this moment it returns its picking.
Then generate the note and log the activity the same way than 'DOWN'.
2018-02-01 15:26:59 +01:00
Simon Lejeune 3dc37a4ffc [REF] stock: allow returns in another warehouse
Previously, it was only possible to make a return in
- the location the move was coming
- a return location that is child of the parent_location, actually
  meaning a return location in the warehouse

This commit now allows making return in all return location, even one
located in another warehouses.
2018-01-29 11:00:49 +01:00
Christophe Simonis 362f0489d0 [MERGE] forward port branch 11.0 up to fe22a0f9ca 2018-01-03 12:28:52 +01:00
Arnold Moyaux 0322f6e51f [FIX] stock: return with a different uom.
Usecase to reproduce:
- Create a new unit of measure "Pack of 6" of UoM Categ = units
- Create a new product: Coca cola can, sell in unit, purchase in packs
- Create a PO, buy 1 pack of this product
- Receive the pack from the delivery order
- On the picking you just received, click on return
-> If you validate the wizard by clicking on "return", you get 6 packs, so you multiply by 6 the amounts of what you send as the system changed the quantity but not the Uom

It happens because the system compute the quanity to returns in terms of quant uom but when creating the return move it copies the origin move uom.

This commit uses the quant uom on the return move and also adds the uom in the view in order to be less confusing for the end user.

opw-800566
2017-12-20 13:39:36 +01:00
Christophe Simonis 2f99470458 [MERGE] forward port branch 11.0 up to c201cf2b77 2017-12-01 12:55:02 +01:00
Christophe Simonis 676c982eda [FIX] stock{,_picking_batch}: correct public method return value 2017-12-01 10:49:32 +01:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Christophe Simonis ab084d580f [MERGE] forward port branch saas-15 up to 98539336a5 2017-11-30 15:27:59 +01:00
flyingL123 c7cc59e20d [FIX] stock: Add return value
Fixes #21264
Closes #21266
2017-11-28 15:02:31 +01:00
Moises Lopez 593bb5e30d [REF] *: improved translatability of error messages
Was part of the PR #19820. Courtesy of Vauxoo
2017-11-24 15:35:27 +01:00
Arnold Moyaux 6b7ac1c5d7 [FIX] stock: wrong default date with inventory at date
When choosing inventory at specific date the default value
is the start time of the server instead of the current time.

When using fields.Datetime.now as default value, will set the function
as default and future object will need to evaluate the funcion each time an
object without default is created. fields.Datetime.now() will evaluate the
function once at the server start and use the retun value as default value
for future objects.
2017-11-13 17:33:17 +01:00
Simon Lejeune 186ae1c288 [FIX] stock: update qty on hand in multi company
A similar issue and a similar fix as rev 8955d15e9d

Fixes #20889
2017-11-13 16:58:47 +01:00
Pratima Gupta 55c0221e38 [IMP] stock, mrp{,_repair}: warn when operating on out of stock products
This implements a warning when the user tries to do any of the
following operations on a product that is not in stock:

- Scrapping
- Unbuilding
- Repairing

The warning displays the current stock of the product in question per
location which can be helpful in case the user selected the wrong
location.
2017-09-26 21:36:10 -07:00
amoyaux 03559629ee [IMP] stock: make immediate transfer and backorder multi
The purpose of this commit is to allow future modules that need
immediate transfer and back order function on multiples picking
to do it.

This commit does not modify the behavior of single picking processing
2017-09-26 09:31:26 +02:00
Simon Lejeune ce4da0531d [REF] stock, stock_account: inventory and valuation report
Kind of switches the behavior for inventory and valuation report,
meaning allows the user to see the quantity at date and disallow him to
see the valuation at date.
2017-09-25 15:34:55 +02:00
Prakash Prajapati 7cb688f4b7 [IMP] stock: rename scheduler menuitem
Also make it appear lower in the list.
2017-09-21 18:44:59 -07:00
Joren Van Onder a2a361f7e0 [IMP] stock: ask confirmation when validating overprocessed moves 2017-09-20 15:08:34 +02:00
Simon Lejeune 6aebc80053 [REF] stock, etc: only expose public method, remove indirection
also, remove now useless api.multi and dummy methods here and there
2017-09-15 17:49:37 +02:00
Prakash Prajapati 8bca882b56 [REF] stock: remove one level of menu in operations 2017-09-13 11:17:23 +02:00
Prakash Prajapati e9d8c7a097 [REF] stock: returns: wording of origin 2017-09-13 11:17:23 +02:00
amoyaux 59ba6940c9 [REF] stock: remove order point only on scheduler
This functionality was not well know and not necessary
from our point of view thus we chosse to remove it.
2017-09-08 17:08:10 +02:00
amoyaux f50d732373 [IMP] stock, purchase: improve usererror messages.
This commit add some steps in description in order to
correct the mistake.
2017-09-08 17:08:07 +02:00
Fabien Pinckaers 0e4f3bb959 [IMP] stock: remove procurement orders to fufill immediately
This removes the procurement.order model. To fufill their needs SO, PO, MO and
stock moves now call the _run method of the relevant procurement.group.

This mecanism is now only used for stockable product, tasks now uses their own
independent mecanism.

The _run method will check all the applicable rules and create directly the
needed model to fufill the need.

The modules stock, purchase, mrp, extends the _run method to implement their
specific strategy relevant for the rule type they define.

If an exception happens the message will be logged as a mail messsage on the
source model, for example, if a sales order cannot be fufilled the salesperson
will now see directly the reason.

OLD commit messages:
[WIP] procurement: removing procurement.order in stock, sale, purchase, sale_stock. WIP
fixup! [WIP] procurement: removing procurement.order in stock, sale, purchase, sale_stock. WIP
[IMP] Basic tests
[FIX] test not necessary anymore
[FIX] remove unnecessary print statement
[FIX] unnecessary test + why passing warehouse worked before?
[IMP] purchase: one move by purchase order line
[FIX] purchase: correct inventory tests and pass move_dest_ids among procurements
[FIX] because of bad cherry-pick merge
[IMP] make mrp pass by adding move_dest_ids there too
[IMP] tests of sale_mrp, no need for cancelpropagation then
[IMP] better to consistently use recordsets also for one2many
[FIX] purchase_requisition
[FIX] Exceptions should trigger errors, which should be caught in the tests
[FIX] sale_mrp: remove usage of procurement.order and use sale order name instead of sol
[FIX] stock_dropshipping: add sale_line_id on purchase_line_id
[FIX] Remove pdb
[IMP] add stock_dropshipping files
[IMP] stock: search carrier through sale line instead of procurement group
[IMP] add procrule test and preision needed when updating sol
[FIX] sale_order_dates + [IMP] procurement exceptions by scheduler
[FIX] No need to return task
[IMP] move file as name changes and add corrections
[FIX] Continue Run Schedulers wizard fix
[FIX] name issues of takss
[FIX] updating sale order line, but there is still a problem with the recompute
2017-09-08 17:08:05 +02:00
Haresh Shyara 147821363c [IMP] stock: some improvement in immediate transfer wizard
- removed parentheses on 'done' and set italic on 'reserved'
2017-08-30 21:17:31 -07:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
amoyaux b970bf865a [FIX] stock: unable to return SN in chained moves
Use case to reproduce the bug:
- Set multi location in settings
- Set warehouse's deliery method as pick/pack/ship
- Deliver a product to customer
- Process a return from customer to output.
- Create a return from output to pack ->
Unable to reserver product.

It happens because return moves where not linked together but have
the picking that created the return as origin.
Thus action_assign does not detect the return moves and can't
guess the real quantity available.

This commit add a behavior that will create links between
return move. It can be guess from parent move(the picking's move from which
the return is created) and its move dest/orig that have already
created other return. It also correct action assign because
the group by could retourn same line with return moves.
It add a test that check returns and links between them.
2017-08-17 17:49:09 +02:00
amoyaux 2a160329bb [FIX] stock : no more automatic backorder
When validating a stock picking there were 2 different cases:
(1) If all qty are equal to 0 it will display a wizard asking
if the user want to set the quantity done to the reserved quantity
for all moves. If the user accept it will automatically perform the
moves after setting the quantity done.
(2) If the user set a quantity on a move, it will check if there is
a need for a back order. If yes it will display a wizard asking if
a back order is needed or not.

However the check if a back order was needed or not was never perform
in case 1. If the quantity reserved was lower than the initial demand
a back order was automatically created.

This commit add the step 2 in the procedure of step 1 (after setting the
quantity done).
2017-08-17 17:16:21 +02:00
amoyaux 105ece056d [IMP] stock : improve immediate transfer message.
Improve the message for the end user.
2017-08-17 16:18:05 +02:00
Christophe Simonis 4d5ff6401c [MERGE] forward port branch saas-16 up to b76109173a 2017-07-28 18:37:10 +02:00
David Monjoie 3b3f6f04af [FIX] web: save changes when readonly if force_save is set
In previous versions, readonly used to prevent sending the values
of the fields to the server. However, it was not working properly
for fields which have their own sub-arch in the view, as the value
used to be sent regardless of the readonly value.

In the new views, the readonly modifier is never overlooked, which
created a bug in the stock_picking_return wizard which was not
able to return products received from a po anymore. Basically the
value of the product_id field was not sent so the create crashed.

This commit introduces a new "force_save" modifier which is used
to express that we want to save the value of the field even though
it is readonly from a user interface point of view.
2017-07-28 08:29:12 +02:00
Simon Lejeune ddf2b21bdf [REF] stock: adapt to rename of stock.pack.operation into stock.mode.line 2017-07-14 17:08:22 +02:00
Pierre Masereel 8248f0e153 [IMP] purchase,stock: edit PO line quantity
This commit adapt purchase to be able to edit purchase line ordered quantity
and propagate it to the related picking after the request for quotation
validation.

These are the supported use case

- When you increase the quantity on a purchase line, an extra move (and
an extra picking if they are all done or canceled) is created with the
difference between old and new value and the push rules are applied on
it.

- When you decrease the quantity of a purchase line, different behaviors
can occurs:
  * If you plan to decrese the ordered quantity under the received
    quantity, you get a user error saying tht you have to make some
    return before.
  * Else the moves not done or cancelled are decreased by starting with
    move having no procurement_id. The decrease is not propagated
    through push or pull rules.
  * If you decreased the quantity under the invoiced quantity, a next
    activity is created to remind you to do a refund.
2017-07-14 17:08:21 +02:00
Josse Colpaert eaca63277e [REM] stock: not imported file
Replaced by models/stock_scrap.py
2017-07-14 17:08:21 +02:00
Simon Lejeune ff91120416 [REF] stock: adapt returns to new implementation 2017-07-14 17:08:21 +02:00
Simon Lejeune 4b8689b86b [REF] stock: return wizard: store picking_id in the wizard
Implement the comment from tde
2017-07-14 17:08:21 +02:00
Simon Lejeune 0469d2e712 [REF] stock: new picking, move and pack.operation implementation
The big change is that we have now a many2many between the move and a
one2many between a move and its pack.operation (note: this model is
renamed as stock.move.line in a further commit).

Due to these changes, `action_done` had to be rewritten intierely, as it
depended and stock.pack.operation.lot and stock.move.operation.link,
that are now removed. This method was laregly inspired by the one in the
mrp module, and a further commit will make MRP uses all the core of
stock.

Due to the previous commit that refactored the stock.quant
implementation, the new concept is that the `product_qty` that will
always be in the uom of the quant (`product_qty` is a computed field in
the same style as the one of stock.move).

This commit also implements the logic that a manager is able to edit
done stock.pack.operation.

The stock.move has now a "partially_available" state (it was previously
a flag). The "split_from" field is removed now that we have a many2many
between moves (a sibling move is always a move that was splitted, or
with the backorder_id field).

The done quantity of a stock move is computed across the done quantity
of the move lines. There is an inverse method that allows user to fill
the done quantity directly on a stock move.

The reserve quantity of  stock move is computed accross the
`product_qty` of the linked pack operations.

`do_unreserve` will simply unlink the associated pack operation.
Unlinking a pack operation will unreserve.

`force_assign` will mark the move as available, in order to allow the
user to create pack operations (none are created because nothing was
reserved).

`action_assign` is rewritten and splitted in two parts: if the move has
a parent (mto) or not (mts). In the mto, we'll check the available move
lines and only reserve accordingly. In the mts, we'll reserve directly
on the quants.

`action_cancel` has changd a lot: in case of a delivery, the first step
does not anymore propagate cancellation to following moves and SO. As a
result it does not propagate in the other side in case of MTO or production.
It does not delete them if we delete the related sale order for example. In
order to correct this next activities will be added in the future. Technically
action cancel on move is based on procurment rule, this commit will set
the propagate field to false on the rule if the picking_type is 'pick'
or if we are in one step delivery.

We use this commit to reimplement `action_assign` (wiped by the new
quant implentation). A move is reserved if its move lines exist, so we
introduce a one2many between stock.move and stock.pack.operation (note:
a further commit renamed this model into stock.move.line)

We use this commit to implement `action_done` (wiped by the removal of the
models making the link between stock.move and stock.pack.operations). We
can use the one2many to the pack operations.

blabla manymany au lieu de one2many
blabla mto mts

Remove get_ancestors, as orig_ids will be used instead

validation

when we are creating some packe operation with lot name, the
pack_operation are unlink and a new picking is craeted.

This is caused the function _create_lot_for_picking that unlink pack
operation having no quantity reserved instead of ones having no quantity
done.

To fix this we changed product_qty to qty_done and move the code from
action_done of picking to action_done of move

fixup! [IMP] Merge_moves functionality + many2many procurement and original moves instead of one2many

fixup! [REF] stock: basics of new model and stock.move reservation

edit reserved move line

 This is the 1st commit message:

[REM] stock: stock.pack.operation.lot, stock.move.operation.link

These models will become useless once a one2many will be made between
stock.move and stock.pack.operation.

The `action_done` method on stock move has been wiped, as it depended
completely on the removed models.

Joint work with Josse Colpaert <jco@odoo.com>, amoyaux <arm@odoo.com>
and Pierre Masereel <pim@odoo.com>
2017-07-14 17:08:21 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00