2020-06-10 06:32:58 +02:00
|
|
|
# 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 decimal import Decimal
|
|
|
|
import operator
|
|
|
|
from trytond.pool import Pool, PoolMeta
|
|
|
|
from trytond.transaction import Transaction
|
|
|
|
|
|
|
|
__all__ = ['InvoiceLine']
|
|
|
|
|
|
|
|
|
|
|
|
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_latin_move_lines(self, amount, type_, account_stock_method):
|
|
|
|
# if type_.endswith('customer'):
|
|
|
|
# return []
|
|
|
|
#
|
|
|
|
# return super(InvoiceLine, self)._get_latin_move_lines(amount, type_, account_stock_method)
|
2020-06-10 06:32:58 +02:00
|
|
|
|
2020-06-10 14:28:23 +02:00
|
|
|
def get_move_lines(self):
|
|
|
|
Sale = Pool().get('sale.sale')
|
|
|
|
if self.origin:
|
|
|
|
Sale._create_productions([self.origin])
|
2020-06-10 06:32:58 +02:00
|
|
|
|
2020-06-10 14:28:23 +02:00
|
|
|
result = super(InvoiceLine, self).get_move_lines()
|
|
|
|
return result
|