| models | ||
| views | ||
| __init__.py | ||
| __manifest__.py | ||
| .gitignore | ||
| README.md | ||
Purchase Export BC Module This plan covers the implementation of the "export PO to BC Format" feature for Odoo 19, added as a custom module.
purchase_export_bc (New Module) Module Structure:
- init.py and manifest.py: Describe the new module and its dependency on purchase.
- models/init.py and models/purchase_order.py: Extend the purchase.order model by adding the "action_export_bc" method. This method will filter order_line, group them by the product's category name (product_id.categ_id.name), create a new sheet per category, evaluate x_studio_bc_item_id and the units/packaging, generate the Excel document using xlsxwriter, and return an ir.actions.act_url to download it.
- views/purchase_order_views.xml: Extend purchase.view_purchase_order_form to inject a new button "action_export_bc" into the existing .
Verification Plan Manual Verification
- Access Odoo -> App -> Update App List and install the new "Purchase Export BC Format" module.
- Go to the Purchase application and open an existing Purchase Order.
- Click the new button "Export PO to BC Format" in the header.
- Verify an Excel file is downloaded.
- Open the Excel file and verify:
- There is one sheet per item category.
- The headers are: "Type", "Item No.", "Description", "Qty", "Satuan".
- The "Type" column has the static value "Item".
- "Qty" perfectly matches the ordered quantity.
- The packaging name and product categories map properly.