Skip to content

Commit 63b823f

Browse files
committed
[IMP] with tag and supplier_min_qty
1 parent 32beea1 commit 63b823f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

import_helper_generic/wizards/import_helper_generic.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ def product_import_generic(self):
262262
"default_location_id"
263263
)
264264
vals = import_obj._prepare_product_vals(vals, location_id, speedy)
265+
if not vals:
266+
logger.warning("Product on line %s skipped", vals.get("line"))
267+
continue
265268
res = (
266269
self.env["product.product"]
267270
.browse(speedy_product_list[vals[reference]])
@@ -283,6 +286,9 @@ def product_import_generic(self):
283286
"default_location_id"
284287
)
285288
vals = import_obj._prepare_product_vals(vals, location_id, speedy)
289+
if not vals:
290+
logger.warning("Product on line %s skipped", vals.get("line"))
291+
continue
286292
if vals["product_tmpl_id"] in list_product_create:
287293
template = list_product_create[vals["product_tmpl_id"]]
288294
else:
@@ -310,6 +316,10 @@ def product_import_generic(self):
310316
vals = import_obj._prepare_product_vals(
311317
vals, vals["location_id"], speedy
312318
)
319+
if not vals:
320+
logger.warning("Product on line %s skipped", vals.get("line"))
321+
continue
322+
313323
res = record.write(vals)
314324
if res:
315325
logger.info(f"Update {res.name} {res.id} Ok")
@@ -326,6 +336,9 @@ def product_import_generic(self):
326336
"default_location_id"
327337
)
328338
vals = import_obj._prepare_product_vals(vals, location_id, speedy)
339+
if not vals:
340+
logger.warning("Product on line %s skipped", vals.get("line"))
341+
continue
329342
p_tmpl = self.env["product.template"].create(vals)
330343
speedy_product_template_list[p_tmpl.default_code] = p_tmpl.id
331344
list_product_create[p_tmpl.id] = p_tmpl

0 commit comments

Comments
 (0)