Existing Auto Repeats fails after adding custom field [solved]

When mandatory custom fields were added to a DocType (i.e. Sales Invoice), existing auto repeats will naturally fail because that field is empty.

To fix this (mysqldump first!):

cd /var/www/frappe-bench (or wherever yours is)
bench --site erp.km-it.de mariadb

SET SQL_SAFE_UPDATES = 0;
UPDATE `tabAuto Repeat` a INNER JOIN `tabSales Invoice` b on a.reference_document = b.name SET b.custom_description = a.frequency;
SET SQL_SAFE_UPDATES = 1;

(here custom field is “description” and is set to auto repeat frequency)

1 Like