diff --git a/CHANGELOG b/CHANGELOG index 03c23984c7..127dabb353 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Use today as fallback for invoice date report + Version 4.8.0 - 2018-04-23 * Bug fixes (see mercurial logs for details) * Show invoice payment on Move Line diff --git a/invoice.fodt b/invoice.fodt index 158fe634c2..97ed8421ed 100644 --- a/invoice.fodt +++ b/invoice.fodt @@ -1,24 +1,24 @@ - LibreOffice/5.4.5.1$Linux_X86_64 LibreOffice_project/40m0$Build-12012-11-15T15:00:351P0D + LibreOffice/6.0.3.2$Linux_X86_64 LibreOffice_project/00m0$Build-22012-11-15T15:00:351P0D - 0 + 27940 0 54700 - 26672 + 27571 true false view2 - 19853 - 51310 + 23259 + 35426 0 - 0 + 27940 54698 - 26670 + 55510 0 1 false @@ -39,6 +39,7 @@ false false + true false false false @@ -71,7 +72,7 @@ false false true - 2786566 + 2903384 false true false @@ -640,9 +641,7 @@ </if> Description: <invoice.description or ''> Reference: <invoice.origins or ''><', ' if (invoice.reference and invoice.origins) else ''><invoice.reference or ''> - <if test="invoice.invoice_date"> - Date: <format_date(invoice.invoice_date, invoice.party.lang)> - </if> + Date: <format_date(invoice.invoice_date or today, invoice.party.lang)> <if test="invoice.tax_identifier"> <invoice.tax_identifier.type_string>: <invoice.tax_identifier.code> </if> @@ -747,9 +746,10 @@ - <format_currency(line.amount, invoice.party.lang, invoice.currency)> + <format_currency(line.amount, invoice.party.lang, invoice.currency)> + </when> diff --git a/invoice.py b/invoice.py index 43b91622d1..5b1025c4fb 100644 --- a/invoice.py +++ b/invoice.py @@ -2455,8 +2455,11 @@ class InvoiceReport(Report): @classmethod def get_context(cls, records, data): + pool = Pool() + Date = pool.get('ir.date') context = super(InvoiceReport, cls).get_context(records, data) context['invoice'] = context['record'] + context['today'] = Date.today() return context