21 lines
1.4 KiB
Markdown
21 lines
1.4 KiB
Markdown
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 <header>.
|
|
|
|
Verification Plan
|
|
Manual Verification
|
|
1. Access Odoo -> App -> Update App List and install the new "Purchase Export BC Format" module.
|
|
2. Go to the Purchase application and open an existing Purchase Order.
|
|
3. Click the new button "Export PO to BC Format" in the header.
|
|
4. Verify an Excel file is downloaded.
|
|
5. 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. |