Deleting boms does not delete subproducts (Byproduct Module)

Bug #1244183 reported by Paul Catinean
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP R&D Addons Team 2
OpenERP Community Backports (Addons)
Status tracked in 7.0
7.0
Fix Committed
Medium
Paul Catinean

Bug Description

The summary if pretty self explanatory

I install mrp_byproduct

Create a product

Create a bom with byproduct using the previously created product

Delete bom and product cannot be deleted because mrp.subproduct still references it and select * from mrp_subproduct reveals results when all boms are deleted...is this normal behaviour?

Related branches

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello,

I think you have misunderstood something, I have attached my brief tested screen cast, which will clarify your issue.

Hope this will helpful to you.

Thanks,

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Paul Catinean (wiz-keed) wrote :

Hello Christian and thank you very much for taking interest in this topic

I saw the video, the only thing missing was to set inside the bom a byproduct in the Byproducts tab and then delete the whole bom, since byproducts are kept in a separate table

Try the same example only this time setting the same product or some other product in the byproducts tab

If it works again then I'm wrong

Kind regards,

Paul

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Paul,

Yes, You are correct!. I have tested the same and issue data still linked on database

We can't seen its simply but we have to checked it via potgres, please select id from mrp_subproduct; It's still gives the result aftre delete the bom.

Thank you!

Revision history for this message
Amit Parik (amit-parik) wrote :

We need to override the unlink method of mrp_bom for resolve it.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Paul Catinean (wiz-keed) wrote :

Very happy to help Amit!

Revision history for this message
Paul Catinean (wiz-keed) wrote :

Amit, one last thought: Instead of updating the unlink method wouldn't it be better/safer to just set cascade delete so it automatically happens and there's also a sql constraint to it?

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Paul,

Thanks for the response!

I agreed with you, we can use the ondelete="cascade" that will be usable.

Thanks for the notification!

Changed in openobject-addons:
status: Confirmed → Fix Committed
Paul Catinean (wiz-keed)
summary: - Deleting boms does not delete subproducts (Byproduct Module) ?
+ Deleting boms does not delete subproducts (Byproduct Module)
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.