[FIX] product: add store=dict to field name_template

Recompute the name_template field if the template changes.

backport of 41628fc + f25c5d8 to 7.0 plus some optimisations in triggers
Fixes #3277