Initial commit: Pos packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:50 +02:00
commit 95dfb9edb0
1301 changed files with 264148 additions and 0 deletions

View file

@ -0,0 +1,5 @@
# coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import pos_payment
from . import pos_order

View file

@ -0,0 +1,17 @@
# coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PosOrder(models.Model):
_inherit = 'pos.order'
def set_no_tip(self):
"""Capture the payment when no tip is set."""
res = super(PosOrder, self).set_no_tip()
for payment in self.payment_ids:
if payment.payment_method_id.use_payment_terminal == 'stripe':
payment.payment_method_id.stripe_capture_payment(payment.transaction_id)
return res

View file

@ -0,0 +1,16 @@
# coding: utf-8
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PosPayment(models.Model):
_inherit = 'pos.payment'
def _update_payment_line_for_tip(self, tip_amount):
"""Capture the payment when a tip is set."""
res = super(PosPayment, self)._update_payment_line_for_tip(tip_amount)
if self.payment_method_id.use_payment_terminal == 'stripe':
self.payment_method_id.stripe_capture_payment(self.transaction_id, amount=self.amount)
return res