Commit Graph

1209 Commits

Author SHA1 Message Date
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
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
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 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
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
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 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
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
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
Martin Trigaux 81ae6cdeeb [IMP] stock: when checking the state of the product, do not recompute the quantity on every move but only the one currently browsing (optiomisation) 2014-06-05 18:38:19 +02:00
Martin Trigaux 841e47a46a [FIX] stock: use correct vals in grouped invoice (opw 606535)
When creating a grouped invoice, the invoice_vals value is used to create the invoice line.
The value was not reset for grouped invoice and we reused the values of previous line.
2014-06-04 10:42:43 +02:00
Martin Trigaux 41c5ceb8eb [FIX] stock: clean previous commit 2014-05-27 17:56:30 +02:00
Anaël Closson f96a03247b [FIX] stock: auto_validate move not set to done when multiple parent move set to done at the same time - opw 607970 2014-05-22 09:26:40 +02:00
Martin Trigaux 37c41f9c78 [FIX] stock: when delivering a product in average cost, make sure the price_unit on the stock.move is up to date (opw 607272)
bzr revid: mat@openerp.com-20140429145332-s3c22w47aihdsfub
2014-04-29 16:53:32 +02:00
Martin Trigaux acc784cc99 [FIX] stock: pass the geven limit attribute in read_group call, courtesy of Guewen Baconnier
bzr revid: mat@openerp.com-20140423150621-rjiae83nxh5tqyau
2014-04-23 17:06:21 +02:00
Martin Trigaux f613774606 [MERGE] [FIX] stock: fix error when executing a read_group on stock.picking.in and out, courtesy of Yannick Vaucher (Camptocamp)
bzr revid: mat@openerp.com-20140423132552-hpnr2skutqranvsj
2014-04-23 15:25:52 +02:00
Martin Trigaux aac1a81999 [MERGE] [FIX] stock: when duplicating a stock.move, remove serial number and tracking information in every cases instead of specific to duplication of invocies, courtesy of Guewen Baconnier
bzr revid: mat@openerp.com-20140422140337-ymq7x133eicy6rpa
2014-04-22 16:03:37 +02:00
Yannick Vaucher 229f48bb2d Fix group by access error on stock.picking.in/out in multi company by ensuring the good ir rules are applied, this is done by calling read_group using stock.picking intead of stock.picking.in/out.
lp bug: https://launchpad.net/bugs/1309105 fixed

bzr revid: yannick.vaucher@camptocamp.com-20140417164953-7bjuggmhktv7mfwx
2014-04-17 18:49:53 +02:00
Denis Ledoux f658a55e4e [FIX] stock: before creating chained pickings, regroup moves by chained auto packing
Before, all moves issued from a same purchase order were put in the same chained picking, and, therefore, the moves were all treated with the same behavior (manually, automaticaly, ...)

bzr revid: dle@openerp.com-20140415160331-kzgib87qabvpc86p
2014-04-15 18:03:31 +02:00
Lionel Sausin 8ee8e3668c [FIX] Add missing context to some calls
lp bug: https://launchpad.net/bugs/1291874 fixed

bzr revid: ls@numerigraphe.com-20140313095054-3506f3tan8eyqc61
2014-03-13 10:50:54 +01:00
Guewen Baconnier 0ff86218f6 Use setdefault to allow a copy with one of this field with a value
bzr revid: guewen.baconnier@camptocamp.com-20140224090354-wcsnd4wzs91w553e
2014-02-24 10:03:54 +01:00
Guewen Baconnier 1daeaed376 [FIX] use copy_data rather than doing a write after that the moves are created
lp bug: https://launchpad.net/bugs/1281558 fixed

bzr revid: guewen.baconnier@camptocamp.com-20140218123211-3l3bvi3at1s91lfi
2014-02-18 13:32:11 +01:00
Denis Ledoux d69ecb8d8f [FIX] mrp, stock: avoid float rounding errors using float_compare
bzr revid: dle@openerp.com-20140122133822-fkt5gqanpptlx9jx
2014-01-22 14:38:22 +01:00
Martin Trigaux 9542ae89aa [FIX] stock: switch ids new - old picking in the message informing the back order was created (opw 594402)
Post on delivered picking that the backorder was created. Was inconsitent with the field 'Back order of'

