Merge lp:~camptocamp/openerp-french-localization/6.1-add-nonofficial-export-mdh into lp:openerp-french-localization/6.1

Proposed by Matthieu Dietrich @ camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openerp-french-localization/6.1-add-nonofficial-export-mdh
Merge into: lp:openerp-french-localization/6.1
Diff against target: 105 lines (+46/-1)
4 files modified
l10n_fr_fec/i18n/fr.po (+14/-0)
l10n_fr_fec/i18n/l10n_fr_fec.pot (+14/-0)
l10n_fr_fec/wizard/fec.py (+17/-1)
l10n_fr_fec/wizard/fec_view.xml (+1/-0)
To merge this branch: bzr merge lp:~camptocamp/openerp-french-localization/6.1-add-nonofficial-export-mdh
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+253948@code.launchpad.net

Commit message

[ADD] non-official version of the export, with unposted entries

Description of the change

This PR is to add a new option to the FEC wizard, "non-official", which creates a similar FEC file but with unposted entries. The goal is to allow exporting to other financial software which can use the FEC format.

The file is also renamed to mark that it is not the official report.

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

lgtm / :+1:

can you

review: Approve (code review, no test)

Unmerged revisions

6. By Matthieu Dietrich @ camptocamp

[ADD] non-official version of the export, with unposted entries

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_fr_fec/i18n/fr.po'
2--- l10n_fr_fec/i18n/fr.po 2014-03-25 17:10:43 +0000
3+++ l10n_fr_fec/i18n/fr.po 2015-03-24 10:50:39 +0000
4@@ -110,3 +110,17 @@
5 msgid "FEC is for French companies only !"
6 msgstr "Le FEC est uniquement pour les sociétés françaises !"
7
8+#. module: l10n_fr_fec
9+#: selection:account.fr.fec,export_type:0
10+msgid "Official FEC report (posted entries only)"
11+msgstr "Rapport FEC officiel (entrées postées uniquement)"
12+
13+#. module: l10n_fr_fec
14+#: selection:account.fr.fec,export_type:0
15+msgid "Non-official FEC report (posted and unposted entries)"
16+msgstr "Rapport FEC non-officiel (entrées postées et non-postées)"
17+
18+#. module: l10n_fr_fec
19+#: field:account.fr.fec,export_type:0
20+msgid "Export Type"
21+msgstr "Type d'export"
22
23=== modified file 'l10n_fr_fec/i18n/l10n_fr_fec.pot'
24--- l10n_fr_fec/i18n/l10n_fr_fec.pot 2014-03-25 17:10:43 +0000
25+++ l10n_fr_fec/i18n/l10n_fr_fec.pot 2015-03-24 10:50:39 +0000
26@@ -110,3 +110,17 @@
27 msgid "FEC is for French companies only !"
28 msgstr ""
29
30+#. module: l10n_fr_fec
31+#: selection:account.fr.fec,export_type:0
32+msgid "Official FEC report (posted entries only)"
33+msgstr ""
34+
35+#. module: l10n_fr_fec
36+#: selection:account.fr.fec,export_type:0
37+msgid "Non-official FEC report (posted and unposted entries)"
38+msgstr ""
39+
40+#. module: l10n_fr_fec
41+#: field:account.fr.fec,export_type:0
42+msgid "Export Type"
43+msgstr ""
44
45=== modified file 'l10n_fr_fec/wizard/fec.py'
46--- l10n_fr_fec/wizard/fec.py 2014-11-28 15:36:24 +0000
47+++ l10n_fr_fec/wizard/fec.py 2015-03-24 10:50:39 +0000
48@@ -43,11 +43,16 @@
49 ('draft', 'Draft'),
50 ('done', 'Done'),
51 ], 'State'),
52+ 'export_type': fields.selection([
53+ ('official', 'Official FEC report (posted entries only)'),
54+ ('nonofficial', 'Non-official FEC report (posted and unposted entries)'),
55+ ], 'Export Type', required=True),
56 }
57
58 _defaults = {
59 'state': 'draft',
60 'type': 'is_ir_bic',
61+ 'export_type': 'official',
62 }
63
64 def generate_fec(self, cr, uid, ids, context=None):
65@@ -119,9 +124,17 @@
66 LEFT JOIN res_currency rc ON rc.id = aml.currency_id
67 WHERE
68 am.period_id IN %s
69- AND am.state = 'posted'
70 AND am.company_id = %s
71 AND NOT (aml.credit = 0.0 AND aml.debit = 0.0)
72+ '''
73+
74+ # For official report: only use posted entries
75+ if cur_wiz.export_type == "official":
76+ sql_query += '''
77+ AND am.state = 'posted'
78+ '''
79+
80+ sql_query += '''
81 ORDER BY
82 am.date,
83 CASE aj.type WHEN 'situation' THEN 1 ELSE 2 END,
84@@ -169,6 +182,9 @@
85 _("FEC is for French companies only !"))
86 siren = company.vat.replace(' ','')[4:13]
87 fy_end_date = cur_wiz.fiscalyear_id.date_stop.replace('-', '')
88+ # Append "-NONOFFICIAL" to the file name
89+ if cur_wiz.export_type == "nonofficial":
90+ fy_end_date += "-NONOFFICIAL"
91 fecvalue = fecfile.getvalue()
92 self.write(cr, uid, ids, {
93 'state': 'done',
94
95=== modified file 'l10n_fr_fec/wizard/fec_view.xml'
96--- l10n_fr_fec/wizard/fec_view.xml 2014-03-26 15:00:07 +0000
97+++ l10n_fr_fec/wizard/fec_view.xml 2015-03-24 10:50:39 +0000
98@@ -16,6 +16,7 @@
99 <group states="draft" col="2">
100 <field name="fiscalyear_id" />
101 <field name="type"/>
102+ <field name="export_type"/>
103 </group>
104 <newline/>
105 <group states="done" col="2">

Subscribers

People subscribed via source and target branches