TIP: You can type at any time to perform a new search.
Account Invoice Margin
account_invoice_margin · OCA/margin-analysis
Security findings
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `WITH am AS( SELECT id FROM account_move WHERE move_type NOT ILIKE 'in_%' ) UPDATE account_move_line SET margin = price_subtotal, margin_signed = price_subtotal, margin_percent = 100 FROM am WHERE am.id = account_move_line.move_id AND price_subtotal > 0.0;` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `WITH aml AS( SELECT account_move_line.move_id, SUM(account_move_line.margin) AS sum_margin, SUM(account_move_line.margin_signed) AS sum_margin_signed FROM account_move_line INNER JOIN account_move ON account_move.id = account_move_line.move_id GROUP BY account_move_line.move_id ) UPDATE account_move SET margin = aml.sum_margin, margin_signed = aml.sum_margin_signed, margin_percent = aml.sum_margin_signed / amount_untaxed * 100 FROM aml WHERE account_move.id = aml.move_id AND account_move.amount_untaxed > 0.0` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/margin-analysis · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Account
- Folder size
- 0.14 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/margin-analysis
- Last tracking update
- 2026-08-07 09:06:26
- Authors
- Odoo Community Association (OCA), GRAP, Tecnativa
- Maintainers
- Odoo Community Association (OCA), GRAP, Tecnativa
- Committers
- OCA-git-bot, oca-ci, Alexis VANNOT
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- account_invoice_margin_sale
- Description
This module allows to show sales margin in invoices. The new information is available: - on the invoice form view  - and on the invoice tree view 
Code Analysis
Views touched (2)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
invoice_margin_form_tree |
account.move | tree | Inherits account.view_move_form | |
view_account_invoice_tree |
account.move | tree | Inherits account.view_invoice_tree |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (3)
New fields (1)
-
marginFloatreadonly=Truestring='Margin Analysis'
No public methods.
New fields (3)
-
marginMonetarycompute='_compute_margin'currency_field='currency_id'store=True -
margin_percentFloatcompute='_compute_margin'digits='Product Price'store=Truestring='Margin (%)' -
margin_signedMonetarycompute='_compute_margin'currency_field='currency_id'store=True
No public methods.
New fields (4)
-
marginFloatcompute='_compute_margin'digits='Product Price'store=True -
margin_percentFloatcompute='_compute_margin'readonly=Truestore=Truestring='Margin (%)' -
margin_signedFloatcompute='_compute_margin'digits='Product Price'store=True -
purchase_priceFloatcompute='_compute_purchase_price'digits='Product Price'readonly=Falsestore=Truestring='Cost'
No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…