Invoice Margin
invoice_margin · OCA/account-invoicing
Health
35/100
poor
-
Security25/25No findings
-
Activity0/25Last human commit 107 months ago
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 8.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.15 MB
Module directory on disk
Code analysis
6 migration notes
2 models
2 views
0 HTTP endpoints
Migration considerations
- Migrating to 19.0: only `__manifest__.py` is recognized: a module with `__openerp__.py` is not detected at all. migration-openerp-manifest · source
AccountInvoice— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (1 methods) migration-api-multi-one · sourceAccountInvoiceLine— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (2 methods) migration-api-multi-one · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE account_invoice_line SET purchase_price = line_standard_price.standard_price FROM ( SELECT ail.id line_id, (SELECT cost FROM product_price_history pph WHERE( ai.date_invoice is null OR date_trunc('day', pph.datetime) <= ai.date_invoice) AND pph.product_template_id = pp.product_tmpl_id AND pph.company_id = ail.company_id ORDER BY datetime desc LIMIT 1) standard_price FROM account_invoice_line ail INNER JOIN account_invoice ai ON ai.id = ail.invoice_id INNER JOIN product_product pp ON pp.id = ail.product_id ) line_standard_price WHERE account_invoice_line.id = line_standard_price.line_id;` - re-check the table/column names still match after upgrading. (3 occurrences in this file) migration-raw-sql-write · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_account_invoice_form |
account.invoice | form | Inherits account.invoice_form | |
view_account_invoice_tree |
account.invoice | tree | Inherits account.invoice_tree |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
New fields (2)
-
marginFloatcompute='_compute_margin'digits_compute=dp.get_precision('Product Price')help='It gives profitability by calculating the difference between the Unit Price and the cost price.'multi='margin'store=True args: 'Margin' -
margin_percentFloatcompute='_compute_margin'digits_compute=dp.get_precision('PoS Order Margin Percent')multi='margin'store=True args: 'Margin (%)'
No public methods.
New fields (3)
-
marginFloatcompute='_compute_multi_margin'digits_compute=dp.get_precision('Product Price')multi='multi_margin'store=True args: 'Margin' -
margin_percentFloatcompute='_compute_multi_margin'digits_compute=dp.get_precision('Product Price')multi='multi_margin'store=True args: 'Margin (%)' -
purchase_priceFloatcopy=Falsedigits_compute=dp.get_precision('Product Price')string='Cost Price'
-
create(self, vals)@api.model -
product_id_change(self, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, company_id=None)@api.multi