Commit Graph

1280 Commits

Author SHA1 Message Date
Christophe Simonis 504a04c823 [MERGE] forward port of branch 7.0 up to 117b636 2015-09-25 14:56:58 +02:00
Alexis de Lattre fc11b58239 [FIX] stock: service lines duplication when grouping DO invoices
This is possible that changes happen
during the loop in the multiple pickings:
an update in a picking could update another
picking. The browse must therefore be done
inside the loop to update the pickings with
the latest changes.

Fixes #4201
2015-09-25 12:25:52 +02:00
Christophe Simonis 04e13180c9 [MERGE] forward port of branch 7.0 up to 607114f 2015-08-21 16:08:27 +02:00
Laetitia Gangloff 607114ff00 [FIX] stock: Scheduled / Max. Expected date change on picking when changed in its moves
When changing the min_date / max_date in a move,
the date change wasn't propagated to its picking.

The use of store triggers is needed in such a case,
`store=True` isn't enough

Fixes #1862
Closes #3278
2015-08-17 18:04:13 +02:00
Christophe Simonis ac865c8a78 [MERGE] forward port of branch 7.0 up to 9fa7624 2015-07-07 13:58:35 +02:00
Nicolas Martinelli 9fa7624e25 [FIX] stock: onchange_quantity and onchange_uos_quantity use rounding
It is necessary to round the quantities with the appropriate precision. Indeed,
since onchange_quantity and onchange_uos_quantity trigger each other indirectly,
it is quite easy to fall in an infinite loop if the uom and uos precisions are
different.

Follows commit 6e346f0adb

opw-643651
2015-07-07 11:25:19 +02:00
Loïc BELLIER 34b9f43011 [FIX] stock: add location in context on prodlot search
To be consistant with the results of _get_stock. Otherwise search made on
stock_available may not display results with the same value than the search
criteria.
Fixes #3976
2015-07-06 14:41:56 +02:00
Nicolas Martinelli 6e346f0adb [FIX] stock: product_uos_qty must have the precision of Product UoS
If 'Product UoS' has a higher precision than 'Product Unit of Measure', the
method onchange_uos_quantity will be called over and over by an infinite loop
if 'product_uos_qty' doesn't have the sufficient number of decimals.

opw-643651
2015-07-03 16:42:34 +02:00
Christophe Simonis b62ee0734c [MERGE] forward port of branch 7.0 up to eaaca65 2015-05-21 14:11:39 +02:00
Nicolas Martinelli ba896aabe7 [FIX] stock: if cost_method of a product is 'average' do not round the currency conversion
This prevents rounding errors if product decimal precision is different from
currency precision.

Fixes #6547
opw-634390

Do not fowardport since already done in v8.0:
https://github.com/odoo/odoo/blob/8.0/addons/stock_account/stock_account.py#L310
2015-05-20 17:00:37 +02:00
Denis Ledoux 70f22254f5 [MERGE] forward port of branch 7.0 up to 335a8af 2015-05-19 10:26:33 +02:00
Nicolas Martinelli 335a8afe79 [FIX] stock: remove state modifiers for field note in stock.picking
Remove the state modifiers for field note in stock.picking in order to have a
behavior which is consistent with sales orders or invoices.

opw-639956
2015-05-18 14:52:06 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Martin Trigaux 0b2bc27adc [FIX] stock: use unit of measure for manual receptions
When using the manual reception wizard, if a quantity in a different unit of
measure was set, the unit was ignored. opw 617336
2015-04-20 17:16:22 +02:00
Christophe Simonis 50665b499a [MERGE] forward port of branch 7.0 up to d0ef1b9 2015-04-16 19:13:56 +02:00
rmu-odoo 3f7d168130 [FIX] sotck: correctly set reference on internal move
When creating a chained picking, the first move has no sequence, this is because
there is no sequence for stock.picking.internal.
Set the sequence before the chained move so that the sequences are in the right
order. opw 621261
2015-04-15 15:23:26 +02:00
Christophe Simonis d3e7a8ef5e [MERGE] forward port of branch 7.0 up to 856bc6f 2015-04-10 18:24:46 +02:00
Akash Balar 4ba72fbacb [FIX] stock: reset date_done field at duplication
As the state is reset to draft, makes no sense to keep date of completion.
2015-04-09 14:12:51 +02:00
Denis Ledoux f92b2f8d4d [MERGE] forward port of branch 7.0 up to 0b7db55 2015-02-06 14:02:43 +01:00
Denis Ledoux 764be06f44 [FIX] stock: obvious distraction error of previous rev. 8ff7d299f5 2015-02-05 15:09:06 +01:00
Denis Ledoux 8ff7d299f5 [FIX] stock: picking, Set date of reception if not set by user previously
If the date_done field of the model stock.picking is already filled in
it means the user do wanted to have this date of reception date
instead of the moment when the user clicked the receive button.

