diff --git a/l10n_it_intrastat_statement/models/intrastat_statement.py b/l10n_it_intrastat_statement/models/intrastat_statement.py index 4186ee6762ce..38005e62e51b 100644 --- a/l10n_it_intrastat_statement/models/intrastat_statement.py +++ b/l10n_it_intrastat_statement/models/intrastat_statement.py @@ -764,8 +764,8 @@ def compute_statement(self): # Search intrastat lines domain = [ - ("invoice_date", ">=", period_date_start), - ("invoice_date", "<=", period_date_stop), + ("date", ">=", period_date_start), + ("date", "<=", period_date_stop), ("intrastat", "=", True), ] inv_type = [] diff --git a/l10n_it_intrastat_statement/tests/test_intrastat_statement.py b/l10n_it_intrastat_statement/tests/test_intrastat_statement.py index da405a307284..cc1ff197db76 100644 --- a/l10n_it_intrastat_statement/tests/test_intrastat_statement.py +++ b/l10n_it_intrastat_statement/tests/test_intrastat_statement.py @@ -121,8 +121,8 @@ def test_statement_sale(self): statement = self.statement_model.create( { - "period_number": invoice.invoice_date.month, - "fiscalyear": invoice.invoice_date.year, + "period_number": invoice.date.month, + "fiscalyear": invoice.date.year, } ) @@ -140,13 +140,13 @@ def test_statement_sale(self): def test_statement_sale_quarter(self): invoice = self._get_intrastat_computed_invoice() - month = invoice.invoice_date.month + month = invoice.date.month quarter = 1 + (month - 1) // 3 statement = self.statement_model.create( { "period_number": quarter, "period_type": "T", - "fiscalyear": invoice.invoice_date.year, + "fiscalyear": invoice.date.year, } ) @@ -162,8 +162,8 @@ def test_statement_purchase(self): statement = self.statement_model.create( { - "period_number": bill.invoice_date.month, - "fiscalyear": bill.invoice_date.year, + "period_number": bill.date.month, + "fiscalyear": bill.date.year, } ) @@ -184,8 +184,8 @@ def test_statement_purchase_currency(self): statement = self.statement_model.create( { - "period_number": bill.invoice_date.month, - "fiscalyear": bill.invoice_date.year, + "period_number": bill.date.month, + "fiscalyear": bill.date.year, } ) @@ -210,8 +210,8 @@ def test_statement_purchase_refund(self): statement = self.statement_model.create( { - "period_number": bill_refund.invoice_date.month, - "fiscalyear": bill_refund.invoice_date.year, + "period_number": bill_refund.date.month, + "fiscalyear": bill_refund.date.year, } ) @@ -249,8 +249,8 @@ def test_statement_purchase_refund_no_subtract(self): statement = self.statement_model.create( { - "period_number": bill_refund.invoice_date.month, - "fiscalyear": bill_refund.invoice_date.year, + "period_number": bill_refund.date.month, + "fiscalyear": bill_refund.date.year, } ) @@ -288,8 +288,8 @@ def test_statement_purchase_service_refund_no_subtract(self): statement = self.statement_model.create( { - "period_number": bill_refund.invoice_date.month, - "fiscalyear": bill_refund.invoice_date.year, + "period_number": bill_refund.date.month, + "fiscalyear": bill_refund.date.year, } ) @@ -326,13 +326,13 @@ def test_statement_purchase_service_refund_no_subtract(self): def test_statement_purchase_quarter(self): bill = self._get_intrastat_computed_bill() - month = bill.invoice_date.month + month = bill.date.month quarter = 1 + (month - 1) // 3 statement = self.statement_model.create( { "period_number": quarter, "period_type": "T", - "fiscalyear": bill.invoice_date.year, + "fiscalyear": bill.date.year, } ) @@ -348,8 +348,8 @@ def test_statement_export_file(self): statement = self.statement_model.create( { - "period_number": invoice.invoice_date.month, - "fiscalyear": invoice.invoice_date.year, + "period_number": invoice.date.month, + "fiscalyear": invoice.date.year, } ) statement.compute_statement() @@ -369,8 +369,8 @@ def test_purchase_default_transaction_nature(self): statement = self.statement_model.create( { - "period_number": bill.invoice_date.month, - "fiscalyear": bill.invoice_date.year, + "period_number": bill.date.month, + "fiscalyear": bill.date.year, } ) line = statement.purchase_section1_ids.create({}) @@ -385,8 +385,8 @@ def test_sale_default_transaction_nature(self): statement = self.statement_model.create( { - "period_number": invoice.invoice_date.month, - "fiscalyear": invoice.invoice_date.year, + "period_number": invoice.date.month, + "fiscalyear": invoice.date.year, } ) @@ -404,8 +404,8 @@ def test_statement_sale_round_up_amounts(self): statement = self.statement_model.create( { - "period_number": invoice.invoice_date.month, - "fiscalyear": invoice.invoice_date.year, + "period_number": invoice.date.month, + "fiscalyear": invoice.date.year, } ) statement.compute_statement() @@ -423,8 +423,8 @@ def test_statement_sale_round_down_amounts(self): statement = self.statement_model.create( { - "period_number": invoice.invoice_date.month, - "fiscalyear": invoice.invoice_date.year, + "period_number": invoice.date.month, + "fiscalyear": invoice.date.year, } ) statement.compute_statement() @@ -446,8 +446,8 @@ def test_statement_purchase_round_up_amounts(self): statement = self.statement_model.create( { - "period_number": bill.invoice_date.month, - "fiscalyear": bill.invoice_date.year, + "period_number": bill.date.month, + "fiscalyear": bill.date.year, } ) statement.compute_statement() @@ -478,8 +478,8 @@ def test_statement_purchase_round_down_amounts(self): statement = self.statement_model.create( { - "period_number": bill.invoice_date.month, - "fiscalyear": bill.invoice_date.year, + "period_number": bill.date.month, + "fiscalyear": bill.date.year, } ) statement.compute_statement()