mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-25 08:42:03 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
15
odoo-bringout-oca-ocb-pos_hr/pos_hr/models/pos_payment.py
Normal file
15
odoo-bringout-oca-ocb-pos_hr/pos_hr/models/pos_payment.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class PosPayment(models.Model):
|
||||
_inherit = "pos.payment"
|
||||
|
||||
employee_id = fields.Many2one('hr.employee', string='Cashier', related='pos_order_id.employee_id', store=True, index=True)
|
||||
|
||||
@api.depends('employee_id', 'user_id')
|
||||
def _compute_cashier(self):
|
||||
for order in self:
|
||||
if order.employee_id:
|
||||
order.cashier = order.employee_id.name
|
||||
else:
|
||||
order.cashier = order.user_id.name
|
||||
Loading…
Add table
Add a link
Reference in a new issue