Merge invoice and credit note

issue5225
review18921002
This commit is contained in:
Cédric Krier committed 2016-03-20 22:59:23 +01:00
1 parent b4091f016b
commit ecfed9bad4
2 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -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']
@@ -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