Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] stock_card_report: freeze datetime #343

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions stock_card_report/tests/test_stock_card_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from datetime import date

import pytz
from freezegun import freeze_time

from odoo import fields
from odoo import Command, fields
from odoo.tests import common, tagged
from odoo.tools import test_reports

Expand Down Expand Up @@ -124,11 +125,12 @@ def _getReportTitle(self):

def _getBaseFilters(self):
return {
"product_ids": [(6, 0, [self.product_A.id])],
"product_ids": [Command.set([self.product_A.id])],
"location_id": self.location_1.id,
}


@freeze_time("2022-02-01 00:00:00")
@tagged("post_install", "-at_install")
class TestStockCardReport(common.TransactionCase):
@classmethod
Expand Down Expand Up @@ -213,7 +215,7 @@ def setUpClass(cls):
def test_reports(self):
report = self.env["report.stock.card.report"].create(
{
"product_ids": [(6, 0, [self.product_A.id, self.product_B.id])],
"product_ids": [Command.set([self.product_A.id, self.product_B.id])],
"location_id": self.location_1.id,
}
)
Expand All @@ -238,7 +240,7 @@ def test_reports(self):
def test_get_report_html(self):
report = self.env["report.stock.card.report"].create(
{
"product_ids": [(6, 0, [self.product_A.id, self.product_B.id])],
"product_ids": [Command.set([self.product_A.id, self.product_B.id])],
"location_id": self.location_1.id,
}
)
Expand All @@ -263,7 +265,7 @@ def test_wizard_date_range(self):
"date_range_id": dt.id,
"date_from": time.strftime("%Y-%m-28"),
"date_to": time.strftime("%Y-%m-01"),
"product_ids": [(6, 0, [self.product_A.id, self.product_B.id])],
"product_ids": [Command.set([self.product_A.id, self.product_B.id])],
"location_id": self.location_1.id,
}
)
Expand Down
Loading