[FIX] stock: import inventory adjustement

Traceback due to variable quant not instanciate during import.
It's due to commit a381b6fdd19d4f1a4512efe4f4877c50b5fd453e

closes odoo/odoo#126912

X-original-commit: 10e9e66b275649ef36880f4b7a6fbd4c3dc739d9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
Arnold Moyaux
2023-06-30 10:42:25 +02:00
parent 786fc50629
commit c0ae4f59de
+1
View File
@@ -272,6 +272,7 @@ class StockQuant(models.Model):
lot_id = self.env['stock.lot'].browse(vals.get('lot_id'))
package_id = self.env['stock.quant.package'].browse(vals.get('package_id'))
owner_id = self.env['res.partner'].browse(vals.get('owner_id'))
quant = self.env['stock.quant']
if not self.env.context.get('import_file'):
# Merge quants later, to make sure one line = one record during batch import
quant = self._gather(product, location, lot_id=lot_id, package_id=package_id, owner_id=owner_id, strict=True)