/** * 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'] ); } } } } } } } } Odoo MRP Unbuild Order/Failure locations – Raqqa

Odoo MRP Unbuild Order/Failure locations

Odoo MRP|Unbuild Order(分解オーダー)の仕組み

**Unbuild Order(分解オーダー)とは、完成した製品を構成部品に逆組立(分解)**し、部品を在庫に戻すための操作です。


🔧 操作手順

  1. [Operations] > [Unbuild Orders] にアクセス
  2. 「Create(作成)」をクリック
  3. 以下を入力:
    • Product(対象製品):分解する完成品を選択
    • BOM(部品表):製品に紐づくBOMが自動で補完(または選択)
    • Quantity(数量):分解する製品の数を指定
    • MO(製造オーダー):過去のMOを指定することも可能(任意)
  4. Unbuild」ボタンを押下

✅ 結果

  • 指定された製品の在庫数が減少
  • BOMに基づいて使用された部品が在庫に戻る(増加)

💡 補足

  • 使用例
    • 不良品や返品品の部品再利用
    • 製造ミスや過剰製造のリカバリ
  • 製造オーダー(MO)を紐づけておくことで、どの製造に対応する分解かを追跡可能
  • 分解後の在庫移動も記録され、トレーサビリティを確保できます

「購入した製品が不良品だった場合」のFailure Locationsの基本フローと、返品された不良品との違いを整理しました。


✅ Odooにおける不良品(Failure Locations)の処理フロー

※主に「購入品が不良だった場合」の対応

1. 在庫設定の有効化

  • 在庫 > 設定(Configuration > Settings)
    • 倉庫(Storage Locations)」を有効化(チェック)

2. Failure Location(不良品保管場所)の作成・指定

  • 不良品を保管するための内部ロケーションを作成
    例:WH/Failure, Scrap, Rejected
  • オプションで「廃棄ロケーション」としても設定可能

3. 品質管理ポイントの設定

  • 品質モジュール > 品質管理 > Control Points
    • 特定の製品や受領時に品質チェックを行う設定を追加
    • 不合格となった場合、製品の**送り先(Failure Location)**を指定

4. 購買モジュールでの受領時チェック

  • Purchase Order > 製品受領
    • 品質チェックでNGとなった商品はFailure Locationへ移動
    • OK品は通常在庫へ、NG品は不良品保管場所に分別

Comments

コメントを残す

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