forked from OCA/product-variant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #311 from OCA/17.0
Syncing from upstream OCA/product-variant (17.0)
- Loading branch information
Showing
44 changed files
with
2,692 additions
and
1 deletion.
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
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,89 @@ | ||
========================== | ||
Product Variant Sale Price | ||
========================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:226296e068442b8d453ca8956b4985e42cc507eae427e04d125ec105a89517ee | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/17.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-17-0/product-variant-17-0-product_variant_sale_price | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-variant&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|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. | ||
|
||
It replaces the extra price configuration with a fix price that can be | ||
modified on each variant independently, which allows setting absolute | ||
prices instead of relative ones. | ||
|
||
**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 to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/product-variant/issues/new?body=module:%20product_variant_sale_price%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Tecnativa | ||
|
||
Contributors | ||
------------ | ||
|
||
- Carlos Dauden <[email protected]> | ||
- Sergio Teruel <[email protected]> | ||
- Alex Comba <[email protected]> | ||
- Fabien Bourgeois <[email protected]> | ||
- Vicent Cubells <[email protected]> | ||
- RabbitJon-S73 <[email protected]> | ||
- Emanuel Cino <[email protected]> | ||
- Pedroguirao <[email protected]> | ||
|
||
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/17.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 <[email protected]> | ||
# 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,17 @@ | ||
# Copyright 2016 Sergio Teruel <[email protected]> | ||
# Copyright 2018 Fabien Bourgeois <[email protected]> | ||
# 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": "17.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", | ||
} |
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,24 @@ | ||
# Copyright 2016 Sergio Teruel <[email protected]> | ||
# Copyright 2018 Fabien Bourgeois <[email protected]> | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
def set_sale_price_on_variant(env, 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" | ||
env.cr.execute(sql, (template_id,)) | ||
else: | ||
env.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,68 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# Carles Antoli <[email protected]>, 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 <[email protected]>\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_terms:ir.ui.view,arch_db:product_variant_sale_price.product_template_form_view | ||
msgid "" | ||
"<span class=\"text-muted fst-italic\">Setting the price here will update all " | ||
"variants.</span>" | ||
msgstr "" | ||
|
||
#. 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_template | ||
msgid "Product" | ||
msgstr "Producte" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product Variant" | ||
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 "" | ||
"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." | ||
|
||
#~ msgid "Product Template" | ||
#~ msgstr "Plantilla del producte" | ||
|
||
#~ msgid "Sale Price" | ||
#~ msgstr "Preu de venta" |
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,62 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# OCA Transbot <[email protected]>, 2016 | ||
# Niki Waibel <[email protected]>, 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 <[email protected]>, 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_terms:ir.ui.view,arch_db:product_variant_sale_price.product_template_form_view | ||
msgid "" | ||
"<span class=\"text-muted fst-italic\">Setting the price here will update all " | ||
"variants.</span>" | ||
msgstr "" | ||
|
||
#. 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_template | ||
msgid "Product" | ||
msgstr "Produkt" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product Variant" | ||
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 "" | ||
|
||
#~ 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,59 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_variant_sale_price | ||
# | ||
# Translators: | ||
# OCA Transbot <[email protected]>, 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 <[email protected]>, 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_terms:ir.ui.view,arch_db:product_variant_sale_price.product_template_form_view | ||
msgid "" | ||
"<span class=\"text-muted fst-italic\">Setting the price here will update all " | ||
"variants.</span>" | ||
msgstr "" | ||
|
||
#. 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_template | ||
msgid "Product" | ||
msgstr "Προϊόν" | ||
|
||
#. module: product_variant_sale_price | ||
#: model:ir.model,name:product_variant_sale_price.model_product_product | ||
msgid "Product Variant" | ||
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 "" |
Oops, something went wrong.