mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD] Set default for do_production upon installation
This commit is contained in:
committed by
Pedro M. Baeza
parent
70cac50132
commit
44dd40d579
@@ -4,3 +4,16 @@
|
||||
##############################################################################
|
||||
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);
|
||||
""")
|
||||
|
||||
@@ -60,5 +60,6 @@
|
||||
"demo/mrp_routing_demo.xml",
|
||||
"demo/mrp_production_demo.xml",
|
||||
],
|
||||
"post_init_hook": "post_init_hook",
|
||||
"installable": True
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user