diff --git a/apps/mtm/services.py b/apps/mtm/services.py index 1072983c..26130462 100644 --- a/apps/mtm/services.py +++ b/apps/mtm/services.py @@ -61,9 +61,8 @@ def daoru_material(path: str): 'model': model, 'unit__iexact': unit} if type in [20, 30]: filters['process'] = process - default = filters - default['number'] = f'm{type}_{ranstr(6)}' - default['id'] = idWorker.get_id() + default = {'type': type, 'name': name, 'specification': specification, + 'model': model, 'unit': unit, 'number': f'm{type}_{ranstr(6)}', 'id': idWorker.get_id()} Material.objects.update_or_create( defaults=default, **filters