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

[9.0] Migration : sale_order_lot_selection #319

Merged
merged 31 commits into from
Sep 28, 2016

Conversation

florian-dacosta
Copy link
Contributor

hurrinico and others added 30 commits August 28, 2015 19:37
[FIX] Fix product_id on test

[FIX] Fix product on test
[FIX] Use product_14 instead of product_11

[FIX] Add test's flow step
[FIX] change data in quant search

[FIX] Fixed tab

[FIX] Add check on lots list

FIX product_id_change_with_wh
Because quants_get_prefered_domain does not return quants with our lots, if other quants are available
Steps to reproduce:

1.- Create a new Sale Order with 2 or more lines of products
2.- Assign lot to every line (ensure lot has stock available)
3.- Confirm the Sale Order
4.- Go to the Delivery Order

Result:

Only the first line in the Delivery Order is in state "Available" and reserved, the rest of the lines are in state "Waiting Availability" and not reserved
@pedrobaeza pedrobaeza mentioned this pull request Jul 29, 2016
50 tasks
@eLBati
Copy link
Member

eLBati commented Aug 31, 2016

Thank you @florian-dacosta
looking at the diff with 8.0 it seems some italian translations are missing.
Did you follow the procedure at https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-9.0#if-the-module-doesnt-exist-in-the-90-branch ?

@eLBati
Copy link
Member

eLBati commented Aug 31, 2016

@florian-dacosta tested the following use case:

  • make an incoming picking for iPad Mini
  • process it with lot 123
  • make a sale order selecting iPad Mini and lot 123 and confirm it
  • make another sale order for iPad Mini and lot 123 and confirm it

You can confirm the second sale order

Expected behaviour:
the system should prevent you to confirm a sale order using a reserved lot (like in 8.0)

Side effect: after having confirmed the sale order, in order to process the related picking, you have to manually add quantities to lot 123

Expected behaviour:
you should be able to validate the related picking just by clicking on validate

Thanks

@florian-dacosta
Copy link
Contributor Author

@eLBati
I did follow the procedure at https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-9.0#if-the-module-doesnt-exist-in-the-90-branch
Maybe I made a mistake, or maybe italian translation have been merged after my PR?

About your tests :
Some things changed from v8 to v9.

For instance, in v9, when the restict_lot_id is filled, Odoo will try to reserve the stock move with a quant of the same lot, and if it does not find any, it will try with a quant without lot.
On the contrary, in v8, it won't reserve a quant without lot.
https://github.com/OCA/OCB/blob/9.0/addons/stock/stock.py#L487

So the module works the way you want if products don't have any stock without lot.
I don't think it is an issue, as, in odoo9, when you choose the option "Tracking : By lots" on the product form, you are forced to put a lot on your incoming picking. So all your product should have a lot.
With demo data, the ipad Mini already has stock without lot, that is why it happens.
If you do a test with a new product, so it does not have stock without lot, it should work as expected.

Regarding the need to validate, just clicking on validate. It is a problem too as Odoo expects the user to indicate how many product he wants to transfer. If product should have lot and the quantity 'done quantity' is 0, it raise an error
https://github.com/OCA/OCB/blob/9.0/addons/stock/stock.py#L1579

For now, the only way I see, to solve this issue, would be to automatically put the qty_done of operations from the reserved quantities when it is created. But it would not impact only the sale orders for which we put a lot, it would impact all stock moves with a restrict_lot_id, and I am not sure it is a good idea.

But it could be a nice feature to have, set the done qty by default, and the user would have to decrease it if needed, instead on increasing it., but I think it would be better in a separated module, as it is not linked to the sale_order_lot_selection main features. And customers could use this feature without using sale_order_lot_selection.
Anyway, if we decide to make this feature in a new module, I don't think sale_order_lot_selection should depend on it.

What do you think?

@eLBati
Copy link
Member

eLBati commented Sep 8, 2016

@florian-dacosta thanks, ok, then, LGTM 👍

@StefanRijnhart
Copy link
Member

👍, thank.

@StefanRijnhart StefanRijnhart merged commit 73ddfe2 into OCA:9.0 Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants