2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Add title when creating child build (#9893)

This commit is contained in:
Oliver
2025-06-28 12:09:26 +10:00
committed by GitHub
parent 5ccf7a6e45
commit ab5765685a

View File

@ -29,7 +29,7 @@ class AutoCreateBuildsPlugin(EventMixin, InvenTreePlugin):
SLUG = 'autocreatebuilds' SLUG = 'autocreatebuilds'
AUTHOR = _('InvenTree contributors') AUTHOR = _('InvenTree contributors')
DESCRIPTION = _('Automatically create build orders for assemblies') DESCRIPTION = _('Automatically create build orders for assemblies')
VERSION = '1.0.0' VERSION = '1.1.0'
def wants_process_event(self, event) -> bool: def wants_process_event(self, event) -> bool:
"""Return whether given event should be processed or not.""" """Return whether given event should be processed or not."""
@ -93,6 +93,7 @@ class AutoCreateBuildsPlugin(EventMixin, InvenTreePlugin):
Build.objects.create( Build.objects.create(
part=subassembly, part=subassembly,
parent=build, parent=build,
title=f'Generated child build for {build.reference}',
project_code=build.project_code, project_code=build.project_code,
quantity=required_quantity, quantity=required_quantity,
responsible=build.responsible, responsible=build.responsible,