opw-627219
2015-02-05 15:04:58 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Martin Trigaux f406847613 [FIX] delivery: reset delivery info on duplicate/backorder
The tracking reference and other delivery references are not relevant to
duplicated pickings. Overwrite copy to remove carrier_tracking_ref, volume and
number_of_packages.

Add fallback on stock.picking.in and out to use copy method of stock.picking.

For partial delivery, the duplicated picking is the delivered order and
the existing picking is the backorder of the delivery (why so much hate?).
This means we have to switch the delivery info between the backorder and
the delivered picking.
Combo opw 615593 and 618802
2015-01-14 17:44:37 +01:00
Christophe Simonis 2ed212dcbf [MERGE] forward port of branch 7.0 up to d6daf5f 2014-12-03 17:51:06 +01:00
Julien Legros bfadcdd5d6 [FIX] stock: compute average price on action_done
The average price computation is now deduplicated and moved to
a separate function called in stock_move action_done.
This makes sure it is always called when a stock.move is
processed, even without going through the partial picking wizard.

Fixes #2991
Closes #3949
OPW-615491
2014-12-02 19:32:49 +01:00
Denis Ledoux e347011f24 [MERGE] forward port of branch 7.0 up to 2080ea0 2014-11-27 13:27:37 +01:00
Mohammad Alhashash 2461baa0dd [FIX] stock: prevent serial number deletion on stock.move
prodlot_id field may be required due to constraint `_check_tracking`.
When a stock.production.lot is deleted, the constraint on linked stock.move is
not checked. To avoid inconsistency, restrict the suppression.
To allow the modification of existing stock.move, remove the states attribute on
the field definition.

As removal of serial may impact the traceability, it makes sense on buisness
point of view to force the modification of previous stock.move, even if the
constraint would not have been violated.
The list of linked stock.move is present on the serial form view making
the operation easier.

Fixes #3560, lp:1176912
2014-11-27 12:47:41 +01:00
Denis Ledoux 7ab413724a [MERGE] forward port of branch 7.0 up to da15c9d 2014-11-14 15:59:33 +01:00
Martin Trigaux cf488682c8 [FIX] stock: multicompany reception
When a picking is confirmed, the generated account.move(.line) should take the
company, accounts, journals and period with the same company as the picking,
not the one of the current user.

This was problematic if a user in a company confirm a picking linked to
a purchase order done in another company.
For real time valuations, the generated accounting entries were mixing both
companies.

Fixes #3466
2014-11-14 12:24:40 +01:00
Denis Ledoux 8c4a7cb371 [MERGE] forward port of branch 7.0 up to 5035c76 2014-11-04 12:19:58 +01:00
Mohammad Alhashash 8af9fdfa06 [FIX] stock: more tolerant copy method
Allow setting origin/backorder when copying new stock.picking
Fixes #379, lp:1098557
2014-10-31 14:09:25 +01:00
Martin Trigaux aed71f3962 [IMP] stock: avoid errors with picking without quantity
When a line is not present in the partial delivery wizard, computation variables are initialized with generic values (zero quantity, zero price,...). Instead of setting the uom to False, keep the quantity of the move.
This makes a difference only when the quantity of the move is 0. That means that the move will be marked as complete and can be processed.
This avoids trying to update the stock.move with a uom at False. opw 616844
2014-10-31 12:32:08 +01:00
Christophe Simonis 21b1203ee0 [MERGE] forward port of branch 7.0 up to 43db726 2014-10-29 19:05:43 +01:00
Mohammad Alhashash 43db7267c5 [FIX] stock: UoS quantity in stock.picking
Implements the UoS TODO items on stock.picking.do_partial() to fix #1432.
Add a new method _compute_uos_qty() on product.product to computes
product's invoicing quantity in UoS from quantity in UoM.

