0
2 答案
0
最佳答案
Hi,
the only way to manage your case this is a comment line of Python code :
in file mrp/mrp.py line 264 :
262. _constraints = [
263. (_check_recursion, 'Error ! You cannot create recursive BoM.', ['parent_id']),
264. #(_check_product, 'BoM line product should not be same as BoM product.', ['product_id']),
]
but it is not professional, the best way is to create a new module to do that
0
最佳答案
To redefine a python constraint, you can override it by setting the same method function name:
In a module puts:
class mrp_bom(orm.Model):
_inherit = 'mrp.bom'
def _check_product(self, cr, uid, ids, context=None):
return True
_constraints = [(_check_product, 'Override of _check_product constraint', ['product_id'])]