[fix] description and dependencies

This commit is contained in:
Niels Göttsch 2024-07-28 22:27:12 +02:00
parent c5dcf8bdc3
commit afbc9aaddc
6 changed files with 19 additions and 39 deletions

View file

@ -22,8 +22,10 @@ NFU eCommerce
|badge1| |badge2| |badge3| |badge1| |badge2| |badge3|
This module adds a minium and a maximum order quantity field to Website Sale Orders This module adds a maximum order quantity field to Website Sale Orders. It also adds
and adds it the customer balance to checkout of the website shop. an ordered qantitiy field to store the original ordered quantity in case a manager
adjustes the uom quantitiy. In webshop checkout it adds the customer balance to before
and after the current order.
**Table of contents** **Table of contents**

View file

@ -5,8 +5,8 @@
"website": "https://www.bakeup.org", "website": "https://www.bakeup.org",
"category": "website", "category": "website",
"version": "16.0.0.0.1", "version": "16.0.0.0.1",
"depends": ["sale_management", "website_sale", "nfu_sale_order_batch_packaging"], "depends": ["website_sale", "nfu_sale_order_batch_packaging"],
"data": ["views/templates.xml"], "data": ["views/templates.xml"],
"assets": {"web.assets_frontend": ["nfu_sale_product_min_max_qty/static/src/js/website_sale.js"]}, "assets": {"web.assets_frontend": ["nfu_ecommerce/static/src/js/website_sale.js"]},
"license": "LGPL-3", "license": "LGPL-3",
} }

View file

@ -1,2 +1,4 @@
This module adds a minium and a maximum order quantity field to Website Sale Orders This module adds a maximum order quantity field to Website Sale Orders. It also adds
and adds it the customer balance to checkout of the website shop. an ordered qantitiy field to store the original ordered quantity in case a manager
adjustes the uom quantitiy. In webshop checkout it adds the customer balance to before
and after the current order.

View file

@ -370,8 +370,10 @@ ul.auto-toc {
!! source digest: sha256:4dfaea54e4d01502b433eb5c0dcca409a5fbe2c3f175e29382a19230343183c9 !! source digest: sha256:4dfaea54e4d01502b433eb5c0dcca409a5fbe2c3f175e29382a19230343183c9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_ecommerce"><img alt="bruecksen/ife_nfu" src="https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github" /></a></p> <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/bruecksen/ife_nfu/tree/16.0/nfu_ecommerce"><img alt="bruecksen/ife_nfu" src="https://img.shields.io/badge/github-bruecksen%2Fife_nfu-lightgray.png?logo=github" /></a></p>
<p>This module adds a minium and a maximum order quantity field to Website Sale Orders <p>This module adds a maximum order quantity field to Website Sale Orders. It also adds
and adds it the customer balance to checkout of the website shop.</p> an ordered qantitiy field to store the original ordered quantity in case a manager
adjustes the uom quantitiy. In webshop checkout it adds the customer balance to before
and after the current order.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">

View file

@ -1,36 +1,10 @@
odoo.define("nfu_ecommerce.website_min_max_qty", function (require) { odoo.define("nfu_ecommerce.website_max_qty", function (require) {
"use strict"; "use strict";
var core = require("web.core"); var core = require("web.core");
var _t = core._t;
var wSaleUtils = require("website_sale.utils"); var wSaleUtils = require("website_sale.utils");
var publicWidget = require("web.public.widget"); var publicWidget = require("web.public.widget");
require("website_sale.website_sale"); require("website_sale.website_sale");
publicWidget.registry.WebsiteSale.include({ publicWidget.registry.WebsiteSale.include({
onClickAddCartJSON: function (ev) {
ev.preventDefault();
$(".css_quantity").popover("dispose");
var $link = $(ev.currentTarget);
var $input = $link.closest(".input-group").find("input");
var min = parseFloat($input.data("min") || 0);
var previousQty = parseFloat($input.val() || 0, 10);
var quantity = ($link.has(".fa-minus").length ? -1 : 1) + previousQty;
if (quantity < min) {
$input.closest(".css_quantity").popover({
content: _t(`Minimum Quantity is ${min}.`),
title: _t("Warning"),
placement: "left",
trigger: "focus",
html: true,
});
$input.closest(".css_quantity").popover("show");
setTimeout(function () {
$(".css_quantity").popover("dispose");
}, 3000);
}
this._super(ev);
},
/** /**
* Adds the max qty to the POST request when adding a product to the cart. * Adds the max qty to the POST request when adding a product to the cart.
* @override * @override

View file

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<template id="cart_lines_min_max_qty" inherit_id="website_sale.cart_lines" name="Shopping Cart Lines"> <template id="cart_lines_max_qty" inherit_id="website_sale.cart_lines" name="Shopping Cart Lines">
<xpath expr="//th[hasclass('td-qty')]" position="after"> <xpath expr="//th[hasclass('td-qty')]" position="after">
<th class="text-center td-qty"> <th class="text-center td-qty">
<t t-if="show_qty"> <t t-if="show_qty">
<span>Max qty.</span> <span>Max Qty</span>
</t> </t>
</th> </th>
</xpath> </xpath>
@ -74,9 +74,9 @@
</td> </td>
</xpath> </xpath>
</template> </template>
<template id="cart_summary_min_max_qty" inherit_id="website_sale.cart_summary" name="Cart right column"> <template id="cart_summary_max_qty" inherit_id="website_sale.cart_summary" name="Cart right column">
<xpath expr="//th[hasclass('td-qty')]" position="after"> <xpath expr="//th[hasclass('td-qty')]" position="after">
<th class="border-top-0 td-qty">Max qty.</th> <th class="border-top-0 td-qty">Max Qty</th>
</xpath> </xpath>
<xpath expr="//td[hasclass('td-qty')]" position="after"> <xpath expr="//td[hasclass('td-qty')]" position="after">
<td class='td-qty'> <td class='td-qty'>