Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
529e560
[MRG] From last customers devs, tests and bugfix. Most improvements a…
jgrandguillaume Jul 12, 2012
741b009
To ease merging the work with Alex, I already commit part of work:
jgrandguillaume Jun 29, 2012
08ed05c
[IMP] Rebuild the margin modules. This is the first working version t…
jgrandguillaume Jul 11, 2012
8d30020
[ADD] product_historical_margin_report that override the invoice line…
jgrandguillaume Jul 12, 2012
6002698
[IMP] product_cost_incl_bom, product_get_cost_field, sale_markup: ext…
May 15, 2012
b9f9d10
[MRG] From trunk branch, tests and bugfix. Most improvements are on:
jgrandguillaume Jul 12, 2012
931762a
[ADD] translation FR on product_standard_margin and product_historica…
Dec 13, 2012
be5bfab
[FIX] typos
Dec 13, 2012
a0ef068
Added Dutch translations to all modules.
Dec 23, 2012
a54371f
small fix in translation
Dec 23, 2012
135419a
[MIGR] Mark all module as installable = False unless we migrate them.…
jgrandguillaume Sep 11, 2013
1752759
[MIG] portage of product_standard_margin
yvaucher Oct 10, 2013
78030a5
[FIX] imports
yvaucher Oct 14, 2013
65e7aa2
[PEP8]
yvaucher Oct 14, 2013
e8ff611
[IMP] use date in __openerp__.py instead of deprecated update_xml and…
yvaucher Oct 14, 2013
c5ec87e
[FIX] remove group to show margin fields
yvaucher Oct 14, 2013
188beac
[ADD] pot file
yvaucher Oct 14, 2013
ec3e9c1
[IMP] update fr.po
yvaucher Oct 14, 2013
3c5b7c3
[IMP] Better logger implementation
jgrandguillaume Nov 27, 2013
1d21ec8
[FIX] Context propagation
jgrandguillaume Nov 27, 2013
cbb705d
[IMP] Use read whenever it's possible for performance reasons
jgrandguillaume Dec 10, 2013
5ae6ca8
[PEP8] product_standard_margin
yvaucher Dec 11, 2013
bebd58f
all modules are unported on 8.0 branch
gurneyalex Aug 13, 2014
0b4ff2e
[PORT][WIP] move 'product_standard_margin' from unported to regular f…
legalsylvain Jul 24, 2015
35d4c1e
[PORT][WIP] port somes commit from V7 branches, specially 18bf9614b1c…
legalsylvain Jul 24, 2015
4d3bc38
[PORT][REF] OCA convention;
legalsylvain Jul 24, 2015
5965cb7
[REF] V8 api;
legalsylvain Jul 24, 2015
5a12d23
[FIX] flake8 + Pylint;
legalsylvain Aug 17, 2015
3e30764
[REF] use new API;
legalsylvain Aug 17, 2015
4a605b9
[REF] add AGPL logo;
legalsylvain Aug 17, 2015
526eab3
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
79306aa
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
7eaf234
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
2116332
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
8050195
[REF] product_standard_margin: Black python code
legalsylvain Jan 7, 2020
ab81ff8
[MIG] product_standard_margin: Migration to 12.0
legalsylvain Jan 7, 2020
d5267d6
[UPD] Update product_standard_margin.pot
oca-travis Jul 19, 2020
28415e7
[UPD] README.rst
OCA-git-bot Jul 19, 2020
438b645
[ADD] icon.png
OCA-git-bot Jul 19, 2020
ea98626
Added translation using Weblate (German)
AndreVolksdorf Nov 20, 2020
67fe5f6
Translated using Weblate (German)
AndreVolksdorf Nov 20, 2020
314924f
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Mar 14, 2021
81b1fd5
Added translation using Weblate (Portuguese)
alvarorib Apr 12, 2021
8a23d84
[IMP] product_standard_margin: black, isort, prettier
cvinh Dec 15, 2021
53276b7
[MIG] product_standard_margin: Migration to 14.0
cvinh Dec 15, 2021
e0200f0
[IMP] Add margin fields in product tree views
cvinh Dec 15, 2021
bd0b2ef
[IMP] Add percentpie widget for rate field
cvinh Dec 16, 2021
0c2c5bd
[IMP] Add Markup Rate
cvinh Dec 23, 2021
995e024
[UPD] Update product_standard_margin.pot
Feb 16, 2023
b3345e4
[UPD] README.rst
OCA-git-bot Feb 16, 2023
5a24f79
Update translation files
weblate Feb 16, 2023
b8d9414
[MIG] product_standard_margin: Migration to 15.0
leemannd Feb 17, 2023
22bcf16
[UPD] Update product_standard_margin.pot
Feb 20, 2023
342b5c0
[UPD] README.rst
OCA-git-bot Feb 20, 2023
c72cf21
Update translation files
weblate Feb 20, 2023
d1b6b30
[MIG] product_standard_margin: Migration to 16.0
amarcosg Jun 5, 2023
2ee7d9d
[UPD] Update product_standard_margin.pot
Jun 21, 2023
ffdf5d7
[UPD] README.rst
OCA-git-bot Jun 21, 2023
5a3c499
[FIX] product_standard_margin
Jul 24, 2023
bc51c2d
product_standard_margin 16.0.1.0.1
OCA-git-bot Jul 24, 2023
ec99156
[UPD] README.rst
OCA-git-bot Sep 3, 2023
fb505b4
Update translation files
weblate Oct 9, 2023
465236e
[FIX] use lst_price for _compute_margin in product.product, update tests
anhvu-sg Jan 5, 2024
c011d55
Translated using Weblate (French)
kbentaleb Jan 8, 2024
6ff4773
Added translation using Weblate (Italian)
mymage Feb 1, 2024
880e4c5
Translated using Weblate (Italian)
mymage Feb 1, 2024
c3a966a
[BOT] post-merge updates
OCA-git-bot Apr 6, 2024
ef85ed0
Translated using Weblate (Portuguese (Brazil))
May 21, 2024
fbcecf8
[IMP] product_standard_margin : Remove 'theoretical' in the name of f…
legalsylvain Jun 12, 2024
dcad189
[UPD] Update product_standard_margin.pot
Oct 20, 2024
7267d70
[BOT] post-merge updates
OCA-git-bot Oct 20, 2024
ff43725
Update translation files
weblate Oct 20, 2024
a58cd03
Translated using Weblate (Italian)
mymage Oct 21, 2024
15bd32d
Translated using Weblate (Portuguese (Brazil))
SottomaiorMacedoTec Nov 13, 2024
9315406
Added translation using Weblate (Croatian)
uvid-gordana Feb 24, 2025
5e221fe
Translated using Weblate (Croatian)
uvid-gordana Feb 24, 2025
6c2552b
Translated using Weblate (French)
remi-filament Apr 15, 2025
3366a19
Translated using Weblate (French)
legalsylvain Dec 9, 2025
531da82
[IMP] product_standard_margin: pre-commit auto fixes
ChristianTessera Feb 11, 2026
56e8356
[MIG] product_standard_margin: Migration to 17.0
ChristianTessera Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions product_standard_margin/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
==============================
Product Margin and Margin Rate
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fabfa924e777dbded2cd92955a1fa804c4ad0f5afa6157ea2f3a7facde8c37e4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmargin--analysis-lightgray.png?logo=github
:target: https://github.com/OCA/margin-analysis/tree/17.0/product_standard_margin
:alt: OCA/margin-analysis
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/margin-analysis-17-0/margin-analysis-17-0-product_standard_margin
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/margin-analysis&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Add 2 fields on the product form that compute the standard (or
theorical) margin and markup based on the current values of sale and
standard price present in the product form. We take care of taxe
included or excluded.

