-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD][website_sale_wishlist] Wishlist for your online shop. #122
Conversation
Tested in runbot 👍 |
@yajo could you increase coverage? |
Tested in runbot 👍 |
"category": "Website", | ||
"website": "https://tecnativa.com/", | ||
"author": "Tecnativa, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For OCA modules, the license is generally AGPL-3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCA admits any OSI approved license (including this). We have chosen this license for website related modules for allowing to put specific stuff on top of these modules and for not being forced to give the source code of this to any of the visitors of the website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
Tested in runbot 👍 (Wishlist/Suggestion) |
Hi @atchuthan , "When we add a product using "add cart" from wishlist window, we could probably remove the wishlist of the added product." That is what cart do, wishlist must be persistent as it could be used for you favourites products |
Thanks @atchuthan, I thought on that, but it seems to me that maybe users want to use it as a "bookmark", or they could want to buy again those same products later, so I prefer this module not to be so smart. Removing them is just one click away. |
I think the same that Yajo |
@@ -0,0 +1,9 @@ | |||
# Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | |||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | |||
- !record {id: garbage_collector, model: ir.cron}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember me why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for removing wishlist items for non-users and sessions that no longer exist
👍 tested in runbot |
@yajo please review coverage, thanks! Functional test 👍 |
@yajo, please check pending comments, and it would be good to add to the README the reasoning about not removing the element when adding to cart |
tested on runbot: working 👍 Call of self.pool.get('wishlist.product')._garbage_collector(cr, uid, _()) failed in Job 6 |
This is weird, the test fails, but Travis is not ❌. Do not trust him, I have to fix the test. |
1a81d4e
to
6df6afb
Compare
<record id="menu_website_sale_brand" model="website.menu"> | ||
<field name="name">Shop by Brand</field> | ||
<field name="url">/page/product_brands</field> | ||
<field name="parent_id" ref="website_sale.menu_shop" /> | ||
<field name="sequence" type="int">25</field> | ||
<field name="parent_id" ref="website_sale.main_menu" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
external id seems to be wrong, website.main_menu
https://github.com/odoo/odoo/blob/9.0/addons/website/data/data.xml#L12
Runbot fails due to this
File "/srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3155288-122-6df6af/openerp/addons/base/ir/ir_model.py", line 974, in xmlid_lookup
raise ValueError('External ID not found in the system: %s' % (xmlid))
ParseError: "External ID not found in the system: website_sale.main_menu" while parsing /srv/openerp/instances/openerp-oca-runbot/parts/odoo-extra/runbot/static/build/3155288-122-6df6af/openerp/addons/website_sale_product_brand/views/product_brand.xml:61, near
<record id="menu_website_sale_brand" model="website.menu">
<field name="name">Shop by Brand</field>
<field name="url">/page/product_brands</field>
<field name="sequence" type="int">25</field>
<field name="parent_id" ref="website_sale.main_menu"/>
</record>
For more info, check the runbot log
6df6afb
to
2d68733
Compare
Runbot test 👍 |
Fun. |
@@ -0,0 +1,14 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<openerp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<odoo noupdate="1">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I did not know that shortcut!
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> | ||
<odoo> | ||
|
||
<template id="assets_frontend_demo" inherit_id="website.assets_frontend"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in this case, because there is already an assets_frontend
view in this addon, but this one is just for demo environments, to run tests.
|
||
current_session = fields.Char(compute="_compute_current_session") | ||
|
||
@api.one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@api.one
is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still a little hope 🙏 . I don't consider it deprecated until that PR is closed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hope, please fix
from openerp.http import request | ||
|
||
|
||
class ResUsers(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class Website
errors if you try to browse them when loaded from cache and cached | ||
ones used a cursor that is now closed. | ||
""" | ||
return [record["product_tmpl_id"][0] for record in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is a bit hard to read, maybe assign the search_read to a var then perform the generator? Non-blocking
|
||
|
||
class WishlistProduct(models.Model): | ||
_name = "wishlist.product" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly product.wishlist
instead of creating a namespace for wishlists? I can't think of another use for a wishlist outside of products, and this would match pricelist naming
] | ||
|
||
product_tmpl_id = fields.Many2one( | ||
comodel_name="product.template", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not possible to wishlist a variant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odoo works at template level in the e-commerce (product list, product detail). Variants are reflected through selection options in the template detail page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks for the elaboration.
comodel_name="product.template", | ||
string="Product", | ||
required=True, | ||
help="Wishlisted product.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ondelete='cascade'
?
@@ -6,10 +6,10 @@ | |||
<template id="product_brands" name="Brands"> | |||
<t t-call="website.layout"> | |||
<t t-set="additional_title">Product Brands</t> | |||
<div id="wrap" t-attf-class="wrapper"> | |||
<div id="wrap" t-attf-class="wrapper"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not a format string you may use t-att-class="wrapper"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed this is a bug, but I prefer not to touch that. I'm only touching this file to remove a menu, seems like the space stripper changed this, but I'd prefer not to change something that could have a meaning without investigating, if you don't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix it, now that you have opened the Pandora's box 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I mean... should I change it for class="wrapper"
or for t-att-class="wrapper"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good question. We need to see controller. Now I'm changing my vote for not touching this, hehe. I would bet t-att-class="wrapper"
, because although technically there's no %
to format, it won't fail without them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then let's leave this as it is 😆
Check Travis |
7c09edf
to
e8c25d3
Compare
e8c25d3
to
5550b36
Compare
Rebased, let's see... |
Please review, bots like this 😊 💚 |
Hi @pedrobaeza @yajo @lasley and others. Thanks for this nice feature My customer would like to use it for V8. How much time do you think I need to backport in v8 ? Thanks a lot. |
The backport is not easy, as JS API has changed a lot in v9, but there's an alternative implementation for v8 in #130 |
Thanks for your reply, I've seen it but my customer also seen https://www.odoo.com/apps/modules/9.0/wishlist/ |
But that one is not from OCA. See that the repo is git@github.com:techhighway/Product-Wishlist.git#8.0 |
Yes, it was for your information, maybe pick up good ideas. Thanks |
Well, we are not working more on this for now, but any PR is welcome 😉 |
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
[ADD][website_sale_wishlist] Wishlist for your online shop. Allow your visitors and users to wishlist your products and have a shortcut for seeing them. Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in. OCA Transbot updated translations from Transifex
Allow your visitors and users to wishlist your products and have a shortcut for seeing them.
Wishlisted products are stored in the session for public users, and linked to the user if s/he is logged in.
@Tecnativa