Skip to content
Snippets Groups Projects

Topic/13.0/tg 204

Closed Etienne Ferriere requested to merge topic/13.0/TG-204 into branch/13.0
3 files
+ 10
3
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 12
10
@@ -104,17 +104,19 @@ class AccountFiscalyear(models.Model):
if not config_fy_day and not config_fy_month:
return
ed = self.date_stop
if str(ed.month) != config_fy_month or ed.day != config_fy_day:
raise ValidationError(
_(
"The end date must match the fiscal "
"year general config (%s/%s)"
for fy in self:
ed = fy.date_stop
if str(ed.month) != config_fy_month or ed.day != config_fy_day:
raise ValidationError(
_(
"The end date must match the fiscal "
"year general config (%s/%s)"
)
% (config_fy_month, config_fy_day)
)
% (config_fy_month, config_fy_day)
)
def create_period(self):
def create_period(self, code="%s"):
""" Call by the "Create Periods" Button.
This function use "date_stop" field to generate
@@ -137,7 +139,7 @@ class AccountFiscalyear(models.Model):
0,
{
"name": sd.strftime("%m/%Y"),
"code": sd.strftime("%m/%Y"),
"code": code % sd.strftime("%m/%Y"),
"date_start": sd,
"date_stop": period_ed,
},
Loading