It will just compute it as follow: Margin : (Sale Price without tax -
Standard Price) / Sale Price without tax Markup : (Sale Price without
tax - Standard Price) / Standard Price

|image1|

**Note:**

As this module will base his simple computation on sale and cost prices,
it suppose you have them both in the same currency (the price type must
of the same currency for both of them). Remember this is the default
OpenERP configuration (price type of all product price fields are set as
the same as the company currency). We don't take care of it cause
otherwise we should have added a dependency on sale module.

.. |image1| image:: https://raw.githubusercontent.com/OCA/margin-analysis/17.0/product_standard_margin/static/description/product_form.png

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

- This module will not work properly if used in a multicompany context
with product prices depending on the company.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/margin-analysis/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/margin-analysis/issues/new?body=module:%20product_standard_margin%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Camptocamp
* GRAP

Contributors
------------

- Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
- Yannick Vaucher <yannick.vaucher@camptocamp.com>
- Joël Grand-Guillaume <joel.grand-guillaume@camptocamp.com>
- Sylvain Le Gal (https://twitter.com/legalsylvain)
- Cyril Vinh-Tung <cyril@invitu.com>
- Christian Doñate <https://tesseratech.es>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px
:target: https://github.com/legalsylvain
:alt: legalsylvain

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-legalsylvain|

This module is part of the `OCA/margin-analysis <https://github.com/OCA/margin-analysis/tree/17.0/product_standard_margin>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_standard_margin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions product_standard_margin/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2012 - Today: Camptocamp SA
# @author: Joel Grand-Guillaume
# Copyright (C) 2019 - Today: GRAP (http://www.grap.coop)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Product Margin and Margin Rate",
"version": "17.0.1.0.0",
"author": "Camptocamp,GRAP,Odoo Community Association (OCA)",
"category": "Product",
"depends": ["account"],
"maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/margin-analysis",
"data": ["views/view_product_product.xml", "views/view_product_template.xml"],
"license": "AGPL-3",
"installable": True,
"images": ["static/description/product_form.png"],
}
117 changes: 117 additions & 0 deletions product_standard_margin/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_standard_margin
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-11-20 18:43+0000\n"
"Last-Translator: André Volksdorf <volksdorf@smartpage.de>\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 3.10\n"

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_margin
msgid "Margin"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_margin_rate
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_margin_rate
msgid "Margin (%)"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_margin
msgid ""
"Margin is [ sale price (Wo Tax) - cost price ] of the product form (not "
"based on historical values). Take care of tax include and exclude. If no "
"sale price, the margin will be negativ."
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_margin_rate
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_margin_rate
msgid ""
"Margin rate is [ Margin / sale price (Wo Tax) ] of the product form (not "
"based on historical values).Take care of tax include and exclude.. If no "
"sale price set, will display 999.0"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_markup_rate
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_markup_rate
msgid "Markup (%)"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_markup_rate
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_markup_rate
msgid ""
"Markup rate is [ Margin / cost price (Wo Tax) ] of the product form (not "
"based on historical values).Take care of tax include and exclude.. If no "
"cost price set, will display 999.0"
msgstr ""

#. module: product_standard_margin
#: model:ir.model,name:product_standard_margin.model_product_template
msgid "Product"
msgstr "Produkt"

#. module: product_standard_margin
#: model:ir.model,name:product_standard_margin.model_product_product
msgid "Product Variant"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__list_price_vat_excl
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__list_price_vat_excl
msgid "Sale Price VAT Excluded"
msgstr "Verkaufspreis ohne Mehrwertsteuer"

#~ msgid ""
#~ "Margin rate is [ Theorical Margin / sale price (Wo Tax) ] of the product "
#~ "form (not based on historical values).Take care of tax include and "
#~ "exclude.. If no sale price set, will display 999.0"
#~ msgstr ""
#~ "Der Margensatz ist [ Theoretische Marge / Verkaufspreis (Ohne Steuern) ] "
#~ "des Produkts (nicht auf historischen Werten basierend), wobei darauf zu "
#~ "achten ist, Steuern ein- und auszuschließen. Wenn kein Verkaufspreis "
#~ "festgelegt wurde, wird 999.0 angezeigt"

#~ msgid "Theorical Margin"
#~ msgstr "Theoretische Marge"

#~ msgid "Theorical Margin (%)"
#~ msgstr "Theoretische Marge (%)"

#~ msgid ""
#~ "Theorical Margin is [ sale price (Wo Tax) - cost price ] of the product "
#~ "form (not based on historical values). Take care of tax include and "
#~ "exclude. If no sale price, the margin will be negativ."
#~ msgstr ""
#~ "Theoretische Gewinnmarge ist [ Verkaufspreis (Ohne Steuern) - "
#~ "Einkaufspreis ] des Produkts (nicht auf historischen Werten basierend). "
#~ "Achten Sie darauf, Steuern ein- und auszuschließen. Wenn kein "
#~ "Verkaufspreis angegeben wird, ist die Marge negativ."

#~ msgid ""
#~ "Markup rate is [ Theorical Margin / sale price (Wo Tax) ] of the product "
#~ "form (not based on historical values).Take care of tax include and "
#~ "exclude.. If no sale price set, will display 999.0"
#~ msgstr ""
#~ "Der Aufschlagssatz ist [ Theoretische Marge / Verkaufspreis (Ohne "
#~ "Steuern) ] des Produkts (nicht auf historischen Werten basierend), mit "
#~ "und ohne Steuer. Wenn kein Verkaufspreis festgelegt wurde, wird 999.0 "
#~ "angezeigt"

#~ msgid "Product Template"
#~ msgstr "Produktvorlage"
118 changes: 118 additions & 0 deletions product_standard_margin/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_standard_margin
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-05 09:26+0000\n"
"PO-Revision-Date: 2023-06-05 11:27+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 2.0.6\n"

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_margin
msgid "Margin"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_margin_rate
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_margin_rate
msgid "Margin (%)"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_margin
msgid ""
"Margin is [ sale price (Wo Tax) - cost price ] of the product form (not "
"based on historical values). Take care of tax include and exclude. If no "
"sale price, the margin will be negativ."
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_margin_rate
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_margin_rate
msgid ""
"Margin rate is [ Margin / sale price (Wo Tax) ] of the product form (not "
"based on historical values).Take care of tax include and exclude.. If no "
"sale price set, will display 999.0"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__standard_markup_rate
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__standard_markup_rate
msgid "Markup (%)"
msgstr ""

#. module: product_standard_margin
#: model:ir.model.fields,help:product_standard_margin.field_product_product__standard_markup_rate
#: model:ir.model.fields,help:product_standard_margin.field_product_template__standard_markup_rate
msgid ""
"Markup rate is [ Margin / cost price (Wo Tax) ] of the product form (not "
"based on historical values).Take care of tax include and exclude.. If no "
"cost price set, will display 999.0"
msgstr ""

#. module: product_standard_margin
#: model:ir.model,name:product_standard_margin.model_product_template
msgid "Product"
msgstr "Producto"

#. module: product_standard_margin
#: model:ir.model,name:product_standard_margin.model_product_product
msgid "Product Variant"
msgstr "Variante de producto"

#. module: product_standard_margin
#: model:ir.model.fields,field_description:product_standard_margin.field_product_product__list_price_vat_excl
#: model:ir.model.fields,field_description:product_standard_margin.field_product_template__list_price_vat_excl
msgid "Sale Price VAT Excluded"
msgstr "Precio de venta sin impuestos"

#~ msgid ""
#~ "Margin rate is [ Theorical Margin / sale price (Wo Tax) ] of the product "
#~ "form (not based on historical values).Take care of tax include and "
#~ "exclude.. If no sale price set, will display 999.0"
#~ msgstr ""
#~ "La tasa de margen es [ Margen teórico / precio de venta (sin impuestos) ] "
#~ "de la ficha del producto (no basado en valores históricos). Tenga cuidado "
#~ "de impuestos incluidos y excluidos. Si no hay precio de venta establecido "
#~ "mostrará 999.0"

#~ msgid ""
#~ "Markup rate is [ Theorical Margin / cost price (Wo Tax) ] of the product "
#~ "form (not based on historical values).Take care of tax include and "
#~ "exclude.. If no cost price set, will display 999.0"
#~ msgstr ""
#~ "La tasa de Markup es [ Margen teórico / precio de coste (sin impuestos) ] "
#~ "de la ficha del producto (no basado en valores históricos). Tenga cuidado "
#~ "de impuestos incluidos y excluidos. Si no hay precio de coste establecido "
#~ "mostrará 999.0"

#~ msgid "Theorical Margin"
#~ msgstr "Margen teórico"

#~ msgid "Theorical Margin (%)"
#~ msgstr "Margen teórico (%)"

#~ msgid ""
#~ "Theorical Margin is [ sale price (Wo Tax) - cost price ] of the product "
#~ "form (not based on historical values). Take care of tax include and "
#~ "exclude. If no sale price, the margin will be negativ."
#~ msgstr ""
#~ "El margen teórico es [ precio de venta (sin impuestos) - precio de "
#~ "coste ] de la ficha del producto (no basado en valores históricos). Tenga "
#~ "cuidado de impuestos incluidos y excluidos. Si no hay precio de venta el "
#~ "margen será negativo."

#~ msgid "Theorical Markup (%)"
#~ msgstr "Markup teórico (%)"
Loading