fix(webapp): warehouse and branch reset on invoice form

This commit is contained in:
a.bouhuolia
2023-05-24 23:52:05 +02:00
parent 4d54d180bc
commit aaceea5338
5 changed files with 36 additions and 25 deletions

View File

@@ -269,3 +269,14 @@ export const useInvoiceIsForeignCustomer = () => {
);
return isForeignCustomer;
};
export const resetFormState = ({ initialValues, values, resetForm }) => {
resetForm({
values: {
// Reset the all values except the warehouse and brand id.
...initialValues,
warehouse_id: values.warehouse_id,
brand_id: values.brand_id,
},
});
};