Skip to content

Commit

Permalink
Revert "[FIX] spp_pos_id_redemption: refund functionality on POS"
Browse files Browse the repository at this point in the history
This reverts commit d9a3dfe.
  • Loading branch information
emjay0921 committed Jan 16, 2025
1 parent d9a3dfe commit 5e60f47
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
1 change: 0 additions & 1 deletion spp_pos/data/entitlement_product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<record id="entitlement_product" model="product.template">
<field name="name">Entitlement</field>
<field name="available_in_pos">1</field>
<field name="active">0</field>
<field name="list_price">0</field>
<field name="is_locked">1</field>
<field name="categ_id" ref="spp_pos.entitlement_product_categ" />
Expand Down
7 changes: 0 additions & 7 deletions spp_pos_id_redemption/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ def redeem_voucher(self, longitude=None, latitude=None):
rec.entitlement_id.longitude = longitude
rec.entitlement_id.latitude = latitude

def undo_redeem_voucher(self, longitude=None, latitude=None):
for rec in self:
if rec.entitlement_id:
rec.entitlement_id.voucher_redeemed = False
rec.entitlement_id.longitude = longitude
rec.entitlement_id.latitude = latitude

def unredeem_voucher(self):
for rec in self:
if rec.entitlement_id:
Expand Down
17 changes: 2 additions & 15 deletions spp_pos_id_redemption/static/src/js/payment_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,8 @@ patch(PaymentScreen.prototype, {
for (const orderline of this.pos.get_order().orderlines) {
if (orderline.product.created_from_entitlement) {
const productId = orderline.product.id;
if (orderline.quantity >= 1) {
await this.orm.call("product.template", "redeem_voucher", [
productId,
latitude,
longitude,
]);
orderline.product.voucher_redeemed = true;
} else {
await this.orm.call("product.template", "undo_redeem_voucher", [
productId,
latitude,
longitude,
]);
orderline.product.voucher_redeemed = false;
}
await this.orm.call("product.template", "redeem_voucher", [productId, latitude, longitude]);
orderline.product.voucher_redeemed = true;
}
}
},
Expand Down
1 change: 0 additions & 1 deletion spp_pos_id_redemption/views/pos_config_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<xpath expr="//kanban" position="attributes">
<attribute name="default_group_by">area_id</attribute>
<attribute name="group_create">False</attribute>
<attribute name="disable_drag_drop_record">True</attribute>
</xpath>
<xpath expr="//div[hasclass('o_kanban_card_content')]/div/div[1]" position="attributes">
<attribute name="class">col-12 o_kanban_primary_left</attribute>
Expand Down

0 comments on commit 5e60f47

Please sign in to comment.