The created invoice will use the product_uos of the stock.move, meaning keeping
the quantity specified on the partial picking and the unit of measure of the
original stock.move (e.g. recieving 1 dozen from a 12 unit picking should either
get uos=dozen, uos_qty=1 or uos=unit, uos_qty=12, not a mix of both)

Fixes #1432, opw 611479
2014-10-29 10:10:50 +01:00
Martin Trigaux 0c36f8a4ce Forward port of branch 7.0 up to 1933e92 2014-09-24 17:10:14 +02:00
Guewen Baconnier b5c8ced8ec [IMP] stock: Optimize stock_move.setlast_tracking()
When setlast_tracking is called on a large number of moves in a picking
(e.g.  when splitting moves in a picking), the time to complete grows
exponentially.  The reason is that it loops over all the moves of
a picking, even if it keeps only the last tracking.

The method now uses a search() with a limit so it doesn't need to browse
all the moves.

Added test to check the behaviour of setlast_tracking
Fixes #2448
2014-09-24 16:41:29 +02:00
Martin Trigaux 933d098e7d [IMP] stock: do not generate empty backorders
If every line of a partial delivery is at zero, do not generate empty backorders (opw 608680)
2014-09-24 15:16:38 +02:00
Martin Trigaux c82bd1365c Forward port of 7.0 up to rev 9b87d6f 2014-09-19 15:28:02 +02:00
Martin Trigaux 6b9b948a3c [IMP] stock: display translated selection value in message
When a user tried to delete a done or canceled picking, the error messages used to display the key of the selection field ('done' or 'cancel') which was surprising in other languages than English. This patch takes the string value of the selection field, keeping the context to get the translated value (opw 613068)
2014-09-19 11:34:47 +02:00
Denis Ledoux 978fd47261 [MERGE] forward port of branch 7.0 up to 095be21 2014-08-06 13:06:20 +02:00
Rifakat Husen bc4217ced2 [FIX] stock: onchange method should take the description
The onchange_product_id method used to only change the description if the stock.move is not saved yet. That does not make much sense.
opw 607347, bug lp:1314700
2014-08-06 08:54:31 +02:00
Christophe Simonis 310d3fe4c4 [MERGE] forward port of branch 7.0 up to 39f3e40 2014-07-30 18:55:31 +02:00
Lionel Sausin (Numérigraphe) dd4d72d710 [FIX] stock: partial deliveries switch on delivered picking
Users don't care for the backorder picking precisely because they can't process it, whereas they may have to do some more things on the picking they processed: invoice it, print delivery orders or transportation stickers..
Refresh the browse record after changing the name to avoid the need to rebrowse.
Fixes #1372
2014-07-29 16:15:20 +02:00
Denis Ledoux 6b1a804b29 [MERGE] forward port of branch 7.0 up to b91a75f7ef
Conflicts:
	addons/base_vat/base_vat.py
	openerp/tools/safe_eval.py
2014-07-29 10:42:50 +02:00
Denis Ledoux a5531c1d29 [FIX] stock: do not set user_id on prepare_invoice_group
The user_id is already set by the prepare_invoice method, which is called before the prepare_invoice_group (the user_id is already set, thus)
Besides, _prepare_invoice is overriden in sale_stock, to set the picking sale order salesman as user_id, and, without this correct, grouping invoicse by partner re-set the user_id to uid, which is wrong.
2014-07-24 20:42:21 +02:00
Martin Trigaux b5918cb55c [MERGE] forward port of branch 7.0 up to 67cca3f 2014-07-23 16:23:22 +02:00
Hardik Ansodariya 9a20018166 [FIX] stock: allow same serial number for different products
Bug lp:1222289, opw 597639
2014-07-23 10:03:40 +02:00
Olivier Dony f3880a8a09 [MERGE] Forward-port of 7.0 up to 64ac1b0 2014-07-04 17:07:53 +02:00
Lionel Sausin (Numérigraphe) e80014eae3 [FIX] Fixes #273: avoid double-warning when changing the quantity of a stock move 2014-07-02 15:28:50 +02:00
Christophe Simonis 4601d85944 [MERGE] forward port of branch 7.0 up to 6fdb783 2014-06-10 11:49:14 +02:00