Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by simahawk
- Loading branch information
Showing
17 changed files
with
796 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,93 @@ | ||
============= | ||
Sale 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-OCA%2Fsale--workflow-lightgray.png?logo=github | ||
:target: https://github.com/OCA/sale-workflow/tree/12.0/sale_wishlist | ||
:alt: OCA/sale-workflow | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_wishlist | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/167/12.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Extends `sale_product_set` features to add a new typology: wishlist. | ||
This module can serve as base to handle multiple wishlists for a customer, | ||
being or not e-commerce related. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
* Define a *product set* as sale manager and select typology "wishlist" | ||
* Assign it to a partner | ||
* On the partner you'll see a smart button that brings you to customer's wishlists | ||
* Once you clicked on it you can create more wishlists for that customer. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/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/sale-workflow/issues/new?body=module:%20sale_wishlist%0Aversion:%2012.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 SA | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Simone Orsi <simone.orsi@camptocamp.com> | ||
|
||
Other credits | ||
~~~~~~~~~~~~~ | ||
|
||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp | ||
* Cosanum | ||
|
||
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/sale-workflow <https://github.com/OCA/sale-workflow/tree/12.0/sale_wishlist>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/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 models |
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,14 @@ | ||
# Copyright 2019 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Sale Wishlist", | ||
"summary": """ | ||
Handle sale wishlist for partners""", | ||
"version": "13.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Camptocamp SA,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/sale-workflow", | ||
"depends": ["sale_product_set"], | ||
"data": ["views/product_set.xml", "views/partner.xml"], | ||
} |
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,58 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * sale_wishlist | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \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: sale_wishlist | ||
#: model:ir.model.fields,field_description:sale_wishlist.field_res_partner__wishlists_count | ||
#: model:ir.model.fields,field_description:sale_wishlist.field_res_users__wishlists_count | ||
msgid "# Wishlists" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: model_terms:ir.ui.view,arch_db:sale_wishlist.res_partner_view_form | ||
msgid "<span class=\"o_stat_text\">Wishlists</span>" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: model:ir.model,name:sale_wishlist.model_res_partner | ||
msgid "Contact" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: selection:product.set,typology:0 | ||
msgid "Default" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: model:ir.model,name:sale_wishlist.model_product_set | ||
msgid "Product set" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: model:ir.model.fields,field_description:sale_wishlist.field_product_set__typology | ||
#: model_terms:ir.ui.view,arch_db:sale_wishlist.view_product_set_search | ||
msgid "Typology" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: selection:product.set,typology:0 | ||
msgid "Wishlist" | ||
msgstr "" | ||
|
||
#. module: sale_wishlist | ||
#: code:addons/sale_wishlist/models/res_partner.py:39 | ||
#, python-format | ||
msgid "Wishlists" | ||
msgstr "" | ||
|
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,2 @@ | ||
from . import product_set | ||
from . import res_partner |
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 2019 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductSet(models.Model): | ||
|
||
_inherit = "product.set" | ||
|
||
typology = fields.Selection( | ||
selection=[("set", "Default"), ("wishlist", "Wishlist")], default="set" | ||
) |
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,43 @@ | ||
# Copyright 2019 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
|
||
_inherit = "res.partner" | ||
|
||
wishlists_count = fields.Integer( | ||
compute="_compute_wishlists_count", string="# Wishlists" | ||
) | ||
|
||
def _compute_wishlists_count(self): | ||
# do just one query for all records | ||
data = self.env["product.set"].read_group( | ||
self._wishlist_domain(), ["partner_id"], ["partner_id"] | ||
) | ||
data_mapped = { | ||
count["partner_id"][0]: count["partner_id_count"] for count in data | ||
} | ||
for rec in self: | ||
rec.wishlists_count = data_mapped.get(rec.id, 0) | ||
|
||
def _wishlist_domain(self): | ||
return [("partner_id", "in", self.ids), ("typology", "=", "wishlist")] | ||
|
||
def action_view_wishlists(self): | ||
self.ensure_one() | ||
action = self.env.ref("sale_product_set.act_open_product_set_view") | ||
res = action.read()[0] | ||
res.update( | ||
{ | ||
"name": _("Wishlists"), | ||
"domain": self._wishlist_domain(), | ||
"context": { | ||
"default_typology": "wishlist", | ||
"default_partner_id": self.id, | ||
}, | ||
} | ||
) | ||
return res |
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 <simone.orsi@camptocamp.com> |
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 @@ | ||
Extends `sale_product_set` features to add a new typology: wishlist. | ||
This module can serve as base to handle multiple wishlists for a customer, | ||
being or not e-commerce related. |
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,6 @@ | ||
To use this module, you need to: | ||
|
||
* Define a *product set* as sale manager and select typology "wishlist" | ||
* Assign it to a partner | ||
* On the partner you'll see a smart button that brings you to customer's wishlists | ||
* Once you clicked on it you can create more wishlists for that customer. |
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.