From 77df066d6d84f8dc9147abbe2c7e31e93ac92281 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Fri, 11 Dec 2020 18:05:26 +0100 Subject: [PATCH] [12.0][FIX] date_invoice -> date --- .../models/intrastat_product_declaration.py | 10 ++++++---- intrastat_product/readme/ROADMAP.rst | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 intrastat_product/readme/ROADMAP.rst diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index 75a9f43..54656fc 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -336,7 +336,7 @@ class IntrastatProductDeclaration(models.Model): invoice = inv_line.invoice_id amount = invoice.currency_id._convert( inv_line.price_subtotal, self.company_id.currency_id, - self.company_id, invoice.date_invoice) + self.company_id, invoice.date) return amount def _get_region(self, inv_line): @@ -449,12 +449,14 @@ class IntrastatProductDeclaration(models.Model): Complete this method in the localization module with the country-specific logic for arrivals and dispatches. Cf. l10n_be_intrastat_product_declaration for an example + The dates are based on account.invoice,date in stead of date_invoice + to ensure consistency between intrastat and intracomm tax declaration. """ start_date = date(int(self.year), self.month, 1) end_date = start_date + relativedelta(day=1, months=+1, days=-1) domain = [ - ('date_invoice', '>=', start_date), - ('date_invoice', '<=', end_date), + ('date', '>=', start_date), + ('date', '<=', end_date), ('state', 'in', ['open', 'in_payment', 'paid']), ('intrastat_country', '=', True), ('company_id', '=', self.company_id.id)] @@ -497,7 +499,7 @@ class IntrastatProductDeclaration(models.Model): inv_line.price_subtotal, self.company_id.currency_id, self.company_id, - invoice.date_invoice) + invoice.date) total_inv_accessory_costs_cc += acost continue diff --git a/intrastat_product/readme/ROADMAP.rst b/intrastat_product/readme/ROADMAP.rst new file mode 100644 index 0000000..6f75021 --- /dev/null +++ b/intrastat_product/readme/ROADMAP.rst @@ -0,0 +1,3 @@ +The declaration is based upon the invoices of the corresponding tax declaration period. + +An option to generate the intrastat declaration based upon the dates of the physical movements of goods is currently not available.