Return stock moves with parents is impossible

Bug #798292 reported by Omar (Pexego)
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Wishlist
OpenERP R&D Addons Team 2

Bug Description

Hi,

If you have a move with parents moves inside any picking and you try return it, it fails, with this exception: "There are no products to return (only lines in Done state and not fully returned yet can be returned)!"
In the source, it checks if the quantity of move to return is less or equal than sum of quantities of his parents (move_history_ids2), that to know if this move was returned yet, but it's wrong, it must check his child moves (move_history_ids) where returns will be registered.

Regards.

Tags: pexego
Revision history for this message
Omar (Pexego) (omar7r) wrote :
Revision history for this message
Omar (Pexego) (omar7r) wrote :

I reattach the patch because this bug isn't in this line it is in all the file, move_history_ids2 is used instead of move_histoy_ids.

Revision history for this message
Omar (Pexego) (omar7r) wrote :

This isn't a good strategy for this objective, with my patch if the origin move was part of any production it can fail too, because the child quantity is more than move quantity.
Anyway this file uses move_history_ids2 (parents) instead of move_history_ids (childs), but it isn't a good strategy, this wizard must be rewrited.

Changed in openobject-addons:
status: New → Opinion
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Checking my last message it doesn't fail, only could return the available quantity, it is correct but with my patch applied, it need sum child moves quantities instead of parent move quantities.

Changed in openobject-addons:
status: Opinion → New
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Omar,

Would you please elaborate more, I can not get you exactly. I have checked this issue at my end by returning the created done picking and when I again try to call return picking wizard , It shows me same warning what you mention which is normal behaviour. But You did not mention this all things in bug specification, Would you please explain this case what you aspect and What you did get.

Thanks.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi Vinay,

Yes, because this wizard set the return move like parent of origin move, but it must be child of origin move, or not? Then int all file you must use move_history_ids instead of move_history_ids2.

Imagine that your origin move have parents, who aren't returns, this wizard checks all parents moves then the sum of parents quantity doesn't represent the consumes or returns quantity, this quantity is represented by children moves.

Test it, thanks

Changed in openobject-addons:
status: Incomplete → Opinion
Omar (Pexego) (omar7r)
Changed in openobject-addons:
status: Opinion → New
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Claire (cjin) wrote :

Hi,

How can we fix it for now?

Thank you.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

I've tagged this bug as duplicate of https://bugs.launchpad.net/openobject-addons/+bug/944025 which is being fixed by the openerp support team on the 6.0 and 6.1 branches.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.