This question has been flagged
3 Replies
2887 Views

Hi All and thanks for the opportunity to participate in these forums.

I have a situation that has arisen where I need to have a negative line in a BOM.

This is for a chemical company that weighs all products and we have the MO reflects an accrued weight of ingredients into mixers for validation from the floor workers that are mixing the ingredients.

The problem that I am having is that during an exothermic reaction there is weight loss due to CO2 liberation at different stages of the mix. I need to have a line for a consumable item CO2 -x kg 


The constraints are as follows in the mrp.py -

}

_sql_constraints = [

('bom_qty_zero', 'CHECK (product_qty>0)', 'All product quantities must be greater than 0.\n' \

'You should install the mrp_byproduct module if you want to manage extra products on BoMs !'),

]


Am I able to redefine the constraint by setting the same method function name in a custom module? Does anybody have an example of allowing product_qty to be less than zero?

Avatar
Discard
Best Answer

Hi,

by using contradiction

_sql_constraints = [

('bom_qty_zero', 'CHECK (product_qty>0 and

product_qty<=0

)', 'All product quantities must be greater than 0.\n' \

'You should install the mrp_byproduct module if you want to manage extra products on BoMs !'),

]

Avatar
Discard
Author Best Answer

Sharma this does not fix the issue at hand

Avatar
Discard
Best Answer

you can replace  the SQL constraint with the value CHECK(1=1)

Avatar
Discard