[FIX] No bill name in annex_name field
This commit is contained in:
parent
9f8be7c000
commit
d6c61e137f
@ -123,10 +123,10 @@ class ContractOrderAnnex(models.Model, IDocument, Extension):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_name_by_document_template(self, document_template_id):
|
def get_name_by_document_template(self, document_template_id):
|
||||||
bill_name = None
|
active_invoices = self.order_id.invoice_ids.filtered(
|
||||||
for invoice in self.order_id.invoice_ids:
|
lambda r: r.state not in ("draft", "cancel")
|
||||||
bill_name = invoice.number
|
)
|
||||||
break
|
bill_name = active_invoices and active_invoices[-1].number
|
||||||
|
|
||||||
return (
|
return (
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user