mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Copy notes (#5546)
* Add option to copy notes when duplicating a part * Update front-end forms
This commit is contained in:
parent
9deec91ec2
commit
17d227443d
@ -380,6 +380,11 @@ class DuplicatePartSerializer(serializers.Serializer):
|
||||
required=False, default=False,
|
||||
)
|
||||
|
||||
copy_notes = serializers.BooleanField(
|
||||
label=_('Copy Notes'), help_text=_('Copy notes from original part'),
|
||||
required=False, default=True,
|
||||
)
|
||||
|
||||
|
||||
class InitialStockSerializer(serializers.Serializer):
|
||||
"""Serializer for creating initial stock quantity."""
|
||||
@ -739,6 +744,10 @@ class PartSerializer(InvenTree.serializers.RemoteImageMixin, InvenTree.serialize
|
||||
if duplicate['copy_bom']:
|
||||
instance.copy_bom_from(original)
|
||||
|
||||
if duplicate['copy_notes']:
|
||||
instance.notes = original.notes
|
||||
instance.save()
|
||||
|
||||
if duplicate['copy_image']:
|
||||
instance.image = original.image
|
||||
instance.save()
|
||||
|
@ -275,6 +275,10 @@ function partFields(options={}) {
|
||||
value: global_settings.PART_COPY_BOM,
|
||||
};
|
||||
|
||||
fields.duplicate__copy_notes = {
|
||||
value: true,
|
||||
}
|
||||
|
||||
fields.duplicate__copy_parameters = {
|
||||
value: global_settings.PART_COPY_PARAMETERS,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user