Deleting boms does not delete subproducts (Byproduct Module)

Bug #1244183 reported by Paul Catinean on 2013-10-24
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
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

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
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

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!

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
Paul Catinean (wiz-keed) wrote :

Very happy to help Amit!

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?

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) on 2014-04-05
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  Edit
Everyone can see this information.

Other bug subscribers