From ecfed9bad4796a45e730993b49db44606023bdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 20 Mar 2016 22:59:23 +0100 Subject: [PATCH] Merge invoice and credit note issue5225 review18921002 --- purchase.py | 4 ++-- tests/scenario_purchase_invoice_line_standalone.rst | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/purchase.py b/purchase.py index 45ec1ecd86..f5573fb965 100644 --- a/purchase.py +++ b/purchase.py @@ -43,12 +43,12 @@ class Purchase: def search_invoice_lines(cls, name, clause): return [('lines.invoice_lines',) + tuple(clause[1:])] - def create_invoice(self, invoice_type): + def create_invoice(self): pool = Pool() Invoice = pool.get('account.invoice') InvoiceLine = pool.get('account.invoice.line') - invoice = super(Purchase, self).create_invoice(invoice_type) + invoice = super(Purchase, self).create_invoice() if invoice: lines_to_delete = [l for l in invoice.lines if l.type != 'line'] diff --git a/tests/scenario_purchase_invoice_line_standalone.rst b/tests/scenario_purchase_invoice_line_standalone.rst index b4533f5e57..453375629a 100644 --- a/tests/scenario_purchase_invoice_line_standalone.rst +++ b/tests/scenario_purchase_invoice_line_standalone.rst @@ -137,13 +137,15 @@ Purchase 5 products:: 0 >>> len(purchase.invoices) 0 + >>> len(purchase.invoice_lines) + 3 Create a supplier invoice:: >>> Invoice = Model.get('account.invoice') >>> invoice = Invoice() - >>> invoice.type = 'in_invoice' + >>> invoice.type = 'in' >>> invoice.party = supplier >>> len(invoice.lines.find()) 3 @@ -159,7 +161,7 @@ Create a supplier invoice with an accountant:: >>> supplier, = Partner.find([('name', '=', 'Supplier')]) >>> invoice = Invoice() - >>> invoice.type = 'in_invoice' + >>> invoice.type = 'in' >>> invoice.party = supplier >>> len(invoice.lines.find()) 2