Skip to content

Commit

Permalink
⬆️ pos_debranding: port to v17
Browse files Browse the repository at this point in the history
  • Loading branch information
yelizariev committed Dec 19, 2023
1 parent dc75725 commit aead0fb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
4 changes: 2 additions & 2 deletions pos_debranding/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Roadmap
Further information
===================

HTML Description: https://apps.odoo.com/apps/modules/16.0/pos_debranding
HTML Description: https://apps.odoo.com/apps/modules/17.0/pos_debranding

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Tested on `Odoo 16.0 <https://github.com/odoo/odoo/commit/9917d841fa38ccc1e6d67875a665494dc22ef92f>`_
Tested on `Odoo 17.0 <https://github.com/odoo/odoo/commit/40b19d89846303016098840f4958fe7cc105067c>`_
11 changes: 8 additions & 3 deletions pos_debranding/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2015-2018,2020,2022 Ivan Yelizariev <https://twitter.com/yelizariev>
# Copyright 2015-2018,2020,2022-2023 Ivan Yelizariev <https://twitter.com/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": "POS debranding",
Expand All @@ -10,10 +10,15 @@
"website": "https://odoo-debranding.com",
"depends": ["point_of_sale"],
"assets": {
"web.assets_backend": ["pos_debranding/static/src/js/tour.js"],
"point_of_sale.assets": [
"point_of_sale.assets_prod": [
"pos_debranding/static/src/xml/pos_debranding.xml",
],
"web.assets_tests": [
"pos_debranding/static/src/js/tour.js",
],
},
"data": [
"views/pos.xml",
],
"installable": True,
}
18 changes: 11 additions & 7 deletions pos_debranding/static/src/js/tour.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
odoo.define("pos_debranding.tour", function (require) {
var tour = require("web_tour.tour");
/** @odoo-module **/
// Copyright 2015-2018,2020,2022-2023 Ivan Yelizariev <https://twitter.com/yelizariev>
// License OPL-1 (https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps)
import { registry } from "@web/core/registry";
import { stepUtils } from "@web_tour/tour_service/tour_utils";

var steps = [
tour.stepUtils.showAppsMenuItem(),
registry.category("web_tour.tours").add("pos_debranding.tour", {
url: "/web",
steps: () => [
stepUtils.showAppsMenuItem(),
{
test: true,
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]',
content: "Ready to launch your <b>point of sale</b>? <i>Click here</i>.",
position: "right",
Expand Down Expand Up @@ -42,7 +48,5 @@ odoo.define("pos_debranding.tour", function (require) {
// It's a check
},
},
];

tour.register("pos_debranding_tour", { test: true, url: "/web" }, steps);
],
});
4 changes: 3 additions & 1 deletion pos_debranding/static/src/xml/pos_debranding.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2023 Ivan Yelizariev <https://twitter.com/yelizariev>
License OPL-1 (https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps). -->
<templates id="template" xml:space="preserve">
<t
t-name="Chrome"
t-inherit="point_of_sale.Chrome"
t-inherit="point_of_sale.Navbar"
t-inherit-mode="extension"
owl="1"
>
Expand Down
14 changes: 2 additions & 12 deletions pos_debranding/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@
@tagged("post_install", "-at_install")
class TestUi(HttpCase):
def test_01_check_logo(self):
env = self.env
# needed because tests are run before the module is marked as
# installed. In js web will only load qweb coming from modules
# that are returned by the backend in module_boot. Without
# this you end up with js, css but no qweb.
env["ir.module.module"].search(
[("name", "=", "pos_debranding")], limit=1
).state = "installed"
self.browser_js(
self.start_tour(
"/web",
"odoo.__DEBUG__.services['web_tour.tour']" ".run('pos_debranding_tour')",
"odoo.__DEBUG__.services['web_tour.tour']"
".tours.pos_debranding_tour.ready",
"pos_debranding.tour",
login="admin",
timeout=240,
)
10 changes: 10 additions & 0 deletions pos_debranding/views/pos.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Ivan Yelizariev <https://twitter.com/yelizariev>
License OPL-1 (https://www.odoo.com/documentation/17.0/legal/licenses.html#odoo-apps). -->
<odoo>
<template id="pos_debranding" inherit_id="point_of_sale.index">
<xpath expr="//title" position="replace">
<title>POS</title>
</xpath>
</template>
</odoo>

0 comments on commit aead0fb

Please sign in to comment.