[REF] account_move_name_sequence: Use Odoo native methods + Typos

This commit is contained in:
Francisco Javier Luna Vazquez
2022-05-26 09:26:12 -05:00
parent a22dbbba6c
commit 9b949617a0
7 changed files with 33 additions and 37 deletions

View File

@@ -6,8 +6,6 @@
import logging
from dateutil.relativedelta import relativedelta
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
@@ -222,7 +220,7 @@ class AccountJournal(models.Model):
year = "20" + year
if month:
date_from = fields.Date.to_date("%s-%s-1" % (year, month))
date_to = date_from + relativedelta(day=31)
date_to = fields.Date.end_of(date_from, "month")
else:
date_from = fields.Date.to_date("%s-1-1" % year)
date_to = fields.Date.to_date("%s-12-31" % year)