fix: refs #8612 handled duplicate code error in shelving & parking

This commit is contained in:
PAU ROVIRA ROSALENY 2025-02-19 12:53:29 +01:00
parent 728e6e921a
commit ff3268b6e9
4 changed files with 413 additions and 402 deletions

View File

@ -258,5 +258,6 @@
"clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}", "clonedFromTicketWeekly": ", that is a cloned sale from ticket {{ ticketWeekly }}",
"negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})", "negativeReplaced": "Replaced item [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} with [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} from ticket [{{ticketId}}]({{{ticketUrl}}})",
"The tag and priority can't be repeated": "The tag and priority can't be repeated", "The tag and priority can't be repeated": "The tag and priority can't be repeated",
"duplicateWarehouse": "The introduced warehouse already exists" "duplicateWarehouse": "The introduced warehouse already exists",
"duplicateCode": "The code already exists"
} }

View File

@ -399,5 +399,6 @@
"Price cannot be blank": "El precio no puede estar en blanco", "Price cannot be blank": "El precio no puede estar en blanco",
"clonedFromTicketWeekly": ", que es una linea clonada del ticket {{ticketWeekly}}", "clonedFromTicketWeekly": ", que es una linea clonada del ticket {{ticketWeekly}}",
"negativeReplaced": "Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})", "negativeReplaced": "Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})",
"duplicateWarehouse": "El almacén seleccionado ya existe en la zona" "duplicateWarehouse": "El almacén seleccionado ya existe en la zona",
"duplicateCode": "El código ya existe"
} }

View File

@ -0,0 +1,5 @@
module.exports = Self => {
Self.validatesUniquenessOf('code', {
message: `duplicateCode`
});
};

View File

@ -1,4 +1,8 @@
module.exports = Self => { module.exports = Self => {
require('../methods/shelving/getSummary')(Self); require('../methods/shelving/getSummary')(Self);
require('../methods/shelving/addLog')(Self); require('../methods/shelving/addLog')(Self);
Self.validatesUniquenessOf('code', {
message: `duplicateCode`
});
}; };