Skip to content
Snippets Groups Projects

Add 'period_id' in form view, add tests about it and update translations

Merged aronabencherif.diatta@xcg.africa requested to merge topic/16.0/2023-01855 into branch/16.0
@@ -20,7 +20,7 @@
from freezegun import freeze_time
from odoo import Command, fields
from odoo import Command, fields, tools
from odoo.tests import tagged
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
@@ -97,7 +97,24 @@
)
self._post_move_and_check_states(move_2022)
self.assertEqual(move_2022.date, date_2022)
self.assertFalse(
move_2022.is_sale_document(include_receipts=True), "Move type is 'entry'"
)
highest_name = move_2022.highest_name or move_2022._get_last_sequence(
relaxed=True, lock=False
)
self.assertTrue(highest_name, "The highest name of the movement is defined")
number_reset = move_2022._deduce_sequence_number_reset(highest_name)
self.assertEqual(
number_reset, "month", "The highest name of the movement include the month"
)
move_date = tools.date_utils.get_month(date_2022)[1]
self.assertEqual(
move_2022.date, move_date, "Move date is set to the last day of this month"
)
self.assertEqual(move_2022.period_id.id, period_2022.id)
# Ensure period selection around midnight follows timezone.
@@ -140,7 +157,7 @@
{
"account_id": self.account.id,
"partner_id": self.partner.id,
"credit": 55.0,
"credit": amount,
}
),
],
Loading