| models | ||
| views | ||
| __init__.py | ||
| __manifest__.py | ||
| .gitignore | ||
| README.md | ||
Purchase Export BC Format
Purchase Export BC Format is a custom Odoo 19 module that provides functionality to export a Purchase Order's details into an Excel (.xlsx) format.
Features
- One-Click Export: Adds an "Export PO to BC Format" button directly inside the header of the Purchase Order form view (visible in the
purchaseordonestates). - Automated Categorization: Groups the purchase order lines by their Product Category. For each category, a dedicated worksheet is created in the generated Excel file.
- Custom Data Mapping: Fetches specific product data, such as a custom field
x_studio_bc_item_idfor custom Item Numbers. - Unit of Measure Handling: Intelligently determines the "Satuan" (Unit), favoring the Product Packaging if defined, and otherwise falling back to the standard Unit of Measure (
product_uom_id).
Excel File Structure
For each generated worksheet (named after the product category), the layout is strictly mapped according to the requested BC format:
| Column Header | Data Source / Description |
|---|---|
| Type | Static value Item. |
| Item No. | The value from the product's custom field x_studio_bc_item_id. |
| Description | The Product's name. |
| Qty | The ordered quantity. |
| Satuan | The Packaging used (if any). If none, it uses the product's Unit of Measure name. |
Installation
- Place the
purchase_export_bcmodule directory into your Odoo 19customaddons path. - Restart the Odoo server.
- Turn on Developer Mode in Odoo.
- Go to Apps -> Update Apps List.
- Search for
Purchase Export BC Formatand click Activate. - Requirement: Ensure that the Python library
xlsxwriteris installed in your Odoo environment:pip install xlsxwriter
Usage
- Navigate to the Purchase app in Odoo.
- Open any existing Purchase Order that is confirmed.
- Click the Export PO to BC Format button located in the header.
- The system will automatically generate and prompt you to download the Excel file named
PO_Export_BC_[Order_Name].xlsx.
Author
- Aziz