Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] stock: generate lots with import bug #165182

Closed

Conversation

Sehnde
Copy link
Contributor

@Sehnde Sehnde commented May 13, 2024

Fixing a traceback JS error happening when attempting to create lot numbers with import. Odoo will try to read the value of totalReceived even though it doesn't exist.
With this PR, if totalReceived is not defined, it will correctly use props.move.data.product_qty.


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Fixing a traceback JS error happening when attempting to create lot
numbers with import. Odoo will try to read the value of totalReceived
even though it doesn't exist.
With this PR, if totalReceived is not defined, it will correctly use
`props.move.data.product_qty`.
@robodoo
Copy link
Contributor

robodoo commented May 13, 2024

Sehnde referenced this pull request May 13, 2024
This PR makes it possible to generate lot names/numbers in batch from operations in stock picking.
It uses the same `count` field as generate serials to ask for a specific quantity per lot.
A new field `totalReceived` is used to indicate how much is received in total. This is necessary
in cases of partial reception.
The value indicated in `count` will be assigned to as many lots as possible without exceeding
`totalReceived`, with the leftover assigned to a last lot.
The formula: `number_of_lots_generated = (totalReceived // quantity_per_lot) + 1` (if there's leftover).
The rest works the same as the generate serials flow.

task 3506686

closes #150707

Signed-off-by: Steve Van Essche <svs@odoo.com>
@C3POdoo C3POdoo requested a review from a team May 13, 2024 06:55
@C3POdoo C3POdoo added the RD research & development, internal work label May 13, 2024
@Whenrow
Copy link
Contributor

Whenrow commented May 14, 2024

robodoo r+
thank you

robodoo pushed a commit that referenced this pull request May 14, 2024
Fixing a traceback JS error happening when attempting to create lot
numbers with import. Odoo will try to read the value of totalReceived
even though it doesn't exist.
With this PR, if totalReceived is not defined, it will correctly use
`props.move.data.product_qty`.

closes #165182

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
@robodoo robodoo closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants