コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
725 ビュー

I'm trying to create an export template that will allow me to get all nested components of a BoM. Hopefully I'm wrong, but it seems there is a limit to this. From what I can tell, it seems it will only drill down 3 levels.

1. BoM Lines (bom_line_ids)
2. BoM Lines/BOM lines of the referred bom (bom_line_ids/child_line_ids)
3. BoM Lines/BOM lines of the referred bom/BOM lines of the referred bom (bom_line_ids/child_line_ids/chile_line_ids)


Some BoMs in my system can go up to 4, 5, or 6 levels of nesting.

If anybody has any clue, please help me out.

アバター
破棄
最善の回答

Hi,

Please refer to the module: 

https://apps.odoo.com/apps/modules/18.0/mrp_bom_structure_xlsx

This module helps you export the entire BoM structure (all levels) into an Excel file. 


Hope it helps.

アバター
破棄
最善の回答

Create a Menu for Bill of Material Lines and export those instead.

In Developer Mode, nagivate to Settings --> Technical --> Database Structure --> Models

Find and open the Bill of Material Line (mrp.bom.line) model

Scroll to the bottom, click Create a Menu and choose the Parent Menu - maybe Manufacturing --> Products

Refresh your browser until you see the new Menu and use it to export all lines including which parent or child BoM they are attached to.

アバター
破棄
最善の回答

Hi,

You're right, it seems like 3 levels is the maximum for the export. I believe this part of the code is responsible for it:

// File: addons/web/static/src/views/view_dialogs/export_data_dialog.js
// Line: 224

isFieldExpandable(id) {

return this.knownFields[id].children && id.split("/").length < 3;

}

https://github.com/odoo/odoo/blob/67a5213238ca95ea6cdab2c40943cc593b2308e5/addons/web/static/src/views/view_dialogs/export_data_dialog.js#L224

You could try to override the limit.

Alternatively, you could do the following:

  • Export all BoMs and write a script that lists all nested components of a BoM
  • Extend the mrp.bom model with your own export function
アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 17
6191
1
7月 25
2345
3
2月 25
15784
1
4月 25
2559
Export Import 解決済
1
4月 25
2624