Skip to content

Commit

Permalink
Merge commit 'refs/pull/156/head' of https://github.com/oca/product-pack
Browse files Browse the repository at this point in the history
 into 17.0-6794
  • Loading branch information
docker-odoo committed Apr 29, 2024
2 parents 97b724a + 65465c4 commit 4fd40cf
Show file tree
Hide file tree
Showing 28 changed files with 2,646 additions and 0 deletions.
131 changes: 131 additions & 0 deletions sale_product_pack/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
=================
Sale Product Pack
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ef6b1970eeb7ec721ff9dc1a25df8405f64d7b864febeeb4146a4aa13d0855f4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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--pack-lightgray.png?logo=github
:target: https://github.com/OCA/product-pack/tree/17.0/sale_product_pack
:alt: OCA/product-pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-pack-17-0/product-pack-17-0-sale_product_pack
: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-pack&target_branch=17.0
:alt: Try me on Runboat

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

This module adds *Product Pack* functionality to sales orders. You can
choose a *Pack* in *sales order lines* and see different behaviors
depending on "Pack type" and "Pack component price" fields options
selected on this *Pack*.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Go to *Sales > Products > Products*, create or select a product and
check *Is Pack?*
2. Set "Product type" and "Pack component price" fields in the *Pack*
page.
3. Add the products to be included in it.
4. Go to *Sales > Orders > Quotations* and create a Quotation.
5. Add a product that has checked "Is Pack?"
6. Save data and you will see an specific behavior depending on "Pack
type" and "Pack component price" fields options selected on this
*Pack*. For example, for products that has *Detailed* option selected
in "Pack type" field you will see one *sale order line* per component
that belong to this Pack. (See *Product pack* module README.rst file)

Known issues / Roadmap
======================

- If this module is installed and stock module is installed too, when
you create a Sale order for a *Non detailed* Pack and you confirm it,
a *Stock picking* is not created with the storable components of that
Pack. So, add a new module called *sale_stock_product_pack* that adds
that feature.

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

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

* NaN·tic
* ADHOC SA
* Tecnativa

Contributors
------------

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

- Ernesto Tejeda
- Pedro M. Baeza

- `Akretion <https://akretion.com>`__:

- Raphaël Reverdy

- `Open Source Integrators <https://opensourceintegrators.eu>`__:

- Daniel Reis <dreis@opensourceintegrators.com>

- `Acsone <https://www.acsone.eu/>`__:

- Maxime Franco

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-ernestotejeda| image:: https://github.com/ernestotejeda.png?size=40px
:target: https://github.com/ernestotejeda
:alt: ernestotejeda

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

|maintainer-ernestotejeda|

This module is part of the `OCA/product-pack <https://github.com/OCA/product-pack/tree/17.0/sale_product_pack>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_product_pack/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
19 changes: 19 additions & 0 deletions sale_product_pack/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2019 NaN (http://www.nan-tic.com) - Àngel Àlvarez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale Product Pack",
"version": "17.0.1.0.0",
"category": "Sales",
"summary": "This module allows you to sell product packs",
"website": "https://github.com/OCA/product-pack",
"author": "NaN·tic, ADHOC SA, Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
"depends": ["product_pack", "sale"],
"data": ["security/ir.model.access.csv", "views/product_pack_line_views.xml"],
"demo": [
"demo/product_pack_line_demo.xml",
"demo/sale_pack_demo.xml",
],
"installable": True,
}
23 changes: 23 additions & 0 deletions sale_product_pack/demo/product_pack_line_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Tecnativa - Ernesto Tejeda
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="product_pack.pack_cpu_detailed_components_1" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
<record id="product_pack.pack_cpu_detailed_components_3" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
<record id="product_pack.pack_cpu_detailed_totalized_1" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
<record id="product_pack.pack_cpu_detailed_totalized_3" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
<record id="product_pack.pack_cpu_non_detailed_1" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
<record id="product_pack.pack_cpu_non_detailed_3" model="product.pack.line">
<field name="sale_discount" eval="10.0" />
</record>
</odoo>
108 changes: 108 additions & 0 deletions sale_product_pack/demo/sale_pack_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<!-- Sale order -->
<record id="portal_sale_order_3" model="sale.order">
<field name="partner_id" ref="base.partner_demo_portal" />
<field name="partner_invoice_id" ref="base.partner_demo_portal" />
<field name="partner_shipping_id" ref="base.partner_demo_portal" />
<field name="user_id" ref="base.user_admin" />
<field name="payment_term_id" ref="account.account_payment_term_30days" />
<field name="team_id" ref="sales_team.team_sales_department" />
<field
name="date_order"
eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"
/>
<field
name="message_partner_ids"
eval="[(4, ref('base.partner_demo_portal'))]"
/>
</record>

<!-- Sale order lines -->
<!-- Product pack: DETAILED - COMPONENTS -->
<record id="portal_sale_order_line_section_1" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="name">Detailed Displayed Components Price</field>
<field name="display_type">line_section</field>
<field name="sequence">1</field>
</record>
<record id="portal_sale_order_line_6" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field
name="product_id"
ref="product_pack.product_pack_cpu_detailed_components"
/>
<field name="sequence">2</field>
</record>
<!-- Product pack: DETAILED - TOTALIZED -->
<record id="portal_sale_order_line_section_2" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="name">Detailed Totalized Components Price</field>
<field name="display_type">line_section</field>
<field name="sequence">3</field>
</record>
<record id="portal_sale_order_line_7" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field
name="product_id"
ref="product_pack.product_pack_cpu_detailed_totalized"
/>
<field name="sequence">4</field>
</record>
<!-- Product pack: DETAILED - IGNORED -->
<record id="portal_sale_order_line_section_3" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="name">Detailed Ignored Components Price</field>
<field name="display_type">line_section</field>
<field name="sequence">5</field>
</record>
<record id="portal_sale_order_line_8" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="product_id" ref="product_pack.product_pack_cpu_detailed_ignored" />
<field name="sequence">6</field>
</record>
<!-- Product pack: NON DETAILED -->
<record id="portal_sale_order_line_section_4" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="name">Not Detailed - Totalized Components Price</field>
<field name="display_type">line_section</field>
<field name="sequence">7</field>
</record>
<record id="portal_sale_order_line_9" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="product_id" ref="product_pack.product_pack_cpu_non_detailed" />
<field name="sequence">8</field>
</record>
<!-- Components -->
<record id="portal_sale_order_line_section_5" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="name">COMPONENTS</field>
<field name="display_type">line_section</field>
<field name="sequence">9</field>
</record>
<record id="portal_sale_order_line_components_1" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="product_id" ref="product.product_product_20" />
<field name="sequence">10</field>
</record>

<record id="portal_sale_order_line_components_2" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="product_id" ref="product.product_product_16" />
<field name="sequence">11</field>
</record>

<record id="portal_sale_order_components_3" model="sale.order.line">
<field name="order_id" ref="portal_sale_order_3" />
<field name="product_id" ref="product.product_product_24" />
<field name="sequence">12</field>
</record>

<function
model="sale.order"
name="action_confirm"
eval="[[
ref('portal_sale_order_3'),
]]"
/>
</odoo>

0 comments on commit 4fd40cf

Please sign in to comment.