/** * WPML compatibility functions * * @global array $duplicated_posts Array to store the posts being duplicated. * * @package Yoast\WP\Duplicate_Post * @since 3.2 */ add_action( 'admin_init', 'duplicate_post_wpml_init' ); /** * Add handlers for WPML compatibility. */ function duplicate_post_wpml_init() { if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { add_action( 'dp_duplicate_page', 'duplicate_post_wpml_copy_translations', 10, 3 ); add_action( 'dp_duplicate_post', 'duplicate_post_wpml_copy_translations', 10, 3 ); add_action( 'shutdown', 'duplicate_wpml_string_packages', 11 ); } } global $duplicated_posts; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: Renaming a global variable is a BC break. $duplicated_posts = []; /** * Copy post translations. * * @global SitePress $sitepress Instance of the Main WPML class. * @global array $duplicated_posts Array of duplicated posts. * * @param int $post_id ID of the copy. * @param WP_Post $post Original post object. * @param string $status Status of the new post. */ function duplicate_post_wpml_copy_translations( $post_id, $post, $status = '' ) { global $sitepress; global $duplicated_posts; remove_action( 'dp_duplicate_page', 'duplicate_post_wpml_copy_translations', 10 ); remove_action( 'dp_duplicate_post', 'duplicate_post_wpml_copy_translations', 10 ); $current_language = $sitepress->get_current_language(); $trid = $sitepress->get_element_trid( $post->ID ); if ( ! empty( $trid ) ) { $translations = $sitepress->get_element_translations( $trid ); $new_trid = $sitepress->get_element_trid( $post_id ); foreach ( $translations as $code => $details ) { if ( $code !== $current_language ) { if ( $details->element_id ) { $translation = get_post( $details->element_id ); if ( ! $translation ) { continue; } $new_post_id = duplicate_post_create_duplicate( $translation, $status ); if ( ! is_wp_error( $new_post_id ) ) { $sitepress->set_element_language_details( $new_post_id, 'post_' . $translation->post_type, $new_trid, $code, $current_language ); } } } } // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: see above. $duplicated_posts[ $post->ID ] = $post_id; } } /** * Duplicate string packages. * * @global array() $duplicated_posts Array of duplicated posts. */ function duplicate_wpml_string_packages() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: renaming the function would be a BC-break. global $duplicated_posts; foreach ( $duplicated_posts as $original_post_id => $duplicate_post_id ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: using WPML native filter. $original_string_packages = apply_filters( 'wpml_st_get_post_string_packages', false, $original_post_id ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: using WPML native filter. $new_string_packages = apply_filters( 'wpml_st_get_post_string_packages', false, $duplicate_post_id ); if ( is_array( $original_string_packages ) ) { foreach ( $original_string_packages as $original_string_package ) { $translated_original_strings = $original_string_package->get_translated_strings( [] ); foreach ( $new_string_packages as $new_string_package ) { $cache = new WPML_WP_Cache( 'WPML_Package' ); $cache->flush_group_cache(); $new_strings = $new_string_package->get_package_strings(); foreach ( $new_strings as $new_string ) { if ( isset( $translated_original_strings[ $new_string->name ] ) ) { foreach ( $translated_original_strings[ $new_string->name ] as $language => $translated_string ) { do_action( // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Reason: using WPML native filter. 'wpml_add_string_translation', $new_string->id, $language, $translated_string['value'], $translated_string['status'] ); } } } } } } } } MRP 作業区 Work Center – Raqqa

MRP 作業区 Work Center

✅ 1. Work Center(作業区)とは

作業区(Work Center)は、作業が実施される物理的または仮想的な場所・設備を表します。

  • 例:溶接ステーション、組立ライン、検査工程、手作業区、ロボットアームなど
  • それぞれに「コスト」「処理能力」「待機時間」「作業時間」などを設定できます。

✅ 2. 複数作業区の用途

活用パターン説明
シーケンシャル工程製造ルーティングに複数の作業区を順番に並べ、工程の流れを再現する(例:組立 → 検査 → 梱包)
並列作業同じBOMを異なる作業区で並行して処理(例:Aライン、Bラインの2ライン並行生産)
キャパシティ分散複数の作業区に割り当てを分けることで、作業負荷を分散しリードタイムを短縮

✅ 3. 設定手順(Odoo標準)

🔧 作業区の作成

  1. 製造 > 設定 > 作業区
  2. 「新規作成」から複数の作業区を作成
    例)Work Center A(組立)、Work Center B(検査)

🛠 ルーティング(工程)の作成

  1. 製造 > 製品 > ルーティング
  2. ルーティングにステップを追加し、それぞれに作業区を割り当てる
    • ステップ1: Work Center A(所要時間:10分)
    • ステップ2: Work Center B(所要時間:5分)

🔁 製品のBOMにルーティングを紐づけ

  1. 製造BOM > 編集 > ルーティングの選択
    • 先ほど作成したルーティングを指定

✅ 4. 実行時の運用

  • 製造オーダーを作成すると、指定されたルーティングに従って作業指示(作業オーダー)が各作業区に発行されます。
  • 各Work Centerで開始・終了ボタンで時間を記録し、生産実績・所要時間・人件費が記録されます。
  • **スケジューラー(計画)**と連動して、各作業区の予定・稼働状況も確認できます。

✅ 5. よくあるユースケース

工程作業区構成
製品組立組立 → 検査 → 梱包Work Center A → B → C
食品加工原料処理 → 加熱 → 包装Cutter → Boiler → Packer
自動車部品プレス → 穴あけ → 表面処理Press1 → Drill1 → Coater1/2

✅ 補足:Odooでの実務活用ヒント

  • 作業区ごとのリードタイム差異・負荷状況を把握して、生産ラインのボトルネック分析が可能
  • 実稼働時間と計画時間の差を基に作業効率レポートも出力可能
  • 労務費やマシンコストの算出に使用され、原価計算に直結


Comments

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です