Skip to content

Commit

Permalink
[ADD] product_list_price_from_pricelist: Automatically compute produc…
Browse files Browse the repository at this point in the history
…t list prices based on a pricelist.
  • Loading branch information
carlos-lopez-tecnativa committed Jan 22, 2025
1 parent 7cbaea7 commit d4ef689
Show file tree
Hide file tree
Showing 20 changed files with 1,410 additions and 0 deletions.
115 changes: 115 additions & 0 deletions product_list_price_from_pricelist/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
============================================
Compute product sales price from a pricelist
============================================

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

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

This module enables the automatic computation of a product's sale price based on the configuration of a pricelist.

**Table of contents**

.. contents::
:local:

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

- Go to `Sales` -> `Products` -> `Pricelists`.
- Create a new pricelist and add at least one rule.
- Specify the product template or category for the rule.
- Set the `computation mode` and save

**Note**: Ensure the minimum quantity is not great than 1 for the rule to apply effectively.

- Go to `Sales` -> `Configuration` -> `Settings`.
- In the `Pricing` section, select the `Pricelist to compute sale price` created in the previous step.
- Save the configuration

Usage
=====

**To update product prices according to the pricelist rules**

- Stay in the settings configuration with the selected Pricelist.
- Click the **Update Product Prices** button to apply the rules and update the sale prices of all products.

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

The `list_price` field is not `company-dependent`, meaning that if a product is shared across multiple companies, the same list price will apply to all of them.
To minimize errors, you can set a primary company to take precedence. This can be configured in the settings under the field `Main company for computing sale price`.

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

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

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`_

* Pedro M. Baeza
* Carlos López

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

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

|maintainer-carlos-lopez-tecnativa|

This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/16.0/product_list_price_from_pricelist>`_ 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 product_list_price_from_pricelist/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions product_list_price_from_pricelist/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Compute product sales price from a pricelist",
"version": "16.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/product-attribute",
"depends": [
"sale",
],
"data": ["views/res_config_settings_views.xml"],
"maintainers": ["carlos-lopez-tecnativa"],
"installable": True,
"auto_install": False,
"license": "AGPL-3",
}
97 changes: 97 additions & 0 deletions product_list_price_from_pricelist/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_list_price_from_pricelist
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-21 15:27+0000\n"
"PO-Revision-Date: 2025-01-21 10:34-0500\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.5\n"

#. module: product_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid "Are you sure you want to update the prices for all products?. This operations cannot be undone."
msgstr ""
"¿Estás seguro de actualizar el precio de venta en todos los productos?. Esta operación no puede "
"revertirse."

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_res_company
msgid "Companies"
msgstr "Compañías"

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_res_config_settings
msgid "Config Settings"
msgstr "Ajustes de configuración"

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_product_pricelist
msgid "Pricelist"
msgstr "Lista de precios"

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr "Regla de la lista de precios"

#. module: product_list_price_from_pricelist
#: model:ir.model.fields,field_description:product_list_price_from_pricelist.field_res_company__base_pricelist_compute_price_id
#: model:ir.model.fields,field_description:product_list_price_from_pricelist.field_res_config_settings__base_pricelist_compute_price_id
msgid "Pricelist to compute sale price"
msgstr "Lista de precio para calcular precio de venta"

#. module: product_list_price_from_pricelist
#: model:ir.model.fields,help:product_list_price_from_pricelist.field_res_company__base_pricelist_compute_price_id
#: model:ir.model.fields,help:product_list_price_from_pricelist.field_res_config_settings__base_pricelist_compute_price_id
msgid "Pricelist used to calculate the price of all products"
msgstr "Lista de precio usada para calcular el precio de venta de todos los productos"

#. module: product_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid ""
"Set the base pricelist to compute the sale price for all products.\n"
" <br/>\n"
" Note: Pricelist items cannot have a minimum quantity set.\n"
" The price will be updated for all products, calculated with a quantity of 1."
msgstr ""
"Configure la lista de precios base, para calcular el precio de venta para todos los productos.\n"
" <br/>\n"
" Nota: Las reglas de precio no deben tener una cantidad mínima configurada.\n"
" El precio sera actualizado en todos los productos calculados con cantidad 1."

#. module: product_list_price_from_pricelist
#. odoo-python
#: code:addons/product_list_price_from_pricelist/models/product_pricelist.py:0
#, python-format
msgid ""
"The pricelist is used as base pricelist to compute product prices. Its should not have items with "
"minimum quantity, please check the pricelist %(pricelist)s with item %(name)s."
msgstr ""
"La lista de precios es usada como base para calcular precios de venta de los productos. Ésta no debe "
"tener reglas con cantidad mínima, por favor revise la lista de precios: %(pricelist)s con la regla: "
"%(name)s."

#. module: product_list_price_from_pricelist
#. odoo-python
#: code:addons/product_list_price_from_pricelist/models/res_company.py:0
#, python-format
msgid ""
"The pricelist should not have items with minimum quantity, please check the pricelist %(pricelist)s."
msgstr ""
"La lista de precios no debe tener reglas con cantidad mínima, por favor verifique la lista de precios: "
"%(pricelist)s."

#. module: product_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid "Update product prices"
msgstr "Actualizar precio de venta en productos"
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_list_price_from_pricelist
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-21 15:27+0000\n"
"PO-Revision-Date: 2025-01-21 15:27+0000\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_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid ""
"Are you sure you want to update the prices for all products?. This "
"operations cannot be undone."
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_res_company
msgid "Companies"
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_product_pricelist
msgid "Pricelist"
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model,name:product_list_price_from_pricelist.model_product_pricelist_item
msgid "Pricelist Rule"
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model.fields,field_description:product_list_price_from_pricelist.field_res_company__base_pricelist_compute_price_id
#: model:ir.model.fields,field_description:product_list_price_from_pricelist.field_res_config_settings__base_pricelist_compute_price_id
msgid "Pricelist to compute sale price"
msgstr ""

#. module: product_list_price_from_pricelist
#: model:ir.model.fields,help:product_list_price_from_pricelist.field_res_company__base_pricelist_compute_price_id
#: model:ir.model.fields,help:product_list_price_from_pricelist.field_res_config_settings__base_pricelist_compute_price_id
msgid "Pricelist used to calculate the price of all products"
msgstr ""

#. module: product_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid ""
"Set the base pricelist to compute the sale price for all products.\n"
" <br/>\n"
" Note: Pricelist items cannot have a minimum quantity set.\n"
" The price will be updated for all products, calculated with a quantity of 1."
msgstr ""

#. module: product_list_price_from_pricelist
#. odoo-python
#: code:addons/product_list_price_from_pricelist/models/product_pricelist.py:0
#, python-format
msgid ""
"The pricelist is used as base pricelist to compute product prices. Its "
"should not have items with minimum quantity, please check the pricelist "
"%(pricelist)s with item %(name)s."
msgstr ""

#. module: product_list_price_from_pricelist
#. odoo-python
#: code:addons/product_list_price_from_pricelist/models/res_company.py:0
#, python-format
msgid ""
"The pricelist should not have items with minimum quantity, please check the "
"pricelist %(pricelist)s."
msgstr ""

#. module: product_list_price_from_pricelist
#: model_terms:ir.ui.view,arch_db:product_list_price_from_pricelist.view_res_config_settings_form
msgid "Update product prices"
msgstr ""
3 changes: 3 additions & 0 deletions product_list_price_from_pricelist/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import res_company
from . import res_config_settings
from . import product_pricelist
Loading

0 comments on commit d4ef689

Please sign in to comment.