Skip to content

Commit

Permalink
Add pos_product_pricelist_alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
santostelmo committed Jan 28, 2025
1 parent 6f40e7a commit 2154151
Show file tree
Hide file tree
Showing 11 changed files with 601 additions and 0 deletions.
74 changes: 74 additions & 0 deletions pos_product_pricelist_alternative/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
=================================
POS Product Pricelist Alternative
=================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fpos_product_pricelist_alternative-lightgray.png?logo=github
:target: https://github.com/OCA/pos_product_pricelist_alternative/tree/16.0/pos_product_pricelist_alternative
:alt: OCA/pos_product_pricelist_alternative
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos_product_pricelist_alternative-16-0/pos_product_pricelist_alternative-16-0-pos_product_pricelist_alternative
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/pos_product_pricelist_alternative&target_branch=16.0
:alt: Try me on Runboat

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

POS product pricelist alternative is based on the same logic of `OCA/product_pricelist_alternative: <https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_alternative>` which allows you to define alternative price lists to a reference price list.
As a general rule, the price of a given product is obtained from the minimum between its reference price list and the alternative price lists.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos_product_pricelist_alternative/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos_product_pricelist_alternative/issues/new?body=module:%20pos_product_pricelist_alternative%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
~~~~~~~

* Camptocamp

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

* Telmo Santos <telmo.santos@camptocamp.com>

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/pos_product_pricelist_alternative <https://github.com/OCA/pos_product_pricelist_alternative/tree/16.0/pos_product_pricelist_alternative>`_ 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 pos_product_pricelist_alternative/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions pos_product_pricelist_alternative/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "POS Product Pricelist Alternative",
"summary": "Calculate POS product price based on alternative pricelists",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"category": "Point of Sale",
"author": "Camptocamp, Odoo Community Association (OCA)",
"depends": [
"product_pricelist_alternative",
"point_of_sale",
],
"assets": {
"point_of_sale.assets": [
"pos_product_pricelist_alternative/static/src/**/*.js",
],
},
"website": "https://github.com/OCA/pos",
"installable": True,
"auto_install": False,
}
1 change: 1 addition & 0 deletions pos_product_pricelist_alternative/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import pos_session
18 changes: 18 additions & 0 deletions pos_product_pricelist_alternative/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class PosSession(models.Model):
_inherit = "pos.session"

def _loader_params_product_pricelist(self):
result = super()._loader_params_product_pricelist()
result["search_params"]["fields"].extend(["alternative_pricelist_ids"])
return result

Check warning on line 13 in pos_product_pricelist_alternative/models/pos_session.py

View check run for this annotation

Codecov / codecov/patch

pos_product_pricelist_alternative/models/pos_session.py#L11-L13

Added lines #L11 - L13 were not covered by tests

def _product_pricelist_item_fields(self):
result = super()._product_pricelist_item_fields()
result.extend(["alternative_pricelist_policy"])
return result

Check warning on line 18 in pos_product_pricelist_alternative/models/pos_session.py

View check run for this annotation

Codecov / codecov/patch

pos_product_pricelist_alternative/models/pos_session.py#L16-L18

Added lines #L16 - L18 were not covered by tests
1 change: 1 addition & 0 deletions pos_product_pricelist_alternative/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Telmo Santos <telmo.santos@camptocamp.com>
2 changes: 2 additions & 0 deletions pos_product_pricelist_alternative/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POS product pricelist alternative is based on the same logic of `OCA/product_pricelist_alternative: <https://github.com/OCA/product-attribute/tree/16.0/product_pricelist_alternative>` which allows you to define alternative price lists to a reference price list.
As a general rule, the price of a given product is obtained from the minimum between its reference price list and the alternative price lists.
Loading

0 comments on commit 2154151

Please sign in to comment.