-
Notifications
You must be signed in to change notification settings - Fork 2
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 remytms
- Loading branch information
Showing
12 changed files
with
111 additions
and
18 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
1 change: 1 addition & 0 deletions
1
setup/website_sale_product_availability/odoo/addons/website_sale_product_availability
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 @@ | ||
../../../../website_sale_product_availability |
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 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=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,2 @@ | ||
# Copyright 2022 Coop IT Easy SC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
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,25 @@ | ||
# Copyright 2022 Coop IT Easy SC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Website Sale Product Availability", | ||
"summary": """ | ||
Display the quantity of products available on the product overview.""", | ||
"version": "12.0.1.0.0", | ||
"category": "Website", | ||
"website": "https://coopiteasy.be", | ||
"author": "Coop IT Easy SC", | ||
"maintainers": ["carmenbianca"], | ||
"license": "AGPL-3", | ||
"application": False, | ||
"depends": [ | ||
"website_sale", | ||
"website_sale_stock", | ||
], | ||
"excludes": [], | ||
"data": [ | ||
"views/templates.xml", | ||
], | ||
"demo": [], | ||
"qweb": [], | ||
} |
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 @@ | ||
* `Coop IT Easy SC <https://coopiteasy.be>`_: | ||
|
||
* Carmen Bianca BAKKER |
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 @@ | ||
Display the quantity of products available on the e-commerce product overview. |
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 @@ | ||
After installing the module, go to the 'eCommerce' tab on your products. Change | ||
the 'Availability' setting from 'Sell regardless of inventory' to 'Show | ||
inventory [...]' if you want to show the availability on the product overview | ||
page in the e-commerce. |
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,51 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
Copyright 2022 Coop IT Easy SC | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<template id="products_item" inherit_id="website_sale.products_item"> | ||
<xpath | ||
expr="//div[@itemscope='itemscope']//div[hasclass('product_price')]//b" | ||
position="after" | ||
> | ||
<span name="product_availability" class="product_availability"> | ||
<t t-call="website_sale_product_availability.product_availability" /> | ||
</span> | ||
</xpath> | ||
</template> | ||
|
||
<template id="product_availability"> | ||
<span t-if="product.inventory_availability == 'always'"> | ||
<!-- | ||
FIXME: This doesn't seem like good i18n practice to me. What | ||
if another language says e.g. 'available $qty $uom'? | ||
However, it's also done like this in | ||
website_sale_stock.product_availability, so it's probably | ||
fine. | ||
--> | ||
<t t-esc="product.sudo().virtual_available" /> <t | ||
t-esc="product.uom_name" | ||
/> available | ||
</span> | ||
<span t-if="product.inventory_availability == 'threshold'"> | ||
<t | ||
t-if="product.sudo().virtual_available <= product.available_threshold" | ||
> | ||
<i | ||
class="fa fa-exclamation-triangle" | ||
title="Warning" | ||
role="img" | ||
aria-label="Warning" | ||
/> | ||
<t t-esc="product.sudo().virtual_available" /> <t | ||
t-esc="product.uom_name" | ||
/> available | ||
</t> | ||
<t | ||
t-if="product.sudo().virtual_available > product.available_threshold" | ||
>In stock</t> | ||
</span> | ||
</template> | ||
</odoo> |