Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1 @@
from . import test_module

View file

@ -0,0 +1,65 @@
# Copyright (C) 2022-Today GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo.tests import tagged
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
@tagged("post_install", "-at_install")
class TestUi(TestPointOfSaleHttpCommon):
def test_pos_discount_all(self):
pricelist = self.env["product.pricelist"].create(
{
"name": "Pricelist -10%",
}
)
self.env["product.pricelist.item"].create(
{
"pricelist_id": pricelist.id,
"name": "Pricelist Item -10%",
"applied_on": "3_global",
"compute_price": "percentage",
"percent_price": 10,
}
)
self.main_pos_config.write(
{
"use_pricelist": True,
"available_pricelist_ids": [(4, pricelist.id)],
}
)
# Make the test compatible with pos_minimize_menu
if "iface_important_buttons" in self.main_pos_config._fields:
self.main_pos_config.iface_important_buttons = "SetPricelistButton"
self.env["product.product"].create(
{
"name": "Generic Product",
"available_in_pos": True,
"list_price": 10.0,
"taxes_id": False,
}
)
self.env["product.product"].create(
{
"name": "Discount Product",
"is_discount": True,
"available_in_pos": True,
"list_price": -1.0,
"taxes_id": False,
}
)
self.main_pos_config.open_ui()
self.start_tour(
f"/pos/ui?config_id={self.main_pos_config.id}",
"PosDiscountAllTour",
login="accountman",
)

View file

@ -0,0 +1,78 @@
/*
Copyright (C) 2022-Today GRAP (http://www.grap.coop)
@author Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
*/
/* eslint-disable no-empty-function */
odoo.define("pos_discount_all.tour.PosDiscountAllTour", function (require) {
"use strict";
const Tour = require("web_tour.tour");
var steps = [
{
content: "Test pos_discount_all: Waiting for loading to finish",
trigger: "body:not(:has(.loader))",
run: () => {},
},
{
content: "Test pos_discount_all: Close Opening cashbox popup",
trigger: "div.opening-cash-control .button:contains('Open session')",
},
{
content: "Test pos_discount_all: Leave category displayed by default",
trigger: ".breadcrumb-home",
run: () => {},
},
{
content: "Test pos_discount_all: Order a 'Discount Product' (price -1.0)",
trigger: ".product-list .product-name:contains('Discount Product')",
},
{
content: "Test pos_discount_all: Check correct amount of discount value",
trigger: ".discount-amount:contains('1.0')",
},
{
content: "Test pos_discount_all: Order one 'Generic Product' (price 10.0)",
trigger: ".product-list .product-name:contains('Generic Product')",
},
{
content: "Test pos_discount_all: Change to price mode",
trigger: ".numpad button:contains('Price')",
},
{
content:
"Test pos_discount_all: manually override the unit price of 'Generic Product' (price 5.0)",
trigger: ".numpad button.input-button:visible:contains('5')",
},
{
content: "Test pos_discount_all: Check correct amount of discount value",
trigger: ".discount-amount:contains('6.0')",
},
{
content: "Test pos_discount_all: open Pricelist popUp",
trigger: ".control-button.o_pricelist_button",
},
{
content: "Test pos_discount_all: select 'Pricelist -10%' pricelist",
trigger: ".selection-item:contains('Pricelist -10%')",
},
{
content: "Test pos_discount_all: Check correct amount of discount value",
trigger: ".discount-amount:contains('5.90')",
},
{
content: "Test pos_discount_all: Close the Point of Sale frontend",
trigger: ".header-button",
},
{
content: "Test pos_discount_all: Confirm closing the frontend",
trigger: ".header-button",
run: () => {},
},
];
Tour.register("PosDiscountAllTour", {test: true, url: "/pos/ui"}, steps);
});
/* */