[IMP] pos_loyalty: display program name on reward selector
Before this PR, the name of the program from which an award comes was not displayed in the selection popup. closes odoo/odoo#112122 Taskid: 3069449 Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
This commit is contained in:
@@ -2686,7 +2686,6 @@ td {
|
||||
max-height: 273px;
|
||||
font-size: 16px;
|
||||
width: auto;
|
||||
line-height: 50px;
|
||||
margin-top: -1px;
|
||||
border-top: solid 3px rgba(60,60,60,0.1);
|
||||
|
||||
@@ -2696,7 +2695,13 @@ td {
|
||||
background: rgb(230,230,230);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
padding: 0px 16px;
|
||||
padding: 18px 16px;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.pos .popup.popup-selection .selection-item span:nth-child(2) {
|
||||
margin-top: 5px;
|
||||
font-size: 80%;
|
||||
}
|
||||
.pos .popup.popup-selection .selection-item:nth-child(odd) {
|
||||
background: rgb(247,247,247);
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<t t-foreach="props.list" t-as="item" t-key="item.id">
|
||||
<div class="selection-item" t-att-class="{ selected: item.isSelected }"
|
||||
t-on-click="() => this.selectItem(item.id)">
|
||||
<t t-esc="item.label" />
|
||||
<span t-esc="item.label" />
|
||||
<span t-esc="item.description" t-if="item.description" />
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
@@ -100,16 +100,11 @@ export class RewardButton extends Component {
|
||||
|
||||
async click() {
|
||||
const rewards = this._getPotentialRewards();
|
||||
if (rewards.length === 1) {
|
||||
return this._applyReward(
|
||||
rewards[0].reward,
|
||||
rewards[0].coupon_id,
|
||||
rewards[0].potentialQty
|
||||
);
|
||||
} else {
|
||||
if (rewards.length >= 1) {
|
||||
const rewardsList = rewards.map((reward) => ({
|
||||
id: reward.reward.id,
|
||||
label: reward.reward.description,
|
||||
description: reward.reward.program_id.name,
|
||||
item: reward,
|
||||
}));
|
||||
const { confirmed, payload: selectedReward } = await this.popup.add(SelectionPopup, {
|
||||
|
||||
@@ -130,7 +130,7 @@ PosLoyalty.check.isRewardButtonHighlighted(false);
|
||||
ProductScreen.do.clickPartnerButton();
|
||||
ProductScreen.do.clickCustomer("Test Partner CCC");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(true);
|
||||
PosLoyalty.do.clickRewardButton();
|
||||
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
|
||||
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
|
||||
ProductScreen.do.clickPartnerButton();
|
||||
// This deselects the customer.
|
||||
|
||||
@@ -65,7 +65,7 @@ ProductScreen.check.selectedOrderlineHas("Magnetic Board", "3.00");
|
||||
ProductScreen.do.pressNumpad("6");
|
||||
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "6.00");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(true);
|
||||
PosLoyalty.do.clickRewardButton();
|
||||
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(false);
|
||||
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-6.40", "2.00");
|
||||
// Finalize order that consumed a reward.
|
||||
@@ -111,7 +111,7 @@ PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
|
||||
ProductScreen.do.pressNumpad("Backspace");
|
||||
ProductScreen.do.pressNumpad("Backspace");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(true);
|
||||
PosLoyalty.do.clickRewardButton();
|
||||
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
|
||||
SelectionPopup.check.hasSelectionItem("Monitor Stand");
|
||||
SelectionPopup.check.hasSelectionItem("Desk Pad");
|
||||
SelectionPopup.do.clickItem("Desk Pad");
|
||||
@@ -120,7 +120,8 @@ PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
|
||||
ProductScreen.do.pressNumpad("Backspace");
|
||||
ProductScreen.do.pressNumpad("Backspace");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(true);
|
||||
PosLoyalty.do.claimReward("Monitor Stand");
|
||||
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
|
||||
SelectionPopup.do.clickItem("Monitor Stand");
|
||||
PosLoyalty.check.isRewardButtonHighlighted(false);
|
||||
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.00", "3.19");
|
||||
PosLoyalty.check.hasRewardLine("Free Product", "-3.19", "1.00");
|
||||
@@ -138,6 +139,7 @@ ProductScreen.do.clickCustomer('AAA Partner');
|
||||
ProductScreen.exec.addOrderline('Test Product A', '1');
|
||||
PosLoyalty.check.isRewardButtonHighlighted(true);
|
||||
PosLoyalty.do.clickRewardButton();
|
||||
SelectionPopup.do.clickItem("Free Product - Test Product A");
|
||||
PosLoyalty.check.hasRewardLine('Free Product - Test Product A', '-11.50', '1.00');
|
||||
PosLoyalty.check.isRewardButtonHighlighted(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user