Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions sale_attached_product/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========================
Attached products in sales
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9316cb7862a90982b04e6faac0d3a0b2cd682291e5ded41e5f420d58ccbf72ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/17.0/sale_attached_product
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_attached_product
: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/sale-workflow&target_branch=17.0
:alt: Try me on Runboat

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

This module allows to define a set of products which will be added
automatically to the sales order whenever that product is present on it.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure attached products:

1. Go to *Sales > Products > Products* and choose on you want to attach
products to.
2. Go to the *Sales* tab and then to the *Attached products* section.
3. Add as many products as you want to.

If you want to autoupdate the products when they are added, set this
config parameter:

- sale_attached_product.auto_update_attached_lines

Otherwise, the lines will be added, but they can be modified, deleted,
etc.

Usage
=====

Now that you have your product configured:

1. Place a new sale order and then add that product in a new line.
2. Once you save your order, the attached products will be added in new
lines to the order with as many quantities as the main one.

If the global sale_attached_product.auto_update_attached_lines setting
is on:

1. Update the main product quantity and the attached product quantities
will be updated in the same amount as well.
2. If we delete the main line, the attached ones will go away in any
case.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_attached_product%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
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- David Vidal

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.

.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
:target: https://github.com/chienandalu
:alt: chienandalu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-chienandalu|

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_attached_product>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_attached_product/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions sale_attached_product/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Attached products in sales",
"summary": "Define products that will be added automatically when adding another "
"in a sales order",
"version": "18.0.1.0.0",
"development_status": "Beta",
"category": "Sale",
"website": "https://github.com/OCA/sale-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["chienandalu"],
"license": "AGPL-3",
"depends": ["sale"],
"data": ["views/product_template_views.xml"],
}
78 changes: 78 additions & 0 deletions sale_attached_product/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_attached_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-08-07 12:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\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"
"X-Generator: Weblate 4.17\n"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_from_line_id
msgid "Attached From Line"
msgstr "Adjunto desde la línea"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_line_ids
msgid "Attached Line"
msgstr "Línea adjunta"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,field_description:sale_attached_product.field_product_template__attached_product_ids
#: model_terms:ir.ui.view,arch_db:sale_attached_product.product_template_form_view
msgid "Attached Products"
msgstr "Productos adjuntos"

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Flag products that are attached to their main counterpart"
msgstr "Marcar productos que están unidos a su contraparte principal"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Is Attached Line"
msgstr "es línea adjunta"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_attached_product_mixin
msgid "Mixin class for sale attached product features"
msgstr "Clase Mixta para la venta de productos adjuntos"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_product_template
msgid "Product"
msgstr ""

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order
msgid "Sales Order"
msgstr "Órdenes de venta"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de Orden de Venta"

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,help:sale_attached_product.field_product_template__attached_product_ids
msgid ""
"Similar to optional products, although they're added automatically to "
"thesale order and optionally removed when the main product goes away."
msgstr ""
"Similares a los productos opcionales, aunque se añaden automáticamente al "
"pedido de venta y se eliminan opcionalmente cuando desaparece el producto "
"principal."

#~ msgid "Product Template"
#~ msgstr "Plantilla del Producto"
76 changes: 76 additions & 0 deletions sale_attached_product/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_attached_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-14 17:42+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\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.17\n"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_from_line_id
msgid "Attached From Line"
msgstr "Allegato dalla riga"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_line_ids
msgid "Attached Line"
msgstr "Riga allegata"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,field_description:sale_attached_product.field_product_template__attached_product_ids
#: model_terms:ir.ui.view,arch_db:sale_attached_product.product_template_form_view
msgid "Attached Products"
msgstr "Prodotti allegati"

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Flag products that are attached to their main counterpart"
msgstr ""
"Prodotti di riferimento che sono allegati alle loro controparti principali"

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Is Attached Line"
msgstr "È una riga allegata"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_attached_product_mixin
msgid "Mixin class for sale attached product features"
msgstr "Classe mixin per caratteristiche prodotto allegato alla vendita"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_product_template
msgid "Product"
msgstr "Prodotto"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,help:sale_attached_product.field_product_template__attached_product_ids
msgid ""
"Similar to optional products, although they're added automatically to "
"thesale order and optionally removed when the main product goes away."
msgstr ""
"Simile ai prodotti opzionali, sebbene vengano aggiunti automaticamente "
"all'ordine di vendita e rimossi opzionalmente quando il prodotto principale "
"va via."
69 changes: 69 additions & 0 deletions sale_attached_product/i18n/sale_attached_product.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_attached_product
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.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: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_from_line_id
msgid "Attached From Line"
msgstr ""

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__attached_line_ids
msgid "Attached Line"
msgstr ""

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,field_description:sale_attached_product.field_product_template__attached_product_ids
#: model_terms:ir.ui.view,arch_db:sale_attached_product.product_template_form_view
msgid "Attached Products"
msgstr ""

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Flag products that are attached to their main counterpart"
msgstr ""

#. module: sale_attached_product
#: model:ir.model.fields,field_description:sale_attached_product.field_sale_order_line__is_attached_line
msgid "Is Attached Line"
msgstr ""

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_attached_product_mixin
msgid "Mixin class for sale attached product features"
msgstr ""

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_product_template
msgid "Product"
msgstr ""

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_attached_product
#: model:ir.model,name:sale_attached_product.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_attached_product
#: model:ir.model.fields,help:sale_attached_product.field_product_product__attached_product_ids
#: model:ir.model.fields,help:sale_attached_product.field_product_template__attached_product_ids
msgid ""
"Similar to optional products, although they're added automatically to "
"thesale order and optionally removed when the main product goes away."
msgstr ""
3 changes: 3 additions & 0 deletions sale_attached_product/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import product_template
from . import sale_attached_product_mixin
from . import sale_order
15 changes: 15 additions & 0 deletions sale_attached_product/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

attached_product_ids = fields.Many2many(
comodel_name="product.product",
relation="product_attached_rel",
string="Attached Products",
help="Similar to optional products, although they're added automatically to the"
"sale order and optionally removed when the main product goes away.",
)
Loading