Files
manufacture/mrp_operations_extension/__init__.py
2015-12-04 18:41:28 +01:00

20 lines
726 B
Python

# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import models
from . import wizard
def post_init_hook(cr, pool):
""" Set do_production on the last workcenter line of each routing """
cr.execute(
"""
UPDATE mrp_routing_workcenter SET do_production = TRUE
WHERE id IN (
SELECT (
SELECT id FROM mrp_routing_workcenter WHERE routing_id = mr.id
ORDER BY sequence DESC, id DESC LIMIT 1)
FROM mrp_routing mr);
""")