-
- Downloads
[FIX] stock: assign SN on move Lines
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
closes odoo/odoo#42316
Signed-off-by:
Simon Lejeune (sle) <sle@openerp.com>
Showing
- addons/stock/models/stock_move.py 89 additions, 38 deletionsaddons/stock/models/stock_move.py
- addons/stock/tests/test_generate_serial_numbers.py 13 additions, 3 deletionsaddons/stock/tests/test_generate_serial_numbers.py
- addons/stock/views/stock_move_views.xml 5 additions, 16 deletionsaddons/stock/views/stock_move_views.xml
Loading
Please register or sign in to comment