-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] website_sale*: add to whislist and notify stock
This module allows users to be notified by email when a product out of stock comes back in stock. For that they can add it to their wishlist and select the appropriate option. We show out-of-stock warning in all case whatever the show availibility option. You cannot custom you 'in stock' message ot free message. Spec of Pde and Fp Part of #68221 task-2458165 closes #68221 Related: odoo/upgrade#2405 Signed-off-by: Jérémy Kersten (jke) <[email protected]> Co-authored-by: Kersten Jeremy <[email protected]> Co-authored-by: Younn Olivier <[email protected]>
- Loading branch information
Showing
35 changed files
with
537 additions
and
116 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
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
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
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
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
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 |
---|---|---|
|
@@ -21,4 +21,5 @@ | |
], | ||
}, | ||
'auto_install': True, | ||
'license': 'LGPL-3', | ||
} |
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
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
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
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
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
36 changes: 16 additions & 20 deletions
36
addons/website_sale_stock/static/src/xml/website_sale_stock_product_availability.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 |
---|---|---|
@@ -1,29 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<templates> | ||
|
||
<t t-name="website_sale_stock.product_availability"> | ||
<t t-if="product_type == 'product' and _.contains(['always', 'threshold'], inventory_availability)"> | ||
<t t-if="free_qty gt 0"> | ||
<div t-if="inventory_availability == 'always'" t-attf-class="availability_message_#{product_template} text-success mt16"> | ||
<t t-esc="free_qty_formatted" /> <t t-esc="uom_name" /> available | ||
</div> | ||
<t t-if="inventory_availability == 'threshold'"> | ||
<div t-if="free_qty lte available_threshold" t-attf-class="availability_message_#{product_template} text-warning mt16"> | ||
<i class="fa fa-exclamation-triangle" title="Warning" role="img" aria-label="Warning"/> | ||
<t t-esc="free_qty_formatted" /> <t t-esc="uom_name" /> available | ||
</div> | ||
<div t-if="free_qty gt available_threshold" t-attf-class="availability_message_#{product_template} text-success mt16">In stock</div> | ||
<t t-if="product_type == 'product'"> | ||
<!-- show out_of_stock_message whatever the show_availability - pde's spec--> | ||
<div id="out_of_stock_message" t-if="free_qty lte 0 and !cart_qty" t-attf-class="availability_message_#{product_template}"> | ||
<t t-if='has_out_of_stock_message' t-out='out_of_stock_message'/> | ||
<t t-elif="!allow_out_of_stock_order">Out of Stock</t> | ||
</div> | ||
<div id="threshold_message" t-elif="show_availibility and free_qty lte available_threshold" t-attf-class="availability_message_#{product_template}"> | ||
Only <t t-esc='free_qty'/> <t t-esc="uom_name" /> left in stock. | ||
</div> | ||
|
||
<div t-if="!allow_out_of_stock_order and show_availability and cart_qty" t-attf-class="availability_message_#{product_template} text-warning mt8"> | ||
<t t-if='!free_qty'> | ||
You already added all the available product in your cart. | ||
</t> | ||
<t t-else=''> | ||
You already added <t t-esc="cart_qty" /> <t t-esc="uom_name" /> in your cart. | ||
</t> | ||
</t> | ||
<div t-if="cart_qty" t-attf-class="availability_message_#{product_template} text-warning mt8"> | ||
You already added <t t-if="!free_qty">all</t> <t t-esc="cart_qty" /> <t t-esc="uom_name" /> in your cart. | ||
</div> | ||
<div t-if="!cart_qty and free_qty lte 0" t-attf-class="availability_message_#{product_template} text-danger mt16"><i class="fa fa-exclamation-triangle" role="img" aria-label="Warning" title="Warning"/> Temporarily out of stock</div> | ||
</t> | ||
<div t-if="product_type == 'product' and inventory_availability == 'custom'" t-attf-class="availability_message_#{product_template} text-success mt16"> | ||
<t t-esc="custom_message" /> | ||
</div> | ||
</t> | ||
|
||
</templates> |
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
Oops, something went wrong.