Why does a custom document not show up in the bulk edit mode?

Viewed 35

I added a custom document as describied in the documentation. Which worked fine, and I can generate it on a single order.

When I go to the bulk edit mode, the standard documents are there, but not my custom document. Do I have to do something else besides creating my doucument and type for it?

1 Answers

As of today the document types available in the bulk edit form seem to be hardcoded. You will have to override the component to add your custom document type:

Component.override('sw-bulk-edit-order', {
    computed: {
        documentsFormFields() {
            const formFields = this.$super('documentsFormFields');
 
            formFields.push({
                name: 'your_document_technical_name',
                labelHelpText: this.$tc('path.to.help-text'),
                config: {
                    componentName: 'plugin-bulk-edit-order-documents-generate-custom-document',
                    changeLabel: this.$tc('path.to.label'),
                },
            });

            return formFields;
        }
    },
});

You'll also need register a custom component like plugin-bulk-edit-order-documents-generate-custom-document to set the data for the document like a date or add a comment like for invoices. Have a look at the existing sw-bulk-edit-order-documents-generate-invoice for reference.

Related