diff --git a/product_variant_sale_price/README.rst b/product_variant_sale_price/README.rst new file mode 100644 index 000000000..0d7baa9cc --- /dev/null +++ b/product_variant_sale_price/README.rst @@ -0,0 +1,82 @@ +========================== +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/15.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-15-0/product-variant-15-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/15.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 `_. +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Carlos Dauden +* Sergio Teruel +* Alex Comba +* Fabien Bourgeois +* Vicent Cubells + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_variant_sale_price/__init__.py b/product_variant_sale_price/__init__.py new file mode 100644 index 000000000..15689df3b --- /dev/null +++ b/product_variant_sale_price/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2016 Sergio Teruel +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import models +from .hooks import set_sale_price_on_variant diff --git a/product_variant_sale_price/__manifest__.py b/product_variant_sale_price/__manifest__.py new file mode 100644 index 000000000..43baf374d --- /dev/null +++ b/product_variant_sale_price/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2016 Sergio Teruel +# Copyright 2018 Fabien Bourgeois +# 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": "16.0.1.0.0", + "category": "Product Management", + "website": "https://github.com/OCA/product-variant", + "author": "Tecnativa, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": ["account", "sale"], + "data": ["views/product_views.xml"], + "post_init_hook": "set_sale_price_on_variant", +} diff --git a/product_variant_sale_price/hooks.py b/product_variant_sale_price/hooks.py new file mode 100644 index 000000000..775cc0f48 --- /dev/null +++ b/product_variant_sale_price/hooks.py @@ -0,0 +1,24 @@ +# Copyright 2016 Sergio Teruel +# Copyright 2018 Fabien Bourgeois +# 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(ptav.price_extra), 0) + FROM product_variant_combination pvc + LEFT JOIN product_template_attribute_value ptav ON + ptav.id = pvc.product_template_attribute_value_id + WHERE pvc.product_product_id = pp.id + AND ptav.product_tmpl_id = pt.id + ) + FROM product_template pt + WHERE pt.id = pp.product_tmpl_id + """ + if template_id: + sql += "AND pt.id = %s" + cr.execute(sql, (template_id,)) + else: + cr.execute(sql) diff --git a/product_variant_sale_price/i18n/ca.po b/product_variant_sale_price/i18n/ca.po new file mode 100644 index 000000000..97727278e --- /dev/null +++ b/product_variant_sale_price/i18n/ca.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Carles Antoli , 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: 2022-04-13 14:05+0000\n" +"Last-Translator: Noel estudillo \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" +"X-Generator: Weblate 4.3.2\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 "Preu fix" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "Preu de llista" + +#. 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" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "Preu de venta" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" +"El preu de venda es gestiona des de la plantilla del producte. Feu clic al " +"botó \"Configura les variants\" per establir els preus dels atributs " +"addicionals." diff --git a/product_variant_sale_price/i18n/de.po b/product_variant_sale_price/i18n/de.po new file mode 100644 index 000000000..4805a4ba3 --- /dev/null +++ b/product_variant_sale_price/i18n/de.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2016 +# Niki Waibel , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/el_GR.po b/product_variant_sale_price/i18n/el_GR.po new file mode 100644 index 000000000..37bde7a97 --- /dev/null +++ b/product_variant_sale_price/i18n/el_GR.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/es.po b/product_variant_sale_price/i18n/es.po new file mode 100644 index 000000000..02e073eb7 --- /dev/null +++ b/product_variant_sale_price/i18n/es.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Pedro M. Baeza , 2016 +# OCA Transbot , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +#, fuzzy +#| msgid "Fix Price" +msgid "List 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" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +#, fuzzy +#| msgid "Fix Price" +msgid "Sale Price" +msgstr "Precio fijo" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" + +#~ msgid "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" +#~ msgstr "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" diff --git a/product_variant_sale_price/i18n/es_ES.po b/product_variant_sale_price/i18n/es_ES.po new file mode 100644 index 000000000..09118b10b --- /dev/null +++ b/product_variant_sale_price/i18n/es_ES.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Javier García-Panach , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/es_MX.po b/product_variant_sale_price/i18n/es_MX.po new file mode 100644 index 000000000..d6718aad5 --- /dev/null +++ b/product_variant_sale_price/i18n/es_MX.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Juan González , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/eu.po b/product_variant_sale_price/i18n/eu.po new file mode 100644 index 000000000..1847c0362 --- /dev/null +++ b/product_variant_sale_price/i18n/eu.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Esther Martín Menéndez , 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 , 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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/fi.po b/product_variant_sale_price/i18n/fi.po new file mode 100644 index 000000000..2ea2fad1e --- /dev/null +++ b/product_variant_sale_price/i18n/fi.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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 , 2016\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Tuote" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Tuotteen malli" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/fr.po b/product_variant_sale_price/i18n/fr.po new file mode 100644 index 000000000..22cd7e177 --- /dev/null +++ b/product_variant_sale_price/i18n/fr.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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: 2022-03-02 17:17+0000\n" +"Last-Translator: ajaniszewska-dev \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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 4.3.2\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 "Prix Fixe" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "List de Prix" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Article" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "Prix de Vente" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/fr_CH.po b/product_variant_sale_price/i18n/fr_CH.po new file mode 100644 index 000000000..b97e01502 --- /dev/null +++ b/product_variant_sale_price/i18n/fr_CH.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# leemannd , 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: leemannd , 2016\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/" +"teams/23907/fr_CH/)\n" +"Language: fr_CH\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produit" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Template de produit" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/fr_FR.po b/product_variant_sale_price/i18n/fr_FR.po new file mode 100644 index 000000000..e1d3d46fd --- /dev/null +++ b/product_variant_sale_price/i18n/fr_FR.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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 , 2016\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_FR\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produit" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/gl.po b/product_variant_sale_price/i18n/gl.po new file mode 100644 index 000000000..37cc0e76e --- /dev/null +++ b/product_variant_sale_price/i18n/gl.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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 , 2017\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"Language: gl\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produto" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/hr.po b/product_variant_sale_price/i18n/hr.po new file mode 100644 index 000000000..17c435381 --- /dev/null +++ b/product_variant_sale_price/i18n/hr.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 01:17+0000\n" +"PO-Revision-Date: 2016-09-18 01:17+0000\n" +"Last-Translator: Bole , 2016\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Proizvod" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Predložak proizvoda" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/hr_HR.po b/product_variant_sale_price/i18n/hr_HR.po new file mode 100644 index 000000000..edb7b7288 --- /dev/null +++ b/product_variant_sale_price/i18n/hr_HR.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-19 06:41+0000\n" +"PO-Revision-Date: 2017-08-19 06:41+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_HR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Proizvod" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Predložak proizvoda" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/it.po b/product_variant_sale_price/i18n/it.po new file mode 100644 index 000000000..6bda3cc55 --- /dev/null +++ b/product_variant_sale_price/i18n/it.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2016 +# Paolo Valier , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 01:17+0000\n" +"PO-Revision-Date: 2016-09-18 01:17+0000\n" +"Last-Translator: Paolo Valier , 2016\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\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 "Prezzo fisso" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +#, fuzzy +#| msgid "Fix Price" +msgid "List Price" +msgstr "Prezzo fisso" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Prodotto" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Template Prodotto" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +#, fuzzy +#| msgid "Fix Price" +msgid "Sale Price" +msgstr "Prezzo fisso" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" + +#~ msgid "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" +#~ msgstr "" +#~ "{'invisible': [\n" +#~ "('product_variant_count', '>', 1)\n" +#~ "]}" diff --git a/product_variant_sale_price/i18n/nl.po b/product_variant_sale_price/i18n/nl.po new file mode 100644 index 000000000..3b4383e03 --- /dev/null +++ b/product_variant_sale_price/i18n/nl.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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: 2018-09-25 14:00+0000\n" +"Last-Translator: Cas Vissers \n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\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.1.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 "Bepaal prijs" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +#, fuzzy +#| msgid "Fix Price" +msgid "List Price" +msgstr "Bepaal prijs" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Product" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Product sjabloon" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +#, fuzzy +#| msgid "Fix Price" +msgid "Sale Price" +msgstr "Bepaal prijs" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" + +#~ msgid "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" +#~ msgstr "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" diff --git a/product_variant_sale_price/i18n/nl_NL.po b/product_variant_sale_price/i18n/nl_NL.po new file mode 100644 index 000000000..0b564fd69 --- /dev/null +++ b/product_variant_sale_price/i18n/nl_NL.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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 , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Product" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/product_variant_sale_price.pot b/product_variant_sale_price/i18n/product_variant_sale_price.pot new file mode 100644 index 000000000..74d4c4393 --- /dev/null +++ b/product_variant_sale_price/i18n/product_variant_sale_price.pot @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sales Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure" +" Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/pt.po b/product_variant_sale_price/i18n/pt.po new file mode 100644 index 000000000..26621b1b6 --- /dev/null +++ b/product_variant_sale_price/i18n/pt.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 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: 2021-07-27 17:49+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\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 4.3.2\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 "Preço Fixo" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "Preço de Lista" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produto" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Modelo de Produto" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "Preço de Venda" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" +"O preço de venda é gerido a partir do modelo de produto. Clique no botão " +"'Configurar Variantes' para atribuir o preços extra dos atributos." diff --git a/product_variant_sale_price/i18n/pt_BR.po b/product_variant_sale_price/i18n/pt_BR.po new file mode 100644 index 000000000..305fbb460 --- /dev/null +++ b/product_variant_sale_price/i18n/pt_BR.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-19 06:41+0000\n" +"PO-Revision-Date: 2017-08-19 06:41+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produto" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Modelo Produto" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/ro.po b/product_variant_sale_price/i18n/ro.po new file mode 100644 index 000000000..f1976f74f --- /dev/null +++ b/product_variant_sale_price/i18n/ro.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-19 06:41+0000\n" +"PO-Revision-Date: 2017-08-19 06:41+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2: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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Produs" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Produs șablon" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/ru.po b/product_variant_sale_price/i18n/ru.po new file mode 100644 index 000000000..a25bd20f5 --- /dev/null +++ b/product_variant_sale_price/i18n/ru.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Victor Safronovich , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-01 21:12+0000\n" +"PO-Revision-Date: 2017-05-01 21:12+0000\n" +"Last-Translator: Victor Safronovich , 2017\n" +"Language-Team: Russian (https://www.transifex.com/oca/teams/23907/ru/)\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/sk.po b/product_variant_sale_price/i18n/sk.po new file mode 100644 index 000000000..55c79a0de --- /dev/null +++ b/product_variant_sale_price/i18n/sk.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Jan Prokop , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-04 12:48+0000\n" +"PO-Revision-Date: 2017-09-04 12:48+0000\n" +"Last-Translator: Jan Prokop , 2017\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/sl.po b/product_variant_sale_price/i18n/sl.po new file mode 100644 index 000000000..34d8d5c0a --- /dev/null +++ b/product_variant_sale_price/i18n/sl.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Matjaž Mozetič , 2016 +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-07 02:42+0000\n" +"PO-Revision-Date: 2016-09-07 02:42+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\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 "Fiksna cena" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__list_price +#, fuzzy +#| msgid "Fix Price" +msgid "List Price" +msgstr "Fiksna cena" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Proizvod" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Predloga proizvoda" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +#, fuzzy +#| msgid "Fix Price" +msgid "Sale Price" +msgstr "Fiksna cena" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" + +#~ msgid "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" +#~ msgstr "" +#~ "{'invisible': [\n" +#~ " ('product_variant_count', " +#~ "'>', 1)\n" +#~ " ]}" diff --git a/product_variant_sale_price/i18n/tr.po b/product_variant_sale_price/i18n/tr.po new file mode 100644 index 000000000..6c780f84a --- /dev/null +++ b/product_variant_sale_price/i18n/tr.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Ivan BARAYEV , 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: Ivan BARAYEV , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Ürün" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/tr_TR.po b/product_variant_sale_price/i18n/tr_TR.po new file mode 100644 index 000000000..8759d453b --- /dev/null +++ b/product_variant_sale_price/i18n/tr_TR.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# Ozge Altinisik , 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: Ozge Altinisik , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Ürün" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Ürün şablonu" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/vi_VN.po b/product_variant_sale_price/i18n/vi_VN.po new file mode 100644 index 000000000..386ad371e --- /dev/null +++ b/product_variant_sale_price/i18n/vi_VN.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-19 06:41+0000\n" +"PO-Revision-Date: 2017-08-19 06:41+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_product +msgid "Product" +msgstr "Sản phẩm" + +#. module: product_variant_sale_price +#: model:ir.model,name:product_variant_sale_price.model_product_template +msgid "Product Template" +msgstr "Mẫu sản phẩm" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/i18n/zh_CN.po b/product_variant_sale_price/i18n/zh_CN.po new file mode 100644 index 000000000..884493965 --- /dev/null +++ b/product_variant_sale_price/i18n/zh_CN.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sale_price +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-19 06:41+0000\n" +"PO-Revision-Date: 2017-08-19 06:41+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\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.fields,field_description:product_variant_sale_price.field_product_product__list_price +msgid "List 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 "产品模板" + +#. module: product_variant_sale_price +#: model:ir.model.fields,field_description:product_variant_sale_price.field_product_product__lst_price +msgid "Sale Price" +msgstr "" + +#. module: product_variant_sale_price +#: model:ir.model.fields,help:product_variant_sale_price.field_product_product__lst_price +msgid "" +"The sale price is managed from the product template. Click on the 'Configure " +"Variants' button to set the extra attribute prices." +msgstr "" diff --git a/product_variant_sale_price/models/__init__.py b/product_variant_sale_price/models/__init__.py new file mode 100644 index 000000000..71ef05a38 --- /dev/null +++ b/product_variant_sale_price/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2016 Sergio Teruel +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import product_product diff --git a/product_variant_sale_price/models/product_product.py b/product_variant_sale_price/models/product_product.py new file mode 100644 index 000000000..4fc05544b --- /dev/null +++ b/product_variant_sale_price/models/product_product.py @@ -0,0 +1,80 @@ +# Copyright 2016 Sergio Teruel +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import api, fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + def _update_fix_price(self, vals): + if "list_price" in vals: + self.mapped("product_variant_ids").write({"fix_price": vals["list_price"]}) + + @api.model + def create(self, vals): + product_tmpl = super().create(vals) + product_tmpl._update_fix_price(vals) + return product_tmpl + + def write(self, vals): + res = super().write(vals) + if self.env.context.get("skip_update_fix_price", False): + return res + for template in self: + template._update_fix_price(vals) + return res + + +class ProductProduct(models.Model): + _inherit = "product.product" + + @api.depends("fix_price") + def _compute_lst_price(self): + uom_model = self.env["uom.uom"] + for product in self: + price = product.fix_price or product.list_price + if self.env.context.get("uom"): + context_uom = uom_model.browse(self.env.context.get("uom")) + price = product.uom_id._compute_price(price, context_uom) + product.lst_price = price + + def _compute_list_price(self): + uom_model = self.env["uom.uom"] + for product in self: + price = product.fix_price or product.product_tmpl_id.list_price + if self.env.context.get("uom"): + context_uom = uom_model.browse(self.env.context.get("uom")) + price = product.uom_id._compute_price(price, context_uom) + product.list_price = price + + def _inverse_product_lst_price(self): + uom_model = self.env["uom.uom"] + for product in self: + vals = {} + if "uom" in self.env.context: + vals["fix_price"] = product.uom_id._compute_price( + product.lst_price, uom_model.browse(self.env.context["uom"]) + ) + else: + vals["fix_price"] = product.lst_price + if product.product_variant_count == 1: + product.product_tmpl_id.list_price = vals["fix_price"] + else: + fix_prices = product.product_tmpl_id.mapped( + "product_variant_ids.fix_price" + ) + # for consistency with price shown in the shop + product.product_tmpl_id.with_context( + skip_update_fix_price=True + ).list_price = min(fix_prices) + product.write(vals) + + lst_price = fields.Float( + compute="_compute_lst_price", + inverse="_inverse_product_lst_price", + ) + list_price = fields.Float( + compute="_compute_list_price", + ) + fix_price = fields.Float() diff --git a/product_variant_sale_price/readme/CONTRIBUTORS.rst b/product_variant_sale_price/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..242403047 --- /dev/null +++ b/product_variant_sale_price/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Carlos Dauden +* Sergio Teruel +* Alex Comba +* Fabien Bourgeois +* Vicent Cubells diff --git a/product_variant_sale_price/readme/DESCRIPTION.rst b/product_variant_sale_price/readme/DESCRIPTION.rst new file mode 100644 index 000000000..a657faaf0 --- /dev/null +++ b/product_variant_sale_price/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +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. diff --git a/product_variant_sale_price/static/description/icon.png b/product_variant_sale_price/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/product_variant_sale_price/static/description/icon.png differ diff --git a/product_variant_sale_price/static/description/index.html b/product_variant_sale_price/static/description/index.html new file mode 100644 index 000000000..377e07e00 --- /dev/null +++ b/product_variant_sale_price/static/description/index.html @@ -0,0 +1,427 @@ + + + + + + +Product Variant Sale Price + + + +
+

Product Variant Sale Price

+ + +

Beta License: AGPL-3 OCA/product-variant Translate me on Weblate Try me on Runbot

+

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

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/product_variant_sale_price/tests/__init__.py b/product_variant_sale_price/tests/__init__.py new file mode 100644 index 000000000..c206e639d --- /dev/null +++ b/product_variant_sale_price/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2016 Sergio Teruel +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_product_product diff --git a/product_variant_sale_price/tests/test_product_product.py b/product_variant_sale_price/tests/test_product_product.py new file mode 100644 index 000000000..dfd71ea7a --- /dev/null +++ b/product_variant_sale_price/tests/test_product_product.py @@ -0,0 +1,131 @@ +# Copyright 2016 Sergio Teruel +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo.tests.common import TransactionCase + + +class TestProductVariantPrice(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.template = cls.env["product.template"] + cls.product_product = cls.env["product.product"] + cls.attribute = cls.env["product.attribute"] + cls.attribute_value = cls.env["product.attribute.value"] + + cls.att_color = cls.attribute.create({"name": "color_test"}) + + cls.att_color_blue = cls.attribute_value.create( + {"name": "Blue", "attribute_id": cls.att_color.id} + ) + cls.att_color_red = cls.attribute_value.create( + {"name": "Red", "attribute_id": cls.att_color.id} + ) + + cls.uom_unit = cls.env.ref("uom.product_uom_unit") + cls.uom_dozen = cls.env.ref("uom.product_uom_dozen") + + cls.product_template = cls.template.create( + { + "name": "Product Template", + "list_price": 1500.00, + "attribute_line_ids": [ + ( + 0, + 0, + { + "attribute_id": cls.att_color.id, + "value_ids": [ + (6, 0, (cls.att_color_blue + cls.att_color_red).ids) + ], + }, + ) + ], + "uom_id": cls.uom_unit.id, + } + ) + + cls.product_blue = cls.product_template.product_variant_ids.filtered( + lambda x: x.product_template_attribute_value_ids.product_attribute_value_id + == cls.att_color_blue + ) + cls.product_red = cls.product_template.product_variant_ids.filtered( + lambda x: x.product_template_attribute_value_ids.product_attribute_value_id + == cls.att_color_red + ) + + def test_post_init_hook(self): + from ..hooks import set_sale_price_on_variant + + self.product_template.product_variant_ids.write({"fix_price": 0.0}) + # Take account price extra + self.product_blue.product_template_attribute_value_ids.write( + {"price_extra": 100.00} + ) + self.product_red.product_template_attribute_value_ids.write( + {"price_extra": 200.00} + ) + + # Flush the records to DB before direct SQL + self.product_blue.flush() + self.product_red.flush() + + set_sale_price_on_variant(self.cr, None, self.product_template.id) + self.product_template.product_variant_ids.invalidate_cache() + self.assertEqual( + self.product_template.list_price + 100.00, self.product_blue.lst_price + ) + self.assertEqual( + self.product_template.list_price + 200.00, self.product_red.lst_price + ) + + def test_create_product_template(self): + self.assertEqual( + self.product_template.list_price, + self.product_template.product_variant_ids[:1].lst_price, + ) + + def test_create_product_template_different_uom(self): + new_template = self.product_template.with_context(uom=self.uom_dozen.id).copy( + {"uom_id": self.uom_dozen.id} + ) + self.assertEqual( + new_template.list_price, new_template.product_variant_ids[:1].lst_price + ) + + def test_create_variant(self): + new_variant = self.product_product.create( + {"product_tmpl_id": self.product_template.id} + ) + self.assertEqual(self.product_template.list_price, new_variant.lst_price) + + def test_create_variant_different_uom(self): + new_variant = self.product_product.with_context(uom=self.uom_dozen.id).create( + {"product_tmpl_id": self.product_template.id, "uom_id": self.uom_dozen.id} + ) + self.assertEqual(self.product_template.list_price, new_variant.lst_price) + + def test_update_variant(self): + self.product_blue.lst_price = 2000.00 + self.assertNotEqual( + self.product_blue.lst_price, self.product_blue.product_tmpl_id.list_price + ) + self.assertEqual(self.product_blue.lst_price, self.product_blue.fix_price) + # to check skip_update_fix_price + self.assertNotEqual(self.product_blue.lst_price, self.product_red.lst_price) + self.assertEqual(self.product_red.lst_price, 1500.00) + + def test_update_variant_different_uom(self): + self.product_blue.write({"uom_id": self.uom_dozen}) + self.product_blue.with_context(uom=self.uom_dozen.id).lst_price = 2000.00 + self.assertEqual(self.product_blue.lst_price, self.product_blue.fix_price) + + def test_update_variant_no_multiple(self): + self.product_red.unlink() + self.product_blue.lst_price = 2000.00 + self.assertEqual(self.product_blue.lst_price, self.product_blue.fix_price) + + def test_update_template_variant(self): + self.product_blue.product_tmpl_id.list_price = 200 + for variant in self.product_blue.product_tmpl_id.product_variant_ids: + self.assertEqual(self.product_blue.list_price, variant.lst_price) diff --git a/product_variant_sale_price/views/product_views.xml b/product_variant_sale_price/views/product_views.xml new file mode 100644 index 000000000..a894b2c5b --- /dev/null +++ b/product_variant_sale_price/views/product_views.xml @@ -0,0 +1,58 @@ + + + + product.template.form.inherited + product.template + + + + {'invisible': [ + ('product_variant_count', '>', 1) + ]} + + + + + product.template.only.form.inherited + product.template + + + + {'invisible': [ + ('product_variant_count', '>', 1) + ]} + + + {'invisible': [ + ('product_variant_count', '>', 1) + ]} + + + + + product.product + + + + + + + + + product.product + + + + + + + + diff --git a/setup/product_variant_sale_price/odoo/addons/product_variant_sale_price b/setup/product_variant_sale_price/odoo/addons/product_variant_sale_price new file mode 120000 index 000000000..0d9d066df --- /dev/null +++ b/setup/product_variant_sale_price/odoo/addons/product_variant_sale_price @@ -0,0 +1 @@ +../../../../product_variant_sale_price \ No newline at end of file diff --git a/setup/product_variant_sale_price/setup.py b/setup/product_variant_sale_price/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/product_variant_sale_price/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)