Skip to content

Commit

Permalink
Merge PR #340 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Apr 24, 2024
2 parents a37b150 + 8c97709 commit 8a98b91
Show file tree
Hide file tree
Showing 25 changed files with 1,154 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def create_variant_if_needed(self):
)
product = product_obj.create(
{
"name": self.product_tmpl_id.name,
"product_tmpl_id": self.product_tmpl_id.id,
"product_template_attribute_value_ids": [
(6, 0, product_template_attribute_values.ids)
Expand Down
87 changes: 87 additions & 0 deletions purchase_variant_configurator/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
===========================
Purchase - Product variants
===========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:89a99189100c0f6e5da2be3373673e5a15850956c822f4a64c7c6b4e9534998b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/purchase_variant_configurator
: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-16-0/product-variant-16-0-purchase_variant_configurator
: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=16.0
:alt: Try me on Runboat

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

This module allows you to create the product variant when a purchase order is
confirmed. It adds to the purchase line a product configurator, so that
selecting a product and its attributes can be created a new product 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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/product-variant/issues/new?body=module:%20purchase_variant_configurator%0Aversion:%2016.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
~~~~~~~

* AvanzOSC
* Tecnativa
* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
* David Díaz <d.diazp@gmail.com>
* Ana Juaristi <ajuaristio@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* David Vidal
* Ernesto Tejeda

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/16.0/purchase_variant_configurator>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions purchase_variant_configurator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import models
from .hooks import assign_product_template
21 changes: 21 additions & 0 deletions purchase_variant_configurator/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2016 Oihane Crucelaegui - AvanzOSC
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2016 ACSONE SA/NV
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Purchase - Product variants",
"summary": "Product variants in purchase management",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"depends": ["purchase", "product_variant_configurator"],
"author": "AvanzOSC, "
"Tecnativa, "
"ACSONE SA/NV, "
"Odoo Community Association (OCA)",
"category": "Purchase Management",
"website": "https://github.com/OCA/product-variant",
"data": ["views/inherited_purchase_order_views.xml"],
"installable": True,
"post_init_hook": "assign_product_template",
}
13 changes: 13 additions & 0 deletions purchase_variant_configurator/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2014-2016 Oihane Crucelaegui - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html


def assign_product_template(cr, registry):
"""This post-init-hook will update all existing purchase.order.line"""
cr.execute(
"""
UPDATE purchase_order_line AS line
SET product_tmpl_id = product_product.product_tmpl_id
FROM product_product
WHERE line.product_id = product_product.id;"""
)
24 changes: 24 additions & 0 deletions purchase_variant_configurator/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-16 02:12+0000\n"
"PO-Revision-Date: 2017-12-16 02:12+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea pedido de compra"
22 changes: 22 additions & 0 deletions purchase_variant_configurator/i18n/es_AR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-04-04 20:46+0000\n"
"Last-Translator: Ignacio Buioli <ibuioli@gmail.com>\n"
"Language-Team: none\n"
"Language: es_AR\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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Línea del Pedido de Compras"
24 changes: 24 additions & 0 deletions purchase_variant_configurator/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_product_variants
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: odoomrp-wip (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-10-07 10:44+0000\n"
"PO-Revision-Date: 2015-09-10 16:31+0000\n"
"Last-Translator: <>\n"
"Language-Team: French (http://www.transifex.com/oca/odoomrp-wip-8-0/language/"
"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"

#. module: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
25 changes: 25 additions & 0 deletions purchase_variant_configurator/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# Bole <bole@dajmi5.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-23 02:10+0000\n"
"PO-Revision-Date: 2018-02-23 02:10+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2018\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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Stavka naloga za nabavu"
25 changes: 25 additions & 0 deletions purchase_variant_configurator/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# Paolo Valier <paolo.valier@hotmail.it>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-30 08:37+0000\n"
"PO-Revision-Date: 2023-01-02 11:50+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\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"
"X-Generator: Weblate 4.14.1\n"

#. module: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Riga ordine di acquisto"
25 changes: 25 additions & 0 deletions purchase_variant_configurator/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-16 02:12+0000\n"
"PO-Revision-Date: 2017-12-16 02:12+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linha pedido de compra"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr ""
25 changes: 25 additions & 0 deletions purchase_variant_configurator/i18n/ro.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-16 02:12+0000\n"
"PO-Revision-Date: 2017-12-16 02:12+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Linie comandă achiziție"
25 changes: 25 additions & 0 deletions purchase_variant_configurator/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_variant_configurator
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-16 02:12+0000\n"
"PO-Revision-Date: 2017-12-16 02:12+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\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: purchase_variant_configurator
#: model:ir.model,name:purchase_variant_configurator.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Postavka nabavnega naloga"
1 change: 1 addition & 0 deletions purchase_variant_configurator/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order_line
11 changes: 11 additions & 0 deletions purchase_variant_configurator/models/purchase_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2016 Oihane Crucelaegui - AvanzOSC
# Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2016 ACSONE SA/NV
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import models


class PurchaseOrderLine(models.Model):
_inherit = ["purchase.order.line", "product.configurator"]
_name = "purchase.order.line"
8 changes: 8 additions & 0 deletions purchase_variant_configurator/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>
* David Díaz <d.diazp@gmail.com>
* Ana Juaristi <ajuaristio@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Pedro M. Baeza
* David Vidal
* Ernesto Tejeda
3 changes: 3 additions & 0 deletions purchase_variant_configurator/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module allows you to create the product variant when a purchase order is
confirmed. It adds to the purchase line a product configurator, so that
selecting a product and its attributes can be created a new product variant.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8a98b91

Please sign in to comment.