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_valuation_layer_accounting_date: prevent tests failed for some timezone #2159

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

AungKoKoLin1997
Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 commented Sep 20, 2024

This fix is to address the issue for failing tests depending on timezone.

Related: #2139 (comment)
ping matt454357

@qrtl

@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as draft September 20, 2024 12:13
@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-imp-tests-stock-valuation_layer_accounting_date branch from b7b33fd to c1515f9 Compare September 20, 2024 12:16
@AungKoKoLin1997 AungKoKoLin1997 marked this pull request as ready for review September 20, 2024 12:16
Comment on lines 20 to 22
@freeze_time("2022-12-02")
def test_svl_accounting_date_real_time(self):
self.product1.product_tmpl_id.categ_id.property_valuation = "real_time"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be changing the intention of the test.

Suggested change
@freeze_time("2022-12-02")
def test_svl_accounting_date_real_time(self):
self.product1.product_tmpl_id.categ_id.property_valuation = "real_time"
@freeze_time("2022-12-02 23:00:00")
def test_svl_accounting_date_real_time(self):
self.product1.categ_id.property_valuation = "real_time"
self.env.user.tz = "Asia/Tokyo"

def test_svl_accounting_date_real_time(self):
self.product1.product_tmpl_id.categ_id.property_valuation = "real_time"
self._make_in_move(self.product1, 10)
valuation_layer = self.product1.stock_valuation_layer_ids
self.assertEqual(valuation_layer.accounting_date, date(2022, 12, 3))
self.assertEqual(valuation_layer.accounting_date, date(2022, 12, 2))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change.

@AungKoKoLin1997 AungKoKoLin1997 force-pushed the 16.0-imp-tests-stock-valuation_layer_accounting_date branch from c1515f9 to 9fbcafa Compare September 21, 2024 01:11
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@AungKoKoLin1997
Copy link
Contributor Author

@rousseldenis Can we get this PR merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants