Allow to export FEC on draft fiscal year
The filename is generated only on locked fiscal year as it is the only official export. issue5306 review43091003
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* Allow to export FEC on draft fiscalyear
|
||||
|
||||
Version 4.6.0 - 2017-10-30
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
|
||||
+9
-8
@@ -127,10 +127,13 @@ class AccountFrFEC(Wizard):
|
||||
file_ = self.result.file
|
||||
self.result.file = None # No need to store it in session
|
||||
format_date = self.get_format_date()
|
||||
filename = '%sFEC%s.csv' % (
|
||||
self.start.fiscalyear.company.party.siren or '',
|
||||
format_date(self.start.fiscalyear.end_date),
|
||||
)
|
||||
if self.start.fiscalyear.state == 'locked':
|
||||
filename = '%sFEC%s.csv' % (
|
||||
self.start.fiscalyear.company.party.siren or '',
|
||||
format_date(self.start.fiscalyear.end_date),
|
||||
)
|
||||
else:
|
||||
filename = None
|
||||
return {
|
||||
'file': file_,
|
||||
'filename': filename,
|
||||
@@ -294,10 +297,8 @@ class AccountFrFECStart(ModelView):
|
||||
'Generate FEC'
|
||||
__name__ = 'account.fr.fec.start'
|
||||
|
||||
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
|
||||
required=True, domain=[
|
||||
('state', '=', 'close'),
|
||||
])
|
||||
fiscalyear = fields.Many2One(
|
||||
'account.fiscalyear', 'Fiscal Year', required=True)
|
||||
type = fields.Selection([
|
||||
('is-bic', 'IS-BIC'),
|
||||
], 'Type', required=True)
|
||||
|
||||
@@ -79,7 +79,6 @@ Generate FEC::
|
||||
>>> FEC.form.fiscalyear = fiscalyear
|
||||
>>> FEC.form.deferral_journal = deferral_journal
|
||||
>>> FEC.execute('generate')
|
||||
>>> bool(FEC.form.filename)
|
||||
True
|
||||
>>> FEC.form.filename
|
||||
>>> bool(FEC.form.file)
|
||||
True
|
||||
|
||||
Reference in New Issue
Block a user