Files
tryton/tests/tools.py
T
Cédric Krier ff0a261389 Allow to define many relativedelta on payment term
Replace the set of fields defined on payment term line by a list of
relativedelta containing the same set of fields.

issue4573
review6911002
2015-03-02 23:28:12 +01:00

29 lines
1011 B
Python

# 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 proteus import Model
__all__ = ['set_fiscalyear_invoice_sequences']
def set_fiscalyear_invoice_sequences(fiscalyear, config=None):
"Set invoice sequences to fiscalyear"
SequenceStrict = Model.get('ir.sequence.strict', config=config)
invoice_seq = SequenceStrict(name=fiscalyear.name, code='account.invoice',
company=fiscalyear.company)
invoice_seq.save()
fiscalyear.out_invoice_sequence = invoice_seq
fiscalyear.in_invoice_sequence = invoice_seq
fiscalyear.out_credit_note_sequence = invoice_seq
fiscalyear.in_credit_note_sequence = invoice_seq
return fiscalyear
def create_payment_term(config=None):
"Create a direct payment term"
PaymentTerm = Model.get('account.invoice.payment_term')
payment_term = PaymentTerm(name='Direct')
payment_term.lines.new(type='remainder')
return payment_term