BOM Allows Self reference "recursion error"

Bug #713221 reported by Kyle Waid
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

When creating a BOM for a product OpenERP allows you to add the product in the bom as a component product. What happens is that while processing the bom it tries to reproduce the product over and over again causing a recursion maximum limit error.

When creating BOM it should not allow you to add the product that is the bom as a component. It should check and deny so later when you have over a 1,000 bom you do not have to figure out which one is causing the issue.

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Hello,

It is now fixed in lp:~openerp-commiter/openobject-addons/dev-addons2-rha1 with

Revision ID: <email address hidden>
Revision no: 4499.

It will be available in trunk soon.

Thanks for reporting.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Kyle Waid (midwest) wrote :

Tested with current trunk. This is not fixed. I am still able to create a BOM for a product, then use the same product as a component causing the recursion error.

Revision history for this message
JordiFS (jordi-figuerola) wrote :

I know it is an old thread, but there it goes, for the shake of those that face similar issues:

The solution relies on allowing all products but the one of the BOM. To do this, there have to be changed the view of the form of BOM adding a domain; in the form of [code]domain="[('id','!=', parent.product_id)]"[/code].

In OpenERP vesion 5.0 edit mrp.bom.form view and add the domain as follows:

        <record id="mrp_bom_form_view" model="ir.ui.view">
            <field name="name">mrp.bom.form</field>
            <field name="model">mrp.bom</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Bill of Material">
HERE ==> <field name="product_id" on_change="onchange_product_id(product_id, name)" select="1" domain="[('id','!=', parent.product_id)]"/>
                    <newline/>
                    <field name="product_uom"/>
                    <field name="product_qty"/>
                    <field name="name" select="1"/>

In OpenERP version 6.0 edit mrp.bom.form view and make sure is in:

        <record id="mrp_bom_form_view" model="ir.ui.view">
            <field name="name">mrp.bom.form</field>
            <field name="model">mrp.bom</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Bill of Material">
                    <group colspan="4" col="6">
HERE==> <field name="product_id" on_change="onchange_product_id(product_id, name, context)" select="1" domain="[('id','!=', parent.product_id)]"/>
                        <field name="name" select="1"/>
                        <field name="code" select="1" string="Reference" groups="base.group_extended"/>
                        <newline/>
                        <field name="product_qty"/>

I also I attach patch file if you want to change the source code as well for version 5.0.

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.