[FIX] stock: assign SN on move Lines - #41284
Closed
svs-odoo wants to merge 2 commits into
Closed
Conversation
svs-odoo
force-pushed
the
13.0-fix-assign-sn-on-move-line-svs
branch
from
December 4, 2019 09:48
3299476 to
1bf703c
Compare
svs-odoo
force-pushed
the
13.0-fix-assign-sn-on-move-line-svs
branch
from
December 4, 2019 13:47
06fb3c2 to
76440e2
Compare
amoyaux
reviewed
Dec 12, 2019
sle-odoo
reviewed
Dec 16, 2019
sle-odoo
reviewed
Dec 16, 2019
sle-odoo
reviewed
Dec 16, 2019
Contributor
There was a problem hiding this comment.
not sure it's more concise than typing this whole filer two times
Contributor
Author
There was a problem hiding this comment.
Indeed it's longer, but I find this:
if self.picking_type_id.show_reserved:
move_lines = self.move_line_ids.filtered(without_lot_filter)
else:
move_lines = self.move_line_nosuggest_ids.filtered(without_lot_filter)... is clearer than that:
if self.picking_type_id.show_reserved:
move_lines = self.move_line_ids.filtered(lambda ml: not ml.lot_id and not ml.lot_name)
else:
move_lines = self.move_line_nosuggest_ids.filtered(lambda ml: not ml.lot_id and not ml.lot_name)But we can use the lambda one, I don't mind.
sle-odoo
reviewed
Dec 16, 2019
sle-odoo
reviewed
Dec 16, 2019
Contributor
There was a problem hiding this comment.
do you really need origin_move_line?
sle-odoo
reviewed
Dec 16, 2019
sle-odoo
reviewed
Dec 16, 2019
sle-odoo
reviewed
Dec 16, 2019
svs-odoo
force-pushed
the
13.0-fix-assign-sn-on-move-line-svs
branch
6 times, most recently
from
December 19, 2019 14:08
c1586c8 to
bd48426
Compare
amoyaux
reviewed
Dec 23, 2019
svs-odoo
force-pushed
the
13.0-fix-assign-sn-on-move-line-svs
branch
2 times, most recently
from
December 23, 2019 12:40
54ceaaa to
b352bec
Compare
sle-odoo
reviewed
Dec 23, 2019
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
The onchange on move lines will generates and assigns lot names. However it's useless to do that if the picking type doesn't allow creation of new lots.
svs-odoo
force-pushed
the
13.0-fix-assign-sn-on-move-line-svs
branch
from
December 23, 2019 14:52
b352bec to
96a8180
Compare
Contributor
|
robodoo r+ rebase-ff |
Contributor
|
Merge method set to rebase and fast-forward |
This was referenced Dec 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
task-2150561