bzr revid: mat@openerp.com-20131128145059-p3mw969z3lotkn26
2013-11-28 15:50:59 +01:00
Olivier Dony 17144e9914 [FIX] stock.picking.in: typo in default_get implementation
bzr revid: odo@openerp.com-20131121153230-keie85rmes2zh2o8
2013-11-21 16:32:30 +01:00
Martin Trigaux b6b86f34f4 [MERGE] [FIX] stock: correctly recount quantity when split on multiple locations for product reservations (opw 600277)
bzr revid: mat@openerp.com-20131121112321-fdttljrrogsbihf2
2013-11-21 12:23:21 +01:00
Christophe Simonis 82da5541e2 [MERGE] remove warnings
bzr revid: chs@openerp.com-20131120161051-pk7n0itjcxx06uwm
2013-11-20 17:10:51 +01:00
Olivier Dony f638bc39e4 [FIX] stock: stock.picking.in/out (technical models used to separate several picking types) should also apply _defaults from stock.picking
bzr revid: odo@openerp.com-20131112170133-7o607q6uq2nmuia5
2013-11-12 18:01:33 +01:00
Olivier Dony 520cc1306f [REVERT] stock: commit 9557/OPW 600078 assumes that production lot are guaranteed to be set on each relevant move
This assumption is incorrect in OpenERP v7. The WMS
design in OpenERP 7 and previous versions only permits
tracking production lots (aka serial numbers) on
incoming moves, outgoing moves and production moves.
You can specify production lots on internal moves too,
but the system will also generate internal moves for
many reasons, and nothing guarantees that they will
have the right lots assigned.
This is a design decision, and this means that we
must never enforce the availability of specific
production lots.

This features will be available in OpenERP 8 through
the use of an extra concept called "Quants", that
will make this kind of tracking possible.

bzr revid: odo@openerp.com-20131112153925-1s2b8f2eo568wpxh
2013-11-12 16:39:25 +01:00
Christophe Simonis 4166baa1ba [FIX] stock: mute orm logger before checking access rules
bzr revid: chs@openerp.com-20131108224724-3u72ec3molct34he
2013-11-08 23:47:24 +01:00
Dhruti Shastri (OpenERP) 36b4236e1c [stock] : Wrong Invoice generated due to product_uos_qty not updated (case ref:600277)
bzr revid: dhs@tinyerp.com-20131107113547-d6o11hiu7d8y8g4g
2013-11-07 17:05:47 +05:30
Olivier Dony 05e067415d [FIX] stock: chained location type `Customers` was not working at all for pickings without partner
This can create inconsistencies in the warehouse inventory
in case delivery orders are not customer-specific, e.g.
when using the POS.
When there is no destination customer we can still use
the default Customers locations.

bzr revid: odo@openerp.com-20131107105302-hf8lublc1x3qc87h
2013-11-07 11:53:02 +01:00
Martin Trigaux 2d863f53a2 [MERGE] [FIX] stock: add missing context in account move creation during valuation, courtesy of Lorenzo Battistini (Agile BG)
lp bug: https://launchpad.net/bugs/1184610 fixed

bzr revid: mat@openerp.com-20131119164255-qlvy8p40ztzblova
2013-11-19 17:42:55 +01:00
Olivier Dony 6be89e5f82 [FIX] stock: no early currency rounding when computing average price
It is a common need to set a higher decimal precision
for `Product Price` (i.e. the product cost field) for
high volume / low value items. This may typically
require up to 4-6 decimals for e.g. EUR/USD-based
companies where the currency has 2 decimals.
In that case the product cost should be stored with
full precision without applying the currency rounding.
The appropriate currency rounding will be applied
anyway as soon as a transaction actually uses that
product cost (typically in a SO/PO)

bzr revid: odo@openerp.com-20131104173232-84g115x6ykxoc1rh
2013-11-04 18:32:32 +01:00
Olivier Dony a6ca3b043f [FIX] stock: programming error in average price computation for multiple lines of the same product
While processing a picking we must keep track of
previously processed lines as they modify the
stock on hand but are not yet included in the
`qty_available` function.
Negative stock on hand is handled as if
the stock was zero as far as the average
price computation is concerned.

