# 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 from trytond.model import fields from trytond.pyson import Eval KIND = [ ('', ''), ('take_away', 'Take Away'), ('delivery', 'Delivery'), ('to_table', 'To Table') ] class Invoice(metaclass=PoolMeta): __name__ = 'account.invoice' sale_kind = fields.Selection(KIND, 'Sale Kind', states={'invisible': Eval('type') != 'out'}) @classmethod def __setup__(cls): super(Invoice, cls).__setup__() class InvoiceLine(metaclass=PoolMeta): __name__ = 'account.invoice.line' @classmethod def __setup__(cls): super(InvoiceLine, cls).__setup__() def get_move_lines(self): Sale = Pool().get('sale.sale') if self.origin and self.invoice.type == 'out': # Sale._create_productions([self.origin]) pass result = super(InvoiceLine, self).get_move_lines() return result