The generation of SN is incorrect with the following initial sequence:
`BAV023B00001S00001`.
Indeed, the sequence generated is: `BAV023B00001S`, `BAV023B00002S`.
This occurs because the same digits `00001` appear more than once.
opw-2230913
closesodoo/odoo#49408
X-original-commit: b3369bc230160d6cafec77eed0e756c6f1c576d9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, we can't use the Generate and Assign Serial Numbers
on already existing move line. It always creates new one, even if the
picking type use "Pre-fill Detailed Operations".
Now, it will edit existing lines, except if we ask to generate more SN
than we have unassigned move lines, or if the picking don't use the
"Pre-fill Detailed Operations" option, in which cases it will still
create new move line with the generated SN.
Also, before this commit, paste a list of serial numbers to assign them
on multiple move lines in once work only with creation of a new move
line for each serial number.
Now, it's also work with existing move lines.
Finally, some code shared the same logic in `stock.move` in the move
line onchange method and in the `_generate_serial_numbers` method.
Moves this code in a new method, `_generate_serial_move_line_commands`,
and call it in the two previous methods.
task-2150561
closesodoo/odoo#42316
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
When user doesn't use automatically generated move lines, he/she can
copy a list on Serial Number in the `lot_name` field, it will create a
new move line for each value with the corresponding `lot_name`.
Also, as we need a line break char to split the field value, we need the
field is a testarea as a simple input can't have value with breaklines.
So, the `lot_name` need to be a field text instead of char.
Task #2028780closesodoo/odoo#35532
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
In detailed operation view, the method to generate and assign multiple
SN numbers will create a move line depending of the SN name the user
defined and the number of SN to generate. These features are only
accessible if picking option "Pre-fill Detailed Operations" is disabled.
Also, hides the quick "Assign Serial Numbers" button in the same case.
Task #2028780
Adds a button in stock move form view to generate multiple serial number
and assigns them to stock move lines.
Through a wizard, the user enter the first SN. Then, starting with this
number, iterates to assign and increment the SN on each move line who
doesn't have already one.
Task #1832645closesodoo/odoo#33466
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>