-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] website_sale_stock_provisioning_date: Migration to 17.0
- Loading branch information
1 parent
6cd6062
commit 0be5ece
Showing
6 changed files
with
118 additions
and
57 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
24 changes: 24 additions & 0 deletions
24
...le_stock_provisioning_date/static/src/js/website_sale_stock_provisioning_date_tour.esm.js
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,24 @@ | ||
/** @odoo-module **/ | ||
/* Copyright 2020 Tecnativa - Ernesto Tejeda | ||
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ | ||
|
||
import {registry} from "@web/core/registry"; | ||
import tourUtils from "@website_sale/js/tours/tour_utils"; | ||
import wTourUtils from "@website/js/tours/tour_utils"; | ||
|
||
registry.category("web_tour.tours").add("website_sale_stock_provisioning_date", { | ||
test: true, | ||
url: "/shop", | ||
steps: () => [ | ||
...tourUtils.searchProduct("provisioning date"), | ||
wTourUtils.clickOnElement( | ||
"click on product test", | ||
'.oe_product_cart a:contains("provisioning date")' | ||
), | ||
{ | ||
trigger: "a#add_to_cart", | ||
extra_trigger: | ||
".availability_messages:has(span:contains('Next provisioning date:'))", | ||
}, | ||
], | ||
}); |
39 changes: 0 additions & 39 deletions
39
...e_sale_stock_provisioning_date/static/src/js/website_sale_stock_provisioning_date_tour.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -28,7 +28,7 @@ def setUpClass(cls): | |
limit=1, | ||
) | ||
picking_form = Form( | ||
recordp=cls.env["stock.picking"].with_context( | ||
cls.env["stock.picking"].with_context( | ||
default_picking_type_id=incoming_picking_type.id | ||
), | ||
view="stock.view_picking_form", | ||
|
@@ -42,10 +42,61 @@ def setUpClass(cls): | |
picking = picking_form.save() | ||
picking.action_confirm() | ||
|
||
cls.warehouse_1 = cls.env["stock.warehouse"].search( | ||
[("company_id", "=", cls.env.company.id)] | ||
) | ||
# Create two stockable products | ||
cls.product_A = cls.env["product.product"].create( | ||
{ | ||
"name": "Product A", | ||
"allow_out_of_stock_order": False, | ||
"type": "product", | ||
"default_code": "E-COM1", | ||
} | ||
) | ||
cls.partner = cls.env["res.partner"].create( | ||
{"name": "Test Partner", "email": "[email protected]"} | ||
) | ||
# Add 10 Product A in WH1 and 15 Product 1 in WH2 | ||
quants = ( | ||
cls.env["stock.quant"] | ||
.with_context(inventory_mode=True) | ||
.create( | ||
[ | ||
{ | ||
"product_id": cls.product_A.id, | ||
"inventory_quantity": 10.0, | ||
"location_id": cls.warehouse_1.lot_stock_id.id, | ||
} | ||
] | ||
) | ||
) | ||
quants.action_apply_inventory() | ||
sale = cls.env["sale.order"].create( | ||
{ | ||
"partner_id": cls.partner.id, | ||
"order_line": [ | ||
( | ||
0, | ||
0, | ||
{ | ||
"product_id": cls.product_A.id, | ||
"product_uom_qty": 3, | ||
}, | ||
) | ||
], | ||
} | ||
) | ||
sale.action_confirm() | ||
|
||
def test_ui_website(self): | ||
"""Test frontend tour.""" | ||
self.start_tour( | ||
"/shop", | ||
"website_sale_stock_provisioning_date", | ||
login="admin", | ||
) | ||
|
||
def test_search_qty_free(self): | ||
templates = self.env["product.template"].search([("free_qty", ">", 0)]) | ||
self.assertEqual(templates.free_qty, 7) |