mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Explain intent of pending_quants and simplify loop condition
As suggested by @oihane
This commit is contained in:
committed by
Cyril Gaudin
parent
7dac9d65c2
commit
2105eacc3e
@@ -24,10 +24,10 @@ class StockQuant(models.Model):
|
||||
|
||||
@api.multi
|
||||
def merge_stock_quants(self):
|
||||
pending_quants = self.filtered(lambda x: True)
|
||||
for quant2merge in self:
|
||||
if (quant2merge in pending_quants and
|
||||
not quant2merge.reservation_id):
|
||||
# Get a copy of the recorset
|
||||
pending_quants = self.browse(self.ids)
|
||||
for quant2merge in self.filtered(lambda x: not x.reservation_id):
|
||||
if quant2merge in pending_quants:
|
||||
quants = self.search(self._mergeable_domain())
|
||||
cont = 1
|
||||
cost = quant2merge.cost
|
||||
|
||||
Reference in New Issue
Block a user