odoo-addon-product-pricelist-margin 16.0.1.0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odoo/addons/product_pricelist_margin/README.rst +86 -0
- odoo/addons/product_pricelist_margin/__init__.py +1 -0
- odoo/addons/product_pricelist_margin/__manifest__.py +16 -0
- odoo/addons/product_pricelist_margin/i18n/fr.pot +45 -0
- odoo/addons/product_pricelist_margin/i18n/product_pricelist_margin.pot +43 -0
- odoo/addons/product_pricelist_margin/i18n/product_pricelist_margins.pot +45 -0
- odoo/addons/product_pricelist_margin/models/__init__.py +1 -0
- odoo/addons/product_pricelist_margin/models/product_pricelist_item.py +75 -0
- odoo/addons/product_pricelist_margin/readme/CONTRIBUTORS.rst +1 -0
- odoo/addons/product_pricelist_margin/readme/DESCRIPTION.rst +1 -0
- odoo/addons/product_pricelist_margin/readme/USAGE.rst +6 -0
- odoo/addons/product_pricelist_margin/static/description/icon.png +0 -0
- odoo/addons/product_pricelist_margin/static/description/index.html +434 -0
- odoo/addons/product_pricelist_margin/static/description/pricelist_item.png +0 -0
- odoo/addons/product_pricelist_margin/tests/__init__.py +1 -0
- odoo/addons/product_pricelist_margin/tests/test_margin.py +43 -0
- odoo/addons/product_pricelist_margin/views/product_pricelist_item_views.xml +49 -0
- odoo/addons/product_pricelist_margin/views/product_pricelist_views.xml +43 -0
- odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/METADATA +101 -0
- odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/RECORD +22 -0
- odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/WHEEL +5 -0
- odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
========================
|
|
2
|
+
Product Pricelist Margin
|
|
3
|
+
========================
|
|
4
|
+
|
|
5
|
+
..
|
|
6
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
7
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
8
|
+
!! changes will be overwritten. !!
|
|
9
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
+
!! source digest: sha256:f7a304e2acd01b42ff2f6e9de3dfa6a6ee4519e2beeddba42b49fad5e8d7d0b6
|
|
11
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
|
+
|
|
13
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
14
|
+
:target: https://odoo-community.org/page/development-status
|
|
15
|
+
:alt: Beta
|
|
16
|
+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
|
17
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
18
|
+
:alt: License: AGPL-3
|
|
19
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
|
|
20
|
+
:target: https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin
|
|
21
|
+
:alt: OCA/product-attribute
|
|
22
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
23
|
+
:target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_pricelist_margin
|
|
24
|
+
:alt: Translate me on Weblate
|
|
25
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
26
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=16.0
|
|
27
|
+
:alt: Try me on Runboat
|
|
28
|
+
|
|
29
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
30
|
+
|
|
31
|
+
This module shows the product's cost and margin from the pricelists.
|
|
32
|
+
|
|
33
|
+
**Table of contents**
|
|
34
|
+
|
|
35
|
+
.. contents::
|
|
36
|
+
:local:
|
|
37
|
+
|
|
38
|
+
Usage
|
|
39
|
+
=====
|
|
40
|
+
|
|
41
|
+
* Go to "Sale > Products > Pricelists"
|
|
42
|
+
|
|
43
|
+
* Open a pricelist form
|
|
44
|
+
|
|
45
|
+
* There are 3 new columns on the "Price rules" list.
|
|
46
|
+
.. image:: https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_pricelist_margin/static/description/pricelist_item.png
|
|
47
|
+
|
|
48
|
+
Bug Tracker
|
|
49
|
+
===========
|
|
50
|
+
|
|
51
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
|
|
52
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
53
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
54
|
+
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_margin%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
55
|
+
|
|
56
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
57
|
+
|
|
58
|
+
Credits
|
|
59
|
+
=======
|
|
60
|
+
|
|
61
|
+
Authors
|
|
62
|
+
~~~~~~~
|
|
63
|
+
|
|
64
|
+
* Camptocamp
|
|
65
|
+
|
|
66
|
+
Contributors
|
|
67
|
+
~~~~~~~~~~~~
|
|
68
|
+
|
|
69
|
+
* Nguyen Minh Chien <chien@trobz.com>
|
|
70
|
+
|
|
71
|
+
Maintainers
|
|
72
|
+
~~~~~~~~~~~
|
|
73
|
+
|
|
74
|
+
This module is maintained by the OCA.
|
|
75
|
+
|
|
76
|
+
.. image:: https://odoo-community.org/logo.png
|
|
77
|
+
:alt: Odoo Community Association
|
|
78
|
+
:target: https://odoo-community.org
|
|
79
|
+
|
|
80
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
81
|
+
mission is to support the collaborative development of Odoo features and
|
|
82
|
+
promote its widespread use.
|
|
83
|
+
|
|
84
|
+
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin>`_ project on GitHub.
|
|
85
|
+
|
|
86
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import models
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copyright 2024 Camptocamp SA
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
|
+
{
|
|
4
|
+
"name": "Product Pricelist Margin",
|
|
5
|
+
"summary": "This module shows the product's cost and margin from the pricelists.",
|
|
6
|
+
"version": "16.0.1.0.0",
|
|
7
|
+
"category": "Product",
|
|
8
|
+
"website": "https://github.com/OCA/product-attribute",
|
|
9
|
+
"author": "Camptocamp, Odoo Community Association (OCA)",
|
|
10
|
+
"license": "AGPL-3",
|
|
11
|
+
"depends": ["account"],
|
|
12
|
+
"data": [
|
|
13
|
+
"views/product_pricelist_views.xml",
|
|
14
|
+
"views/product_pricelist_item_views.xml",
|
|
15
|
+
],
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * product_pricelist_margin
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 16.0+e\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"POT-Creation-Date: 2024-03-20 08:44+0000\n"
|
|
10
|
+
"PO-Revision-Date: 2024-03-20 08:44+0000\n"
|
|
11
|
+
"Last-Translator: \n"
|
|
12
|
+
"Language-Team: \n"
|
|
13
|
+
"MIME-Version: 1.0\n"
|
|
14
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
|
+
"Content-Transfer-Encoding: \n"
|
|
16
|
+
"Plural-Forms: \n"
|
|
17
|
+
|
|
18
|
+
#. module: product_pricelist_margin
|
|
19
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__cost
|
|
20
|
+
msgid "Cost"
|
|
21
|
+
msgstr "Coût"
|
|
22
|
+
|
|
23
|
+
#. module: product_pricelist_margin
|
|
24
|
+
#: model:ir.model.fields,help:product_pricelist_margin.field_product_pricelist_item__cost
|
|
25
|
+
msgid ""
|
|
26
|
+
"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n"
|
|
27
|
+
" In FIFO: value of the next unit that will leave the stock (automatically computed).\n"
|
|
28
|
+
" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n"
|
|
29
|
+
" Used to compute margins on sale orders."
|
|
30
|
+
msgstr ""
|
|
31
|
+
|
|
32
|
+
#. module: product_pricelist_margin
|
|
33
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin
|
|
34
|
+
msgid "Margin"
|
|
35
|
+
msgstr "Marge"
|
|
36
|
+
|
|
37
|
+
#. module: product_pricelist_margin
|
|
38
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin_percent
|
|
39
|
+
msgid "Margin (%)"
|
|
40
|
+
msgstr "Marge (%)"
|
|
41
|
+
|
|
42
|
+
#. module: product_pricelist_margin
|
|
43
|
+
#: model:ir.model,name:product_pricelist_margin.model_product_pricelist_item
|
|
44
|
+
msgid "Pricelist Rule"
|
|
45
|
+
msgstr "Règle des listes des prix"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * product_pricelist_margin
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 16.0\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"Last-Translator: \n"
|
|
10
|
+
"Language-Team: \n"
|
|
11
|
+
"MIME-Version: 1.0\n"
|
|
12
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
13
|
+
"Content-Transfer-Encoding: \n"
|
|
14
|
+
"Plural-Forms: \n"
|
|
15
|
+
|
|
16
|
+
#. module: product_pricelist_margin
|
|
17
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__cost
|
|
18
|
+
msgid "Cost"
|
|
19
|
+
msgstr ""
|
|
20
|
+
|
|
21
|
+
#. module: product_pricelist_margin
|
|
22
|
+
#: model:ir.model.fields,help:product_pricelist_margin.field_product_pricelist_item__cost
|
|
23
|
+
msgid ""
|
|
24
|
+
"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n"
|
|
25
|
+
" In FIFO: value of the next unit that will leave the stock (automatically computed).\n"
|
|
26
|
+
" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n"
|
|
27
|
+
" Used to compute margins on sale orders."
|
|
28
|
+
msgstr ""
|
|
29
|
+
|
|
30
|
+
#. module: product_pricelist_margin
|
|
31
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin
|
|
32
|
+
msgid "Margin"
|
|
33
|
+
msgstr ""
|
|
34
|
+
|
|
35
|
+
#. module: product_pricelist_margin
|
|
36
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin_percent
|
|
37
|
+
msgid "Margin (%)"
|
|
38
|
+
msgstr ""
|
|
39
|
+
|
|
40
|
+
#. module: product_pricelist_margin
|
|
41
|
+
#: model:ir.model,name:product_pricelist_margin.model_product_pricelist_item
|
|
42
|
+
msgid "Pricelist Rule"
|
|
43
|
+
msgstr ""
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Translation of Odoo Server.
|
|
2
|
+
# This file contains the translation of the following modules:
|
|
3
|
+
# * product_pricelist_margin
|
|
4
|
+
#
|
|
5
|
+
msgid ""
|
|
6
|
+
msgstr ""
|
|
7
|
+
"Project-Id-Version: Odoo Server 16.0+e\n"
|
|
8
|
+
"Report-Msgid-Bugs-To: \n"
|
|
9
|
+
"POT-Creation-Date: 2024-03-20 08:44+0000\n"
|
|
10
|
+
"PO-Revision-Date: 2024-03-20 08:44+0000\n"
|
|
11
|
+
"Last-Translator: \n"
|
|
12
|
+
"Language-Team: \n"
|
|
13
|
+
"MIME-Version: 1.0\n"
|
|
14
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
|
+
"Content-Transfer-Encoding: \n"
|
|
16
|
+
"Plural-Forms: \n"
|
|
17
|
+
|
|
18
|
+
#. module: product_pricelist_margin
|
|
19
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__cost
|
|
20
|
+
msgid "Cost"
|
|
21
|
+
msgstr ""
|
|
22
|
+
|
|
23
|
+
#. module: product_pricelist_margin
|
|
24
|
+
#: model:ir.model.fields,help:product_pricelist_margin.field_product_pricelist_item__cost
|
|
25
|
+
msgid ""
|
|
26
|
+
"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n"
|
|
27
|
+
" In FIFO: value of the next unit that will leave the stock (automatically computed).\n"
|
|
28
|
+
" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n"
|
|
29
|
+
" Used to compute margins on sale orders."
|
|
30
|
+
msgstr ""
|
|
31
|
+
|
|
32
|
+
#. module: product_pricelist_margin
|
|
33
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin
|
|
34
|
+
msgid "Margin"
|
|
35
|
+
msgstr ""
|
|
36
|
+
|
|
37
|
+
#. module: product_pricelist_margin
|
|
38
|
+
#: model:ir.model.fields,field_description:product_pricelist_margin.field_product_pricelist_item__margin_percent
|
|
39
|
+
msgid "Margin (%)"
|
|
40
|
+
msgstr ""
|
|
41
|
+
|
|
42
|
+
#. module: product_pricelist_margin
|
|
43
|
+
#: model:ir.model,name:product_pricelist_margin.model_product_pricelist_item
|
|
44
|
+
msgid "Pricelist Rule"
|
|
45
|
+
msgstr ""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import product_pricelist_item
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Copyright 2024 Camptocamp SA
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
|
|
4
|
+
from odoo import api, fields, models
|
|
5
|
+
from odoo.tools.float_utils import float_is_zero
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ProductPricelistItem(models.Model):
|
|
9
|
+
_inherit = "product.pricelist.item"
|
|
10
|
+
|
|
11
|
+
cost = fields.Float(
|
|
12
|
+
related="product_tmpl_id.standard_price",
|
|
13
|
+
digits="Product Price",
|
|
14
|
+
)
|
|
15
|
+
margin = fields.Float(
|
|
16
|
+
compute="_compute_margin",
|
|
17
|
+
digits="Product Price",
|
|
18
|
+
)
|
|
19
|
+
margin_percent = fields.Float(
|
|
20
|
+
string="Margin (%)",
|
|
21
|
+
compute="_compute_margin",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
@api.depends(
|
|
25
|
+
"compute_price",
|
|
26
|
+
"applied_on",
|
|
27
|
+
"percent_price",
|
|
28
|
+
"base",
|
|
29
|
+
"price_discount",
|
|
30
|
+
"price_surcharge",
|
|
31
|
+
"price_round",
|
|
32
|
+
"price_min_margin",
|
|
33
|
+
"product_tmpl_id",
|
|
34
|
+
"cost",
|
|
35
|
+
"min_quantity",
|
|
36
|
+
"fixed_price",
|
|
37
|
+
)
|
|
38
|
+
def _compute_margin(self):
|
|
39
|
+
for item in self:
|
|
40
|
+
if item.applied_on not in ("1_product", "0_product_variant"):
|
|
41
|
+
item.margin = 0
|
|
42
|
+
item.margin_percent = 0
|
|
43
|
+
continue
|
|
44
|
+
|
|
45
|
+
price_rule = item.pricelist_id._compute_price_rule(
|
|
46
|
+
item.product_tmpl_id, item.min_quantity
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
price = price_rule.get(item.product_tmpl_id.id, [0])[0]
|
|
50
|
+
|
|
51
|
+
if float_is_zero(price, precision_digits=item.currency_id.rounding):
|
|
52
|
+
item.margin = 0
|
|
53
|
+
item.margin_percent = 0
|
|
54
|
+
continue
|
|
55
|
+
|
|
56
|
+
current_company = self.env.company
|
|
57
|
+
|
|
58
|
+
res = item.product_tmpl_id.taxes_id.filtered(
|
|
59
|
+
lambda t: t.company_id and t.company_id == current_company
|
|
60
|
+
).compute_all(
|
|
61
|
+
price,
|
|
62
|
+
item.currency_id,
|
|
63
|
+
product=item.product_tmpl_id,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
price_vat_excl = res["total_excluded"]
|
|
67
|
+
|
|
68
|
+
cost = self.env.user.company_id.currency_id.compute(
|
|
69
|
+
item.cost, item.currency_id
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
item.margin = price_vat_excl - cost
|
|
73
|
+
item.margin_percent = (
|
|
74
|
+
price_vat_excl and (item.margin / price_vat_excl) * 100
|
|
75
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* Nguyen Minh Chien <chien@trobz.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This module shows the product's cost and margin from the pricelists.
|
|
Binary file
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
|
7
|
+
<title>Product Pricelist Margin</title>
|
|
8
|
+
<style type="text/css">
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
:Author: David Goodger (goodger@python.org)
|
|
12
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
13
|
+
:Copyright: This stylesheet has been placed in the public domain.
|
|
14
|
+
|
|
15
|
+
Default cascading style sheet for the HTML output of Docutils.
|
|
16
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
17
|
+
|
|
18
|
+
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
19
|
+
customize this style sheet.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/* used to remove borders from tables and images */
|
|
23
|
+
.borderless, table.borderless td, table.borderless th {
|
|
24
|
+
border: 0 }
|
|
25
|
+
|
|
26
|
+
table.borderless td, table.borderless th {
|
|
27
|
+
/* Override padding for "table.docutils td" with "! important".
|
|
28
|
+
The right padding separates the table cells. */
|
|
29
|
+
padding: 0 0.5em 0 0 ! important }
|
|
30
|
+
|
|
31
|
+
.first {
|
|
32
|
+
/* Override more specific margin styles with "! important". */
|
|
33
|
+
margin-top: 0 ! important }
|
|
34
|
+
|
|
35
|
+
.last, .with-subtitle {
|
|
36
|
+
margin-bottom: 0 ! important }
|
|
37
|
+
|
|
38
|
+
.hidden {
|
|
39
|
+
display: none }
|
|
40
|
+
|
|
41
|
+
.subscript {
|
|
42
|
+
vertical-align: sub;
|
|
43
|
+
font-size: smaller }
|
|
44
|
+
|
|
45
|
+
.superscript {
|
|
46
|
+
vertical-align: super;
|
|
47
|
+
font-size: smaller }
|
|
48
|
+
|
|
49
|
+
a.toc-backref {
|
|
50
|
+
text-decoration: none ;
|
|
51
|
+
color: black }
|
|
52
|
+
|
|
53
|
+
blockquote.epigraph {
|
|
54
|
+
margin: 2em 5em ; }
|
|
55
|
+
|
|
56
|
+
dl.docutils dd {
|
|
57
|
+
margin-bottom: 0.5em }
|
|
58
|
+
|
|
59
|
+
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
|
64
|
+
dl.docutils dt {
|
|
65
|
+
font-weight: bold }
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
div.abstract {
|
|
69
|
+
margin: 2em 5em }
|
|
70
|
+
|
|
71
|
+
div.abstract p.topic-title {
|
|
72
|
+
font-weight: bold ;
|
|
73
|
+
text-align: center }
|
|
74
|
+
|
|
75
|
+
div.admonition, div.attention, div.caution, div.danger, div.error,
|
|
76
|
+
div.hint, div.important, div.note, div.tip, div.warning {
|
|
77
|
+
margin: 2em ;
|
|
78
|
+
border: medium outset ;
|
|
79
|
+
padding: 1em }
|
|
80
|
+
|
|
81
|
+
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
82
|
+
div.important p.admonition-title, div.note p.admonition-title,
|
|
83
|
+
div.tip p.admonition-title {
|
|
84
|
+
font-weight: bold ;
|
|
85
|
+
font-family: sans-serif }
|
|
86
|
+
|
|
87
|
+
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
88
|
+
div.danger p.admonition-title, div.error p.admonition-title,
|
|
89
|
+
div.warning p.admonition-title, .code .error {
|
|
90
|
+
color: red ;
|
|
91
|
+
font-weight: bold ;
|
|
92
|
+
font-family: sans-serif }
|
|
93
|
+
|
|
94
|
+
/* Uncomment (and remove this text!) to get reduced vertical space in
|
|
95
|
+
compound paragraphs.
|
|
96
|
+
div.compound .compound-first, div.compound .compound-middle {
|
|
97
|
+
margin-bottom: 0.5em }
|
|
98
|
+
|
|
99
|
+
div.compound .compound-last, div.compound .compound-middle {
|
|
100
|
+
margin-top: 0.5em }
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
div.dedication {
|
|
104
|
+
margin: 2em 5em ;
|
|
105
|
+
text-align: center ;
|
|
106
|
+
font-style: italic }
|
|
107
|
+
|
|
108
|
+
div.dedication p.topic-title {
|
|
109
|
+
font-weight: bold ;
|
|
110
|
+
font-style: normal }
|
|
111
|
+
|
|
112
|
+
div.figure {
|
|
113
|
+
margin-left: 2em ;
|
|
114
|
+
margin-right: 2em }
|
|
115
|
+
|
|
116
|
+
div.footer, div.header {
|
|
117
|
+
clear: both;
|
|
118
|
+
font-size: smaller }
|
|
119
|
+
|
|
120
|
+
div.line-block {
|
|
121
|
+
display: block ;
|
|
122
|
+
margin-top: 1em ;
|
|
123
|
+
margin-bottom: 1em }
|
|
124
|
+
|
|
125
|
+
div.line-block div.line-block {
|
|
126
|
+
margin-top: 0 ;
|
|
127
|
+
margin-bottom: 0 ;
|
|
128
|
+
margin-left: 1.5em }
|
|
129
|
+
|
|
130
|
+
div.sidebar {
|
|
131
|
+
margin: 0 0 0.5em 1em ;
|
|
132
|
+
border: medium outset ;
|
|
133
|
+
padding: 1em ;
|
|
134
|
+
background-color: #ffffee ;
|
|
135
|
+
width: 40% ;
|
|
136
|
+
float: right ;
|
|
137
|
+
clear: right }
|
|
138
|
+
|
|
139
|
+
div.sidebar p.rubric {
|
|
140
|
+
font-family: sans-serif ;
|
|
141
|
+
font-size: medium }
|
|
142
|
+
|
|
143
|
+
div.system-messages {
|
|
144
|
+
margin: 5em }
|
|
145
|
+
|
|
146
|
+
div.system-messages h1 {
|
|
147
|
+
color: red }
|
|
148
|
+
|
|
149
|
+
div.system-message {
|
|
150
|
+
border: medium outset ;
|
|
151
|
+
padding: 1em }
|
|
152
|
+
|
|
153
|
+
div.system-message p.system-message-title {
|
|
154
|
+
color: red ;
|
|
155
|
+
font-weight: bold }
|
|
156
|
+
|
|
157
|
+
div.topic {
|
|
158
|
+
margin: 2em }
|
|
159
|
+
|
|
160
|
+
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
|
161
|
+
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
|
162
|
+
margin-top: 0.4em }
|
|
163
|
+
|
|
164
|
+
h1.title {
|
|
165
|
+
text-align: center }
|
|
166
|
+
|
|
167
|
+
h2.subtitle {
|
|
168
|
+
text-align: center }
|
|
169
|
+
|
|
170
|
+
hr.docutils {
|
|
171
|
+
width: 75% }
|
|
172
|
+
|
|
173
|
+
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
|
174
|
+
clear: left ;
|
|
175
|
+
float: left ;
|
|
176
|
+
margin-right: 1em }
|
|
177
|
+
|
|
178
|
+
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
|
179
|
+
clear: right ;
|
|
180
|
+
float: right ;
|
|
181
|
+
margin-left: 1em }
|
|
182
|
+
|
|
183
|
+
img.align-center, .figure.align-center, object.align-center {
|
|
184
|
+
display: block;
|
|
185
|
+
margin-left: auto;
|
|
186
|
+
margin-right: auto;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
table.align-center {
|
|
190
|
+
margin-left: auto;
|
|
191
|
+
margin-right: auto;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.align-left {
|
|
195
|
+
text-align: left }
|
|
196
|
+
|
|
197
|
+
.align-center {
|
|
198
|
+
clear: both ;
|
|
199
|
+
text-align: center }
|
|
200
|
+
|
|
201
|
+
.align-right {
|
|
202
|
+
text-align: right }
|
|
203
|
+
|
|
204
|
+
/* reset inner alignment in figures */
|
|
205
|
+
div.align-right {
|
|
206
|
+
text-align: inherit }
|
|
207
|
+
|
|
208
|
+
/* div.align-center * { */
|
|
209
|
+
/* text-align: left } */
|
|
210
|
+
|
|
211
|
+
.align-top {
|
|
212
|
+
vertical-align: top }
|
|
213
|
+
|
|
214
|
+
.align-middle {
|
|
215
|
+
vertical-align: middle }
|
|
216
|
+
|
|
217
|
+
.align-bottom {
|
|
218
|
+
vertical-align: bottom }
|
|
219
|
+
|
|
220
|
+
ol.simple, ul.simple {
|
|
221
|
+
margin-bottom: 1em }
|
|
222
|
+
|
|
223
|
+
ol.arabic {
|
|
224
|
+
list-style: decimal }
|
|
225
|
+
|
|
226
|
+
ol.loweralpha {
|
|
227
|
+
list-style: lower-alpha }
|
|
228
|
+
|
|
229
|
+
ol.upperalpha {
|
|
230
|
+
list-style: upper-alpha }
|
|
231
|
+
|
|
232
|
+
ol.lowerroman {
|
|
233
|
+
list-style: lower-roman }
|
|
234
|
+
|
|
235
|
+
ol.upperroman {
|
|
236
|
+
list-style: upper-roman }
|
|
237
|
+
|
|
238
|
+
p.attribution {
|
|
239
|
+
text-align: right ;
|
|
240
|
+
margin-left: 50% }
|
|
241
|
+
|
|
242
|
+
p.caption {
|
|
243
|
+
font-style: italic }
|
|
244
|
+
|
|
245
|
+
p.credits {
|
|
246
|
+
font-style: italic ;
|
|
247
|
+
font-size: smaller }
|
|
248
|
+
|
|
249
|
+
p.label {
|
|
250
|
+
white-space: nowrap }
|
|
251
|
+
|
|
252
|
+
p.rubric {
|
|
253
|
+
font-weight: bold ;
|
|
254
|
+
font-size: larger ;
|
|
255
|
+
color: maroon ;
|
|
256
|
+
text-align: center }
|
|
257
|
+
|
|
258
|
+
p.sidebar-title {
|
|
259
|
+
font-family: sans-serif ;
|
|
260
|
+
font-weight: bold ;
|
|
261
|
+
font-size: larger }
|
|
262
|
+
|
|
263
|
+
p.sidebar-subtitle {
|
|
264
|
+
font-family: sans-serif ;
|
|
265
|
+
font-weight: bold }
|
|
266
|
+
|
|
267
|
+
p.topic-title {
|
|
268
|
+
font-weight: bold }
|
|
269
|
+
|
|
270
|
+
pre.address {
|
|
271
|
+
margin-bottom: 0 ;
|
|
272
|
+
margin-top: 0 ;
|
|
273
|
+
font: inherit }
|
|
274
|
+
|
|
275
|
+
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
276
|
+
margin-left: 2em ;
|
|
277
|
+
margin-right: 2em }
|
|
278
|
+
|
|
279
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
280
|
+
pre.code, code { background-color: #eeeeee }
|
|
281
|
+
pre.code .comment, code .comment { color: #5C6576 }
|
|
282
|
+
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
283
|
+
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
|
284
|
+
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
|
285
|
+
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
|
286
|
+
pre.code .inserted, code .inserted { background-color: #A3D289}
|
|
287
|
+
|
|
288
|
+
span.classifier {
|
|
289
|
+
font-family: sans-serif ;
|
|
290
|
+
font-style: oblique }
|
|
291
|
+
|
|
292
|
+
span.classifier-delimiter {
|
|
293
|
+
font-family: sans-serif ;
|
|
294
|
+
font-weight: bold }
|
|
295
|
+
|
|
296
|
+
span.interpreted {
|
|
297
|
+
font-family: sans-serif }
|
|
298
|
+
|
|
299
|
+
span.option {
|
|
300
|
+
white-space: nowrap }
|
|
301
|
+
|
|
302
|
+
span.pre {
|
|
303
|
+
white-space: pre }
|
|
304
|
+
|
|
305
|
+
span.problematic, pre.problematic {
|
|
306
|
+
color: red }
|
|
307
|
+
|
|
308
|
+
span.section-subtitle {
|
|
309
|
+
/* font-size relative to parent (h1..h6 element) */
|
|
310
|
+
font-size: 80% }
|
|
311
|
+
|
|
312
|
+
table.citation {
|
|
313
|
+
border-left: solid 1px gray;
|
|
314
|
+
margin-left: 1px }
|
|
315
|
+
|
|
316
|
+
table.docinfo {
|
|
317
|
+
margin: 2em 4em }
|
|
318
|
+
|
|
319
|
+
table.docutils {
|
|
320
|
+
margin-top: 0.5em ;
|
|
321
|
+
margin-bottom: 0.5em }
|
|
322
|
+
|
|
323
|
+
table.footnote {
|
|
324
|
+
border-left: solid 1px black;
|
|
325
|
+
margin-left: 1px }
|
|
326
|
+
|
|
327
|
+
table.docutils td, table.docutils th,
|
|
328
|
+
table.docinfo td, table.docinfo th {
|
|
329
|
+
padding-left: 0.5em ;
|
|
330
|
+
padding-right: 0.5em ;
|
|
331
|
+
vertical-align: top }
|
|
332
|
+
|
|
333
|
+
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
|
334
|
+
font-weight: bold ;
|
|
335
|
+
text-align: left ;
|
|
336
|
+
white-space: nowrap ;
|
|
337
|
+
padding-left: 0 }
|
|
338
|
+
|
|
339
|
+
/* "booktabs" style (no vertical lines) */
|
|
340
|
+
table.docutils.booktabs {
|
|
341
|
+
border: 0px;
|
|
342
|
+
border-top: 2px solid;
|
|
343
|
+
border-bottom: 2px solid;
|
|
344
|
+
border-collapse: collapse;
|
|
345
|
+
}
|
|
346
|
+
table.docutils.booktabs * {
|
|
347
|
+
border: 0px;
|
|
348
|
+
}
|
|
349
|
+
table.docutils.booktabs th {
|
|
350
|
+
border-bottom: thin solid;
|
|
351
|
+
text-align: left;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
|
355
|
+
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
|
356
|
+
font-size: 100% }
|
|
357
|
+
|
|
358
|
+
ul.auto-toc {
|
|
359
|
+
list-style-type: none }
|
|
360
|
+
|
|
361
|
+
</style>
|
|
362
|
+
</head>
|
|
363
|
+
<body>
|
|
364
|
+
<div class="document" id="product-pricelist-margin">
|
|
365
|
+
<h1 class="title">Product Pricelist Margin</h1>
|
|
366
|
+
|
|
367
|
+
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
368
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
369
|
+
!! changes will be overwritten. !!
|
|
370
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
371
|
+
!! source digest: sha256:f7a304e2acd01b42ff2f6e9de3dfa6a6ee4519e2beeddba42b49fad5e8d7d0b6
|
|
372
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
373
|
+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_pricelist_margin"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
374
|
+
<p>This module shows the product’s cost and margin from the pricelists.</p>
|
|
375
|
+
<p><strong>Table of contents</strong></p>
|
|
376
|
+
<div class="contents local topic" id="contents">
|
|
377
|
+
<ul class="simple">
|
|
378
|
+
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
|
|
379
|
+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
|
|
380
|
+
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
|
|
381
|
+
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
|
|
382
|
+
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
|
|
383
|
+
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
|
|
384
|
+
</ul>
|
|
385
|
+
</li>
|
|
386
|
+
</ul>
|
|
387
|
+
</div>
|
|
388
|
+
<div class="section" id="usage">
|
|
389
|
+
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
|
390
|
+
<ul class="simple">
|
|
391
|
+
<li>Go to “Sale > Products > Pricelists”</li>
|
|
392
|
+
<li>Open a pricelist form</li>
|
|
393
|
+
<li>There are 3 new columns on the “Price rules” list.
|
|
394
|
+
.. image:: <a class="reference external" href="https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_pricelist_margin/static/description/pricelist_item.png">https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_pricelist_margin/static/description/pricelist_item.png</a></li>
|
|
395
|
+
</ul>
|
|
396
|
+
</div>
|
|
397
|
+
<div class="section" id="bug-tracker">
|
|
398
|
+
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
|
399
|
+
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/issues">GitHub Issues</a>.
|
|
400
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
401
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
402
|
+
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_margin%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
|
403
|
+
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
|
404
|
+
</div>
|
|
405
|
+
<div class="section" id="credits">
|
|
406
|
+
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
|
|
407
|
+
<div class="section" id="authors">
|
|
408
|
+
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
|
409
|
+
<ul class="simple">
|
|
410
|
+
<li>Camptocamp</li>
|
|
411
|
+
</ul>
|
|
412
|
+
</div>
|
|
413
|
+
<div class="section" id="contributors">
|
|
414
|
+
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
|
415
|
+
<ul class="simple">
|
|
416
|
+
<li>Nguyen Minh Chien <<a class="reference external" href="mailto:chien@trobz.com">chien@trobz.com</a>></li>
|
|
417
|
+
</ul>
|
|
418
|
+
</div>
|
|
419
|
+
<div class="section" id="maintainers">
|
|
420
|
+
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
|
|
421
|
+
<p>This module is maintained by the OCA.</p>
|
|
422
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
423
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
424
|
+
</a>
|
|
425
|
+
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
426
|
+
mission is to support the collaborative development of Odoo features and
|
|
427
|
+
promote its widespread use.</p>
|
|
428
|
+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin">OCA/product-attribute</a> project on GitHub.</p>
|
|
429
|
+
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</body>
|
|
434
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import test_margin
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Copyright 2024 Camptocamp SA
|
|
2
|
+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
|
+
|
|
4
|
+
from odoo.tests.common import tagged
|
|
5
|
+
|
|
6
|
+
from odoo.addons.base.tests.common import BaseCommon
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@tagged("post_install", "-at_install")
|
|
10
|
+
class TestMargin(BaseCommon):
|
|
11
|
+
@classmethod
|
|
12
|
+
def setUpClass(cls):
|
|
13
|
+
super().setUpClass()
|
|
14
|
+
cls.product = cls.env["product.product"].create(
|
|
15
|
+
{
|
|
16
|
+
"default_code": "pricelist-margin-product",
|
|
17
|
+
"name": "Demo Margin Product",
|
|
18
|
+
"list_price": 40.0,
|
|
19
|
+
"standard_price": 20.0,
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
cls.pricelist = cls.env["product.pricelist"].create(
|
|
23
|
+
{
|
|
24
|
+
"name": "pricelist",
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
cls.line = cls.env["product.pricelist.item"].create(
|
|
29
|
+
{
|
|
30
|
+
"pricelist_id": cls.pricelist.id,
|
|
31
|
+
"product_tmpl_id": cls.product.product_tmpl_id.id,
|
|
32
|
+
"compute_price": "fixed",
|
|
33
|
+
"applied_on": "1_product",
|
|
34
|
+
"fixed_price": 35,
|
|
35
|
+
"min_quantity": 1,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
cls.env.ref("product.group_sale_pricelist").users |= cls.env.user
|
|
39
|
+
|
|
40
|
+
def test_margin_computation_compute_price(self):
|
|
41
|
+
self.assertEqual(self.line.cost, 20.0)
|
|
42
|
+
self.assertEqual(self.line.margin, (35 - 20))
|
|
43
|
+
self.assertEqual(self.line.margin_percent, ((35 - 20) / 35) * 100)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
|
|
4
|
+
<record id="product_pricelist_item_tree_view_inherit" model="ir.ui.view">
|
|
5
|
+
<field name="model">product.pricelist.item</field>
|
|
6
|
+
<field name="inherit_id" ref="product.product_pricelist_item_tree_view" />
|
|
7
|
+
<field name="arch" type="xml">
|
|
8
|
+
<field name="price" position="after">
|
|
9
|
+
<field name="cost" invisible="1" />
|
|
10
|
+
<field name="margin" optional="show" />
|
|
11
|
+
<field name="margin_percent" optional="show" />
|
|
12
|
+
</field>
|
|
13
|
+
</field>
|
|
14
|
+
</record>
|
|
15
|
+
<record
|
|
16
|
+
id="product_pricelist_item_tree_view_from_product_inherit"
|
|
17
|
+
model="ir.ui.view"
|
|
18
|
+
>
|
|
19
|
+
<field name="model">product.pricelist.item</field>
|
|
20
|
+
<field
|
|
21
|
+
name="inherit_id"
|
|
22
|
+
ref="product.product_pricelist_item_tree_view_from_product"
|
|
23
|
+
/>
|
|
24
|
+
<field name="arch" type="xml">
|
|
25
|
+
<field name="fixed_price" position="after">
|
|
26
|
+
<field name="cost" invisible="1" />
|
|
27
|
+
<field name="margin" optional="show" />
|
|
28
|
+
<field name="margin_percent" optional="show" />
|
|
29
|
+
</field>
|
|
30
|
+
</field>
|
|
31
|
+
</record>
|
|
32
|
+
|
|
33
|
+
<record id="product_pricelist_item_form_view_inerhit" model="ir.ui.view">
|
|
34
|
+
<field name="inherit_id" ref="product.product_pricelist_item_form_view" />
|
|
35
|
+
<field name="model">product.pricelist.item</field>
|
|
36
|
+
<field name="arch" type="xml">
|
|
37
|
+
<xpath expr="//group[@name='pricelist_rule_base']/div" position="after">
|
|
38
|
+
<group
|
|
39
|
+
attrs="{'invisible': [('applied_on', 'not in', ['1_product', '0_product_variant'])]}"
|
|
40
|
+
>
|
|
41
|
+
<field name="cost" invisible="1" />
|
|
42
|
+
<field name="margin" />
|
|
43
|
+
<field name="margin_percent" />
|
|
44
|
+
</group>
|
|
45
|
+
</xpath>
|
|
46
|
+
</field>
|
|
47
|
+
</record>
|
|
48
|
+
|
|
49
|
+
</odoo>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<odoo>
|
|
3
|
+
|
|
4
|
+
<record id="product_pricelist_view_inherit" model="ir.ui.view">
|
|
5
|
+
<field name="model">product.pricelist</field>
|
|
6
|
+
<field name="inherit_id" ref="product.product_pricelist_view" />
|
|
7
|
+
<field name="arch" type="xml">
|
|
8
|
+
<xpath
|
|
9
|
+
expr="//field[@name='item_ids']/tree[1]/field[@name='fixed_price']"
|
|
10
|
+
position="after"
|
|
11
|
+
>
|
|
12
|
+
<field name="cost" invisible="1" />
|
|
13
|
+
<field
|
|
14
|
+
name="margin"
|
|
15
|
+
optional="show"
|
|
16
|
+
attrs="{'invisible': [('applied_on', 'not in', ['1_product', '0_product_variant'])]}"
|
|
17
|
+
/>
|
|
18
|
+
<field
|
|
19
|
+
name="margin_percent"
|
|
20
|
+
optional="show"
|
|
21
|
+
attrs="{'invisible': [('applied_on', 'not in', ['1_product', '0_product_variant'])]}"
|
|
22
|
+
/>
|
|
23
|
+
</xpath>
|
|
24
|
+
<xpath
|
|
25
|
+
expr="//field[@name='item_ids']/tree[2]/field[@name='price']"
|
|
26
|
+
position="after"
|
|
27
|
+
>
|
|
28
|
+
<field name="cost" invisible="1" />
|
|
29
|
+
<field
|
|
30
|
+
name="margin"
|
|
31
|
+
optional="show"
|
|
32
|
+
attrs="{'invisible': [('applied_on', 'not in', ['1_product', '0_product_variant'])]}"
|
|
33
|
+
/>
|
|
34
|
+
<field
|
|
35
|
+
name="margin_percent"
|
|
36
|
+
optional="show"
|
|
37
|
+
attrs="{'invisible': [('applied_on', 'not in', ['1_product', '0_product_variant'])]}"
|
|
38
|
+
/>
|
|
39
|
+
</xpath>
|
|
40
|
+
</field>
|
|
41
|
+
</record>
|
|
42
|
+
|
|
43
|
+
</odoo>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: odoo-addon-product_pricelist_margin
|
|
3
|
+
Version: 16.0.1.0.0.1
|
|
4
|
+
Summary: This module shows the product's cost and margin from the pricelists.
|
|
5
|
+
Home-page: https://github.com/OCA/product-attribute
|
|
6
|
+
Author: Camptocamp, Odoo Community Association (OCA)
|
|
7
|
+
Author-email: support@odoo-community.org
|
|
8
|
+
License: AGPL-3
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Framework :: Odoo
|
|
11
|
+
Classifier: Framework :: Odoo :: 16.0
|
|
12
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: odoo<16.1dev,>=16.0a
|
|
15
|
+
|
|
16
|
+
========================
|
|
17
|
+
Product Pricelist Margin
|
|
18
|
+
========================
|
|
19
|
+
|
|
20
|
+
..
|
|
21
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
22
|
+
!! This file is generated by oca-gen-addon-readme !!
|
|
23
|
+
!! changes will be overwritten. !!
|
|
24
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
25
|
+
!! source digest: sha256:f7a304e2acd01b42ff2f6e9de3dfa6a6ee4519e2beeddba42b49fad5e8d7d0b6
|
|
26
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
+
|
|
28
|
+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
29
|
+
:target: https://odoo-community.org/page/development-status
|
|
30
|
+
:alt: Beta
|
|
31
|
+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
|
32
|
+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
|
33
|
+
:alt: License: AGPL-3
|
|
34
|
+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
|
|
35
|
+
:target: https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin
|
|
36
|
+
:alt: OCA/product-attribute
|
|
37
|
+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
38
|
+
:target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_pricelist_margin
|
|
39
|
+
:alt: Translate me on Weblate
|
|
40
|
+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
41
|
+
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=16.0
|
|
42
|
+
:alt: Try me on Runboat
|
|
43
|
+
|
|
44
|
+
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
45
|
+
|
|
46
|
+
This module shows the product's cost and margin from the pricelists.
|
|
47
|
+
|
|
48
|
+
**Table of contents**
|
|
49
|
+
|
|
50
|
+
.. contents::
|
|
51
|
+
:local:
|
|
52
|
+
|
|
53
|
+
Usage
|
|
54
|
+
=====
|
|
55
|
+
|
|
56
|
+
* Go to "Sale > Products > Pricelists"
|
|
57
|
+
|
|
58
|
+
* Open a pricelist form
|
|
59
|
+
|
|
60
|
+
* There are 3 new columns on the "Price rules" list.
|
|
61
|
+
.. image:: https://raw.githubusercontent.com/OCA/product-attribute/16.0/product_pricelist_margin/static/description/pricelist_item.png
|
|
62
|
+
|
|
63
|
+
Bug Tracker
|
|
64
|
+
===========
|
|
65
|
+
|
|
66
|
+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
|
|
67
|
+
In case of trouble, please check there if your issue has already been reported.
|
|
68
|
+
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
|
69
|
+
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_pricelist_margin%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
70
|
+
|
|
71
|
+
Do not contact contributors directly about support or help with technical issues.
|
|
72
|
+
|
|
73
|
+
Credits
|
|
74
|
+
=======
|
|
75
|
+
|
|
76
|
+
Authors
|
|
77
|
+
~~~~~~~
|
|
78
|
+
|
|
79
|
+
* Camptocamp
|
|
80
|
+
|
|
81
|
+
Contributors
|
|
82
|
+
~~~~~~~~~~~~
|
|
83
|
+
|
|
84
|
+
* Nguyen Minh Chien <chien@trobz.com>
|
|
85
|
+
|
|
86
|
+
Maintainers
|
|
87
|
+
~~~~~~~~~~~
|
|
88
|
+
|
|
89
|
+
This module is maintained by the OCA.
|
|
90
|
+
|
|
91
|
+
.. image:: https://odoo-community.org/logo.png
|
|
92
|
+
:alt: Odoo Community Association
|
|
93
|
+
:target: https://odoo-community.org
|
|
94
|
+
|
|
95
|
+
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
96
|
+
mission is to support the collaborative development of Odoo features and
|
|
97
|
+
promote its widespread use.
|
|
98
|
+
|
|
99
|
+
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_margin>`_ project on GitHub.
|
|
100
|
+
|
|
101
|
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
odoo/addons/product_pricelist_margin/README.rst,sha256=3WTwkbV6M6C77XZlLZ7gS5lTpR5Ou_qnoFtiVr9m2Dg,3202
|
|
2
|
+
odoo/addons/product_pricelist_margin/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
|
3
|
+
odoo/addons/product_pricelist_margin/__manifest__.py,sha256=dTIJ_RF8CZ5Fl0EFQ8CJF1EG4zUrkDTssgCYvfCvyQ0,572
|
|
4
|
+
odoo/addons/product_pricelist_margin/i18n/fr.pot,sha256=gvpSUOzdZfnw8PARtbfaNK7NQDhjpU9tD0AJbOlao0E,1643
|
|
5
|
+
odoo/addons/product_pricelist_margin/i18n/product_pricelist_margin.pot,sha256=DzN3dyKPk91lOR4KZ1inU3xEA_0r5Mt2NRvqmve-KMo,1507
|
|
6
|
+
odoo/addons/product_pricelist_margin/i18n/product_pricelist_margins.pot,sha256=QxKxHYMfnmBCm-hgu9q0w-VZ1GL95TPJYI697El79BI,1598
|
|
7
|
+
odoo/addons/product_pricelist_margin/models/__init__.py,sha256=5O-ZCP4vtIwGNcyevX6dEHWtAgA-rVUcHEiBf70zr4o,37
|
|
8
|
+
odoo/addons/product_pricelist_margin/models/product_pricelist_item.py,sha256=c0osh3rUUh7uf6vwew1cz6h3A3lJ3enhR_1FAQfGBE4,2177
|
|
9
|
+
odoo/addons/product_pricelist_margin/readme/CONTRIBUTORS.rst,sha256=UJyDuCaB8tf9geXoaMc1oLOtC48nG131wx1ettF4BLY,38
|
|
10
|
+
odoo/addons/product_pricelist_margin/readme/DESCRIPTION.rst,sha256=ssHn8TRsMaxSSCph4gwLkihlh0vaMI650tE4gy7G0rQ,69
|
|
11
|
+
odoo/addons/product_pricelist_margin/readme/USAGE.rst,sha256=4bnXuUc-k5UL0X22YiBwpNooPMjqgcu2ZA3BBVJfN5E,172
|
|
12
|
+
odoo/addons/product_pricelist_margin/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
13
|
+
odoo/addons/product_pricelist_margin/static/description/index.html,sha256=aqsB6YmT-1teJG3r4TWtdf6KoV798SGokeuxUIDGg88,12938
|
|
14
|
+
odoo/addons/product_pricelist_margin/static/description/pricelist_item.png,sha256=HRwmmahzytnJiRoDziaVM_c6HKmXKxXpRlC_gYaoJ1M,50455
|
|
15
|
+
odoo/addons/product_pricelist_margin/tests/__init__.py,sha256=UKD8x1fiapNCuRoRZroT8v_O7QHI1P4GHKEjteEq41E,26
|
|
16
|
+
odoo/addons/product_pricelist_margin/tests/test_margin.py,sha256=EN04IOflZKUauVt0DbJT5onuVhBnJCyQ_qDBCuCsHMQ,1424
|
|
17
|
+
odoo/addons/product_pricelist_margin/views/product_pricelist_item_views.xml,sha256=XwqCnck9dfZGt50odzC_DaAkrCZObYtSmg0xKtvv2zE,1929
|
|
18
|
+
odoo/addons/product_pricelist_margin/views/product_pricelist_views.xml,sha256=g74Tkw7zVoa6CNJEpgLLkDaLHiFArB7kdJnfjX4GAXg,1650
|
|
19
|
+
odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/METADATA,sha256=FVznmIq7eMU_hSofHzfslYWt1xOVfFGO1NbKi6rzdJw,3776
|
|
20
|
+
odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
21
|
+
odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
22
|
+
odoo_addon_product_pricelist_margin-16.0.1.0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
odoo
|