trytonpsk-sale_pos_frontend.../invoice.py

39 lines
1.0 KiB
Python
Raw Normal View History

# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import Pool, PoolMeta
2022-02-07 18:51:53 +01:00
from trytond.model import fields
2022-02-07 18:53:54 +01:00
from trytond.pyson import Eval
2022-02-07 18:51:53 +01:00
KIND = [
('', ''),
('take_away', 'Take Away'),
('delivery', 'Delivery'),
('to_table', 'To Table')
]
class Invoice(metaclass=PoolMeta):
__name__ = 'account.invoice'
2022-02-07 18:54:42 +01:00
sale_kind = fields.Selection(KIND, 'Sale Kind', states={'invisible': Eval('type') != 'out'})
2022-02-07 18:51:53 +01:00
@classmethod
def __setup__(cls):
super(Invoice, cls).__setup__()
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
@classmethod
def __setup__(cls):
super(InvoiceLine, cls).__setup__()
2020-06-10 14:28:23 +02:00
def get_move_lines(self):
2021-04-16 00:12:53 +02:00
Sale = Pool().get('sale.sale')
2020-06-10 22:26:41 +02:00
if self.origin and self.invoice.type == 'out':
2022-02-10 13:41:00 +01:00
# Sale._create_productions([self.origin])
2021-04-15 23:53:45 +02:00
pass
2020-06-10 14:28:23 +02:00
result = super(InvoiceLine, self).get_move_lines()
return result