Odoo Help

Welcome!

This community 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.

0

Remove constraint on BOM lines

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

--Prakash Sharma--
815
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

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

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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