-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] shopinvader_customer_price_wishlist: Migration to 14.0
- Loading branch information
1 parent
bd7d8ed
commit cc7aa29
Showing
11 changed files
with
608 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
========================== | ||
Shopinvader Customer Price | ||
========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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-shopinvader%2Fshopinvader-lightgray.png?logo=github | ||
:target: https://github.com/shopinvader/shopinvader/tree/13.0/shopinvader_customer_price_wishlist | ||
:alt: shopinvader/shopinvader | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Glue auto-installable module for `shopinvader_customer_price` and `shopinvader_wishlist`. | ||
|
||
Overrides wishlist items prices with customer specific prices. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/shopinvader/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/shopinvader/shopinvader/issues/new?body=module:%20shopinvader_customer_price_wishlist%0Aversion:%2013.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 | ||
~~~~~~~~~~~~ | ||
|
||
* Simone Orsi <[email protected]> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp | ||
* Cosanum | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `shopinvader/shopinvader <https://github.com/shopinvader/shopinvader/tree/13.0/shopinvader_customer_price_wishlist>`_ project on GitHub. | ||
|
||
You are welcome to contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Shopinvader Customer Price", | ||
"summary": """Expose customer's specific prices.""", | ||
"version": "14.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Camptocamp,Odoo Community Association (OCA)", | ||
"website": "https://github.com/shopinvader/odoo-shopinvader", | ||
"depends": ["shopinvader_customer_price", "shopinvader_wishlist"], | ||
"auto_install": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Simone Orsi <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp | ||
* Cosanum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Glue auto-installable module for `shopinvader_customer_price` and `shopinvader_wishlist`. | ||
|
||
Overrides wishlist items prices with customer specific prices. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import wishlist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2020 Camptocamp (http://www.camptocamp.com). | ||
# @author Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.component.core import Component | ||
|
||
|
||
class WishlistService(Component): | ||
_inherit = "shopinvader.wishlist.service" | ||
|
||
_customer_price_service = None | ||
|
||
@property | ||
def customer_price_service(self): | ||
if self._customer_price_service: | ||
return self._customer_price_service | ||
self._customer_price_service = self.component(usage="customer_price") | ||
return self._customer_price_service | ||
|
||
def _json_parser_product_price(self, rec, fname): | ||
return self.customer_price_service._get_price(rec, fname) | ||
|
||
# TODO: if we had a centralized way to retrieve prices for customers | ||
# we could avoid this module completely. | ||
def _json_parser_product_data(self, rec, fname): | ||
res = super()._json_parser_product_data(rec, fname) | ||
res["price"] = self._json_parser_product_price( | ||
rec.shopinvader_variant_id, fname | ||
) | ||
return res |
Oops, something went wrong.