Product Historical Margin
product_historical_margin · OCA/margin-analysis
-
Security25/25No findings
-
Activity0/25Last human commit 122 months ago
-
Required by15/251 module depends on it
-
Maturity25/25In 5 Odoo series since 6.1
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
account_invoice_line— Class 'account_invoice_line' declares `_columns` as a plain dict: old-style field/default declarations, replace with `fields.X(...)` class attributes and `default=`. migration-old-style-fields · sourcehistorical_margin— Class 'historical_margin' declares `_columns` as a plain dict: old-style field/default declarations, replace with `fields.X(...)` class attributes and `default=`. (2 occurrences in this file) migration-old-style-fields · sourceproduct_product— Class 'product_product' declares `_columns` as a plain dict: old-style field/default declarations, replace with `fields.X(...)` class attributes and `default=`. migration-old-style-fields · sourceview_invoice_line_tree_from_product— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_product_historical_margin— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · source- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.osv.orm`) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.osv.orm`) migration-openerp-import · source
- Since 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp.osv.orm`) (3 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
This module will store in the invoice line all the historical informations to allow you to compute your margin on product. We will always work in company currency and in invoice currency (to respect the OpenERP philosophy, as it is done in accounting entries for example). You now have the possibility to open a list view of your products and having the margin computed for a given period of time.
In the product form, you also will have a computed field that show you the info based on all invoice lines historic.
You can use this module in conjonction with the product_cost_incl_bom one to have the right margin computed from BOM costing.
WARNING:
- The amount of the unit price in company currency in the invoice line is converted with the currency rate of the date of the creation/modification of the invoice line (not the invoice date). This choice has been made mainly because the cost price of the product is known at the invoice creation, but we don't have it at the date of the invoice (no historical values in the cost price...) !
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 6
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_account_invoice_line_filter |
account.invoice.line.select | account.invoice.line | search | New |
view_historical_margin |
historical.margin.form | historical.margin | form | New |
view_invoice_line_form_from_product |
account.invoice.line.from.product.form | account.invoice.line | form | New |
view_invoice_line_tree_from_product |
account.invoice.line.from.product.tree | account.invoice.line | tree | New |
view_product_historical_margin |
product.product.historical_margin.tree | product.product | tree | New |
view_product_historical_margin_form |
product_historical_margin.form | product.product | form | Inherits product_standard_margin.sale_markup_product_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 4
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (1)-
read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False)The percentage of the relative margin has to be recomputed asit is nor a sum, nor a avg, but a percentage of 2 valuesof the line computed as: margin_relative = margin_absolute / subtotal_company * 100
No new fields.
Public methods (1)-
action_open_window(self, cr, uid, ids, context=None)Open the historical margin view
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…