-
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.
Add shopinvader_sale_packaging_wishlist
- Loading branch information
Showing
14 changed files
with
739 additions
and
31 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,66 @@ | ||
==================== | ||
Shopinvader Wishlist | ||
==================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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%2Fodoo--shopinvader-lightgray.png?logo=github | ||
:target: https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_wishlist | ||
:alt: shopinvader/odoo-shopinvader | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
Expose wishlist features for Shopinvader websites. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-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/odoo-shopinvader/issues/new?body=module:%20shopinvader_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]> | ||
* Laurent Mignon <[email protected]> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp | ||
* Cosanum | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_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,20 @@ | ||
# Copyright 2020 Camptocamp (http://www.camptocamp.com). | ||
# @author Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
{ | ||
"name": "Shopinvader Wishlist Packaging", | ||
"summary": """Add packaging information to wishlists""", | ||
"version": "13.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Camptocamp,Odoo Community Association (OCA)", | ||
"website": "https://github.com/shopinvader/odoo-shopinvader", | ||
"depends": [ | ||
"shopinvader_sale_packaging", | ||
"shopinvader_wishlist", | ||
"sale_product_set_packaging_qty", | ||
], | ||
"installable": True, | ||
"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 @@ | ||
Add packaging info to wishlist items. |
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,54 @@ | ||
# 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): | ||
_name = "shopinvader.wishlist.service" | ||
_inherit = [ | ||
"shopinvader.wishlist.service", | ||
"shopinvader.packaging.service.mixin", | ||
] | ||
|
||
def _validator_line_schema(self): | ||
res = super()._validator_line_schema() | ||
res.update(self._validator_packaging_info()) | ||
return res | ||
|
||
def _json_parser_line(self): | ||
return super()._json_parser_line() + self._json_parser_line_packaging() | ||
|
||
def _json_parser_line_packaging(self): | ||
return [ | ||
( | ||
"product_id:packaging_by_qty", | ||
self._json_parser_product_packaging, | ||
), | ||
("product_packaging_id:packaging", ("id", "name")), | ||
"product_packaging_qty:packaging_qty", | ||
] | ||
|
||
def _json_parser_product(self): | ||
return super()._json_parser_product() + [ | ||
"packaging", | ||
"sell_only_by_packaging", | ||
] | ||
|
||
def _json_parser_product_packaging(self, rec, fname): | ||
return self._packaging_info_by_qty(rec.product_id, rec.quantity) | ||
|
||
def _prepare_item(self, record, params): | ||
res = super()._prepare_item(record, params) | ||
pkg_params = self._packaging_values_from_params(params) | ||
if pkg_params: | ||
res.update(pkg_params) | ||
return res | ||
|
||
def _packaging_values_from_params(self, params): | ||
res = super()._packaging_values_from_params(params) | ||
if "product_packaging" in res: | ||
# On sale.order.line they named a m2o field w/out `_id` :/ | ||
res["product_packaging_id"] = res.pop("product_packaging") | ||
return res |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.