mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-25 10:42:02 +02:00
Initial commit: Pos packages
This commit is contained in:
commit
95dfb9edb0
1301 changed files with 264148 additions and 0 deletions
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue