mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MOD] Fixed some problems when there are quants with diferente histories
This commit is contained in:
12
README.rst
12
README.rst
@@ -1,4 +1,14 @@
|
||||
Quant merge
|
||||
===========
|
||||
|
||||
This module allows to merge diferent quants if they meet some requirements.
|
||||
This module allows to merge diferent quants if they meet some requirements.
|
||||
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
|
||||
* Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
|
||||
* Ana Juaristi <ajuaristo@gmail.com>
|
||||
@@ -19,12 +19,13 @@ class StockQuant(models.Model):
|
||||
('package_id', '=', self.package_id.id),
|
||||
('location_id', '=', self.location_id.id),
|
||||
('reservation_id', '=', False),
|
||||
('propagated_from_id', '=', False)])
|
||||
('propagated_from_id', '=', self.propagated_from_id.id)])
|
||||
qty = cost = 0
|
||||
for quant in quants:
|
||||
qty += quant.qty
|
||||
cost += quant.cost
|
||||
quant.unlink()
|
||||
if self._get_latest_move(self) == self._get_latest_move(quant):
|
||||
qty += quant.qty
|
||||
cost += quant.cost
|
||||
quant.unlink()
|
||||
self.cost += cost
|
||||
self.qty += qty
|
||||
|
||||
|
||||
Reference in New Issue
Block a user