18 lines
721 B
Python
18 lines
721 B
Python
from odoo import models, fields, api, _
|
|
from odoo.exceptions import UserError
|
|
|
|
class PosOrder(models.Model):
|
|
_inherit = 'pos.order'
|
|
|
|
payer_id = fields.Many2one('hr.employee', string='Cashier', help='Employee who processed the payment')
|
|
|
|
# Existing Odoo/POS fields renamed for clarity
|
|
user_id = fields.Many2one('res.users', string='Session User', help='Odoo user who opened the session')
|
|
employee_id = fields.Many2one('hr.employee', string='Order Taker', help='Employee who uses the cash register')
|
|
|
|
def _refund(self):
|
|
for order in self:
|
|
if order.state == 'cancel':
|
|
raise UserError(_("You cannot refund a cancelled order."))
|
|
return super()._refund()
|