bzr revid: odo@openerp.com-20131104171245-z1lgsplyu4cdz9gc
2013-11-04 18:12:45 +01:00
Martin Trigaux 621b9f54c8 [FIX] stock: use eventual serial number attribute into account while doing product reservation
bzr revid: mat@openerp.com-20131030145432-2sij3p1dae8ghzuz
2013-10-30 15:54:32 +01:00
Martin Trigaux 98d31e411f [FIX] stock: correctly handle case when we have no child location
bzr revid: mat@openerp.com-20131015112016-vj6yr6kfxfe8go2p
2013-10-15 13:20:16 +02:00
Olivier Dony bec80227d9 [FIX] account_voucher, product, stock: use selection widgets for magic context fields, to pass IDs in the context instead of strings
Many2one fields resolve to strings when used
as `self` within the @context or @filter_domain
attributes of a search field, because they
must be able to support partial matches,
e.g. search for "Sto" to match "Stock".
In many case the code was not prepared to accept
string for the magic context values, so the
magic fields now caused crashes.

The widget="selection" attribute was dropped
during the search view cleanup for 7.0,
without noticing this unfortunate side-effect,
at revision:
  addons 7.0 revno 7142 revid:qdp-launchpad@openerp.com-20120731150358-jqd3eoz06imzlx01

lp bug: https://launchpad.net/bugs/1192484 fixed

bzr revid: odo@openerp.com-20131004105218-edvb5ewduqar3x88
2013-10-04 12:52:18 +02:00
Martin Trigaux 2d25026e3f [IMP] stock: improve performances of _product_reserve by reducing the number of locations that are checked (opw#590466)
bzr revid: mat@openerp.com-20130920112437-giswgxm7o6d17iaf
2013-09-20 13:24:37 +02:00
Martin Trigaux edf34053ad [FIX] stock: use user's language as default value to fetch product translation
bzr revid: mat@openerp.com-20130917074045-4o5t46t7fucqr354
2013-09-17 09:40:45 +02:00
Martin Trigaux 833bc853db [MERGE] [FIX] stock: Correctly pass referece for Chained Location (case: 593003)
bzr revid: mat@openerp.com-20130909153221-0o6nt9d9x0kfk7vt
2013-09-09 17:32:21 +02:00
Martin Trigaux 1ae3118c54 [FIX] stock: change wrong variable name
bzr revid: mat@openerp.com-20130909091837-jkzfijspdyw2g79y
2013-09-09 11:18:37 +02:00
Martin Trigaux f17ab8b43c [FIX] stock: overwrite message_{un,}subscribe on stock.picking.{in,out}
lp bug: https://launchpad.net/bugs/1197169 fixed

bzr revid: mat@openerp.com-20130909081952-t6x482m9f3vt6xmg
2013-09-09 10:19:52 +02:00
Martin Trigaux 33001ec5ff [FIX] stock: post messages on stock.pciking instead of stock.picking.in/out to be able to display messages on the form
This will only display newly posted messages, not already existing.
To do so apply the following SQL command:
UPDATE mail_message SET model = 'stock.picking' WHERE model = 'stock.picking.in' OR model = 'stock.picking.out';

lp bug: https://launchpad.net/bugs/1197169 fixed

bzr revid: mat@openerp.com-20130828151434-5nu7o0ybguh86w6f
2013-08-28 17:14:34 +02:00
Martin Trigaux 3d6dc36407 [MERGE] base mp, courtesy of Alexandre Fayolle (camptocamp)
lp bug: https://launchpad.net/bugs/1182111 fixed

bzr revid: mat@openerp.com-20130823095912-5kwshj6nkdzduejx
2013-08-23 11:59:12 +02:00
Martin Trigaux 38bf262119 [IMP] stock: more fault tolerant usage of xml id
bzr revid: mat@openerp.com-20130731092732-9fa0xb66mo7uakb4
2013-07-31 11:27:32 +02:00
Martin Trigaux 2f07aac8b2 [FIX] stock: remove warning popup on update product quantity wizard and correctly verify access rights on stock.location
lp bug: https://launchpad.net/bugs/1200194 fixed

bzr revid: mat@openerp.com-20130729135844-jtanbteqtg52ztnu
2013-07-29 15:58:44 +02:00
Martin Trigaux ecc9c506a5 [IMP] stock: don't raise error on default values if removed default stock locations data
lp bug: https://launchpad.net/bugs/1178876 fixed

bzr revid: mat@openerp.com-20130729121120-7xh05hcmo8iwbyfk
2013-07-29 14:11:20 +02:00
Martin Trigaux 10cda48728 [IMP] stock: don't raise error on default values if removed default stock locations data
bzr revid: mat@openerp.com-20130729102923-xx55fmomv72qbji6
2013-07-29 12:29:23 +02:00