| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Purchase (purchase) |
| Community Apps Dependencies | Show |
| Lines of code | 1787 |
| Technical Name |
mah_statement_widget_many2one |
| License | OPL-1 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Purchase (purchase) |
| Community Apps Dependencies | Show |
| Lines of code | 1787 |
| Technical Name |
mah_statement_widget_many2one |
| License | OPL-1 |
Many2one Statement Widget — User Manual
This addon provides enhanced Many2one field widgets that add a small Statement button next to Partner and Account fields so you can open the statement popup directly from any form or list.
Usage (add the widget attribute to your field):
<field name="partner_id" widget="partner_statement_widget"/> <field name="account_id" widget="account_statement_widget"/>
Notes:
- The widgets inherit the standard Many2one behavior (search / create / edit) and only add the statement button.
- The button is disabled when no partner/account is selected.
- Styling: Partner button uses a blue outline; Account button uses a green outline.
Popup controls and usage
When the popup opens you will see the statement lines in a table and a control bar with:
- Date range — From / To date pickers to limit lines.
- Posted — a dropdown with Posted, Not Posted, Both. Default is Posted.
- Refresh — reload the statement with current filters.
- Export to Excel — downloads the visible statement as XLSX.
- Export to PDF — downloads the visible statement as PDF.
After parameters change the Refresh button change color to indicate a new state.
Export — general overview
Both Excel and PDF exports in this module can be produced using either server-side or client-side methods. A toggle switch in the popup lets you select which method to use. The export buttons for Excel and PDF remain the same; the toggle determines whether the export is performed by the server (Python) or the client (JavaScript).
- Server-side (Python) — the Odoo backend generates the file using Python libraries . This is recommended for large reports, consistent rendering, and when the export must obey server-side access controls.
- Client-side (JavaScript) — the browser builds the file using JS libraries . This can be quicker for small datasets and avoids server CPU, but may be limited by browser memory and formatting capabilities.
Use the toggle switch to select your preferred export method. This keeps the export workflow simple and consistent, while allowing you to balance performance, compatibility, and security according to your needs.
Export to Excel
The export includes these user-friendly features:
- Autosized columns (heuristic) with a max-width cap.
- Dates written as true Excel date cells when recognized.
- Alternating (zebra) row background for readability.
- Header row is frozen so it stays visible while scrolling.
- Filename describes partner/account ids, date range and filter mode.
Example filename:
account_statement_partner-12_account-34_2025-01-01_to_2025-01-31_posted.xlsx
Export to PDF
You can also export the visible statement to PDF. The PDF export is intended for printing and sharing and preserves the table layout (headers, zebra rows and totals).
Example PDF filename (server export):
account_statement_partner-12_account-34_2025-01-01_to_2025-01-31_posted.pdf
Help & support
If you need changes (e.g., include partner names in lines, filter modifications,...), contact mhajjar1978@hotmail.com or open a ticket in your internal tracker.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module