adapt to 4.8, test not working yet

This commit is contained in:
?ngel ?lvarez 2019-01-04 09:37:23 +01:00
parent 5b2832b5e2
commit 3fa42fbb77
4 changed files with 15 additions and 10 deletions

View File

@ -1,13 +1,16 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from trytond.pool import Pool
from .payment import *
from .statement import *
from . import payment
from . import statement
def register():
Pool.register(
Journal,
Payment,
StatementMoveLine,
payment.Journal,
payment.Payment,
module='account_payment_processing', type_='model')
Pool.register(
statement.StatementMoveLine,
depends='account_bank_statement_payment',
module='account_payment_processing', type_='model')

View File

@ -47,7 +47,7 @@ class Payment:
if move:
moves.append(move)
if moves:
moves = Move.create([m._save_values for m in moves])
Move.save(moves)
cls.write(*sum((([m.origin], {'processing_move': m.id})
for m in moves), ()))
Move.post(moves)
@ -79,6 +79,7 @@ class Payment:
if (not self.journal.processing_account
or not self.journal.processing_journal):
return
if self.processing_move:
return self.processing_move

View File

@ -67,7 +67,7 @@ Create chart of accounts::
... type=receivable.type,
... bank_reconcile=True,
... reconcile=True,
... party_required=True,
... party_required=False,
... deferral=True,
... kind='other')
>>> customer_bank_discounts.save()
@ -139,7 +139,7 @@ Create payment term::
Create customer invoice::
>>> Invoice = Model.get('account.invoice')
>>> customer_invoice = Invoice(type='out_invoice')
>>> customer_invoice = Invoice(type='out')
>>> customer_invoice.party = customer
>>> customer_invoice.payment_term = payment_term
>>> invoice_line = customer_invoice.lines.new()
@ -159,7 +159,8 @@ Create customer invoice payment::
... if l.account == receivable]
>>> pay_line = Wizard('account.move.line.pay', [line])
>>> pay_line.form.journal = payment_receivable_100_journal
>>> pay_line.execute('pay')
>>> pay_line.form.approve = False
>>> pay_line.execute('start')
>>> payment, = Payment.find([('state', '=', 'draft')])
>>> payment.amount
Decimal('100.00')

View File

@ -1,5 +1,5 @@
[tryton]
version=3.4.0
version=4.7.0
depends:
account_payment
account_payment_clearing