gavinvaske / the_recipe_book

0 stars 0 forks source link

Duplicate Key Error when Creating `BaseProduct` #378

Open gavinvaske opened 1 month ago

gavinvaske commented 1 month ago

Steps to Repeat

Create a BaseProduct via /forms/product using customer-foobar

Then, update that product and change customer-foobar to be a different customer

Then Create a NEW baseProduct, using customer-foobar

When you try to save the NEW product, you should see a duplicate key-error. This is a result from the "generateUniqueProductNumber()" function that runs when a document is created. I know the issue, but not what the ideal solution.

One option is to make the "customer" field a read-only field, which would fix the issue, talk with Storm if that's fine