# POS Export BC Format This is a custom Odoo 19 module that allows users to export Point of Sale (POS) orders and sales data into a structured Excel format named "MIE MAPAN INVOICES". ## Features - **Custom Excel Generation:** Generates a visually matching Excel file with specific columns and aggregated row formatting. - **Order-Level Row Grouping:** In the Excel file, aggregate data such as *Total*, *Tax*, *Paid*, *Return*, and *Subtotal* are populated only on the first row of each order to visually indicate grouping. - **Multiple Sheets:** Generates two sheets dynamically: - **Invoice**: For orders with a positive total amount. - **Refund**: For orders with a negative total amount. - **Custom SKU Integration:** Specifically fetches the custom field `x_studio_popcorn_sku` created via Odoo Studio as the primary product SKU identifier. - **Date Formatting Consistency:** Exports datetime fields like "Date" and "Paid At" directly as raw strings (e.g. `11-03-2026 15:30:00`) to prevent spreadsheet applications from aggressively auto-formatting dates unexpectedly. ## Requirements This module requires the Python `xlsxwriter` package to format and generate memory-based Excel files. ```sh pip install xlsxwriter ``` ## Usage 1. Make sure you have installed the module from the Odoo Apps menu. 2. Navigate to **Point of Sale** -> **Reporting** -> **Export BC Format**. 3. A wizard will pop up asking for the **Start Date** and **End Date**. 4. Select the desired period and click **Export**. 5. Your browser will download the generated `.xlsx` file. ## Technical Details This module creates a TransientModel `pos.export.bc.wizard`. Upon clicking export, `action_export_bc()` queries `pos.order` based on the dates provided and reconstructs the data into an `io.BytesIO` buffer, which is temporarily saved as an `ir.attachment` and served back to the user via a `/web/content/...` download URL act window.