Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,829 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
========================== | ||
Product Variant Sale Price | ||
========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fproduct--variant-lightgray.png?logo=github | ||
:target: https://github.com/OCA/product-variant/tree/11.0/product_variant_sale_price | ||
:alt: OCA/product-variant | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/product-variant-11-0/product-variant-11-0-product_variant_sale_price | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/137/11.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to handle sale price at product variant level | ||
(product.product) instead of product level (product.template), which is the | ||
default. | ||
|
||
This module also hides sale price at product template level when has more than | ||
one variant. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-variant/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/product-variant/issues/new?body=module:%20product_variant_sale_price%0Aversion:%2011.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 | ||
~~~~~~~ | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Carlos Dauden <carlos.dauden@tecnativa.com> | ||
* Sergio Teruel <sergio.teruel@tecnativa.com> | ||
* Alex Comba <alex.comba@agilebg.com> | ||
|
||
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. | ||
|
||
This module is part of the `OCA/product-variant <https://github.com/OCA/product-variant/tree/11.0/product_variant_sale_price>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright 2016 Sergio Teruel <sergio.teruel@tecnativa.com> | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
from . import models | ||
from .hooks import set_sale_price_on_variant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2016 Sergio Teruel <sergio.teruel@tecnativa.com> | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
{ | ||
'name': 'Product Variant Sale Price', | ||
'summary': 'Allows to write fixed prices in product variants', | ||
'version': '10.0.1.0.0', | ||
'category': 'Product Management', | ||
'website': 'https://odoo-community.org/', | ||
'author': 'Tecnativa, ' | ||
'Odoo Community Association (OCA)', | ||
'license': 'AGPL-3', | ||
'application': False, | ||
'installable': True, | ||
'depends': [ | ||
'account', | ||
'product', | ||
], | ||
'data': [ | ||
'views/product_view.xml', | ||
], | ||
'post_init_hook': 'set_sale_price_on_variant', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2016 Sergio Teruel <sergio.teruel@tecnativa.com> | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
def set_sale_price_on_variant(cr, registry, template_id=None): | ||
sql = """ | ||
UPDATE product_product pp | ||
SET fix_price = pt.list_price + ( | ||
SELECT COALESCE(SUM(pap.price_extra), 0) | ||
FROM product_attribute_value_product_product_rel pav_pp_rel | ||
LEFT JOIN product_attribute_price pap ON | ||
pap.value_id = pav_pp_rel.product_attribute_value_id | ||
WHERE pav_pp_rel.product_product_id = pp.id | ||
AND pap.product_tmpl_id = pt.id | ||
) | ||
FROM product_template pt | ||
WHERE %s; | ||
""" % ('pt.id = pp.product_tmpl_id' + | ||
(template_id and ' AND pt.id = %s' % template_id or '')) | ||
cr.execute(sql) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Carles Antoli <carlesantoli@hotmail.com>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-01-14 05:29+0000\n" | ||
"PO-Revision-Date: 2017-01-14 05:29+0000\n" | ||
"Last-Translator: Carles Antoli <carlesantoli@hotmail.com>, 2017\n" | ||
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" | ||
"Language: ca\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Producte" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "Plantilla del producte" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# OCA Transbot <transbot@odoo-community.org>, 2016 | ||
# Niki Waibel <niki.waibel@gmail.com>, 2016 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-11-11 03:45+0000\n" | ||
"PO-Revision-Date: 2016-11-11 03:45+0000\n" | ||
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2016\n" | ||
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Produkt" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "Produktvorlage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# OCA Transbot <transbot@odoo-community.org>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-02-18 05:12+0000\n" | ||
"PO-Revision-Date: 2017-02-18 05:12+0000\n" | ||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n" | ||
"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" | ||
"el_GR/)\n" | ||
"Language: el_GR\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Προϊόν" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2016 | ||
# OCA Transbot <transbot@odoo-community.org>, 2016 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-11-11 03:45+0000\n" | ||
"PO-Revision-Date: 2016-11-11 03:45+0000\n" | ||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\n" | ||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" | ||
"Language: es\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "Precio fijo" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Producto" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "Plantilla de producto" | ||
|
||
#~ msgid "" | ||
#~ "{'invisible': [\n" | ||
#~ " ('product_variant_count', " | ||
#~ "'>', 1)\n" | ||
#~ " ]}" | ||
#~ msgstr "" | ||
#~ "{'invisible': [\n" | ||
#~ " ('product_variant_count', " | ||
#~ "'>', 1)\n" | ||
#~ " ]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Javier García-Panach <panaka7@gmail.com>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-12-31 06:23+0000\n" | ||
"PO-Revision-Date: 2016-12-31 06:23+0000\n" | ||
"Last-Translator: Javier García-Panach <panaka7@gmail.com>, 2017\n" | ||
"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/" | ||
"es_ES/)\n" | ||
"Language: es_ES\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Producto" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Juan González <bifomania@protonmail.com>, 2016 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-11-29 14:59+0000\n" | ||
"PO-Revision-Date: 2016-11-29 14:59+0000\n" | ||
"Last-Translator: Juan González <bifomania@protonmail.com>, 2016\n" | ||
"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" | ||
"es_MX/)\n" | ||
"Language: es_MX\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "Plantilla del producto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Esther Martín Menéndez <esthermartin001@gmail.com>, 2017 | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2017-02-18 05:12+0000\n" | ||
"PO-Revision-Date: 2017-02-18 05:12+0000\n" | ||
"Last-Translator: Esther Martín Menéndez <esthermartin001@gmail.com>, 2017\n" | ||
"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" | ||
"Language: eu\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" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product_fix_price | ||
msgid "Fix Price" | ||
msgstr "" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product" | ||
msgstr "Produktua" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_template | ||
msgid "Product Template" | ||
msgstr "" |
Oops, something went wrong.