Files
odoo_source/addons/pos_hr/static/tests/tours/PosHrTourMethods.js
T
Jacky (trj) 0e7fdbe06c [REF] point_of_sale, *pos*: renaming cashier, partner and customer
Multiple refactors
- The module pos_hr had two attributes `cashier` and `employee` referencing to the same actual person. The `employee` attribute was removed for the sake of `cashier`.
- Refactor of the `useSelectEmployee` which returned functions that where used in two components. Instead, a mixin class was implemented and inherited from both components.
- Renaming of the substring `client` and `customer` to `partner` (css included) when it was referencing to the actual `res.partner` object. This way, developers will always know that the object used in the UI is coming from `res.partner`.
- Renaming of the substring `client` to `customer`(css included) when it was referencing to a real life person. This avoid having ambiguity since the term `client` can refers to multiple things (hardware, browser, person, ...)

closes odoo/odoo#83983

Related: odoo/enterprise#24477
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-02-28 13:52:51 +00:00

68 lines
2.0 KiB
JavaScript

odoo.define('pos_hr.tour.PosHrTourMethods', function (require) {
'use strict';
const { createTourMethods } = require('point_of_sale.tour.utils');
const { SelectionPopup } = require('point_of_sale.tour.SelectionPopupTourMethods');
const { NumberPopup } = require('point_of_sale.tour.NumberPopupTourMethods');
class Do {
clickLoginButton() {
return [
{
content: 'click login button',
trigger: '.login-overlay .login-button.select-cashier',
},
];
}
clickLockButton() {
return [
{
content: 'click lock button',
trigger: '.header-button .lock-button',
},
];
}
clickCashierName() {
return [
{
content: 'click cashier name',
trigger: '.oe_status .username',
}
]
}
}
class Check {
loginScreenIsShown() {
return [
{
content: 'login screen is shown',
trigger: '.login-overlay .screen-login .login-body',
run: () => {},
},
];
}
cashierNameIs(name) {
return [
{
content: `logged cashier is '${name}'`,
trigger: `.pos .oe_status .username:contains("${name}")`,
run: () => {},
},
];
}
}
class Execute {
login(name, pin) {
const res = this._do.clickLoginButton();
res.push(...SelectionPopup._do.clickItem(name));
if (pin) {
res.push(...NumberPopup._do.pressNumpad(pin.split('').join(' ')));
res.push(...NumberPopup._do.clickConfirm());
}
return res;
}
}
return createTourMethods('PosHr', Do, Check, Execute);
});