Odoo Help

0

Remove constraint on BOM lines

By
EJ Starkey
on 5/9/16, 7:40 PM 496 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?

0
ayman mohammed adam
On 5/19/16, 8:29 AM

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 !'),

]

0
EJ Starkey
On 5/10/16, 2:54 AM

Sharma this does not fix the issue at hand

0
Prakash Sharma
On 5/10/16, 2:06 AM

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/9/16, 7:40 PM
Seen: 496 times
Last updated: 5/19/16, 8:29 AM