Comment 9 for bug 985525

Revision history for this message
Fabio Colognesi (fabio-colognesi) wrote : Re:[Bug 985525] Re: MRP : check_product very strict - BoM line product should not be same as BoM product.

Hello Henry,

Waiting the right correction from OpenErp I will overload the original function. Attached our patch.

class mrp_bom_patch(osv.osv):
    _inherit = 'mrp.bom'
    def _check_product(self, cr, uid, ids, context=None):
        """
            Override original one, to allow to have multiple lines with same Part Number
        """
        return True
    _constraints = [
        (_check_product, 'BoM line product should not be same as BoM product.', ['product_id']),
    ]
mrp_bom_patch()

Bye
Fabio Colognesi

Da: <email address hidden>
A: <email address hidden>
Cc:
Data: Mon, 22 Oct 2012 07:10:59 -0000
Oggetto: [Bug 985525] Re: MRP : check_product very strict - BoM line product should not be same as BoM product.

> Dear all,
>
> Is there a way to disable that constraint?
>
> Thanks
>
> Henry
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1015679).
> https://bugs.launchpad.net/bugs/985525
>
> Title:
> MRP : check_product very strict - BoM line product should not be same
> as BoM product.
>
> Status in OpenERP Addons (modules):
> Confirmed
>
> Bug description:
> In openerp 6.1 on module MRP, there are a function to check product on BoM.
> BoM can't contained two lines or sublines with same product.
>
> For example, we have a bom (bomA) with two bom composent, I named it bcomp1 and bcomp2 .
> bcomp1 and bcomp2 contain a line with same product, product1 and parent bom is bomA.
> With check_product constraint, there are a problem on bomA.
>
> We work in electronic. bcomp1 and bcomp2 are bom of an electronic card
> and they used same LED (product1).
>
> Why this hard check and not checked products only on BoM and checked
> products of bom composent without memorised products of parent BoM ?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-addons/+bug/985525/+subscriptions