Merge lp:~therp-nl/account-analytic/6.1-account_analytic_required_i18n_nl into lp:account-analytic/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 13
Proposed branch: lp:~therp-nl/account-analytic/6.1-account_analytic_required_i18n_nl
Merge into: lp:account-analytic/6.1
Diff against target: 138 lines (+105/-4)
3 files modified
account_analytic_required/account.py (+14/-2)
account_analytic_required/i18n/account_analytic_required.pot (+13/-2)
account_analytic_required/i18n/nl.po (+78/-0)
To merge this branch: bzr merge lp:~therp-nl/account-analytic/6.1-account_analytic_required_i18n_nl
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review, no test Approve
Review via email: mp+159727@code.launchpad.net

Description of the change

The most important translation string of the module, containing the error message shown to the user if a required analytic account is missing, does not occur in generated po files for the module. The reason is that the substitution arguments are included in the _() call. This branch moves the arguments out of the call, updates the pot file and adds Dutch translations for this very useful module.

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_analytic_required/account.py'
2--- account_analytic_required/account.py 2012-12-20 14:20:55 +0000
3+++ account_analytic_required/account.py 2013-04-18 21:09:25 +0000
4@@ -50,10 +50,22 @@
5 if 'account_id' in vals and (vals.get('debit', 0.0) != 0.0 or vals.get('credit', 0.0) != 0.0):
6 account = self.pool.get('account.account').browse(cr, uid, vals['account_id'], context=context)
7 if account.user_type.analytic_policy == 'always' and not vals.get('analytic_account_id', False):
8- raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'." % (account.code, account.name, vals.get('name', False))))
9+ raise osv.except_osv(
10+ _('Error :'),
11+ _("Analytic policy is set to 'Always' with account %s '%s' "
12+ "but the analytic account is missing in the account move "
13+ "line with label '%s'.") % (
14+ account.code, account.name, vals.get('name', False)))
15 elif account.user_type.analytic_policy == 'never' and vals.get('analytic_account_id', False):
16 cur_analytic_account = self.pool.get('account.analytic.account').read(cr, uid, vals['analytic_account_id'], ['name', 'code'], context=context)
17- raise osv.except_osv(_('Error :'), _("Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'." % (account.code, account.name, vals.get('name', False), cur_analytic_account['code'], cur_analytic_account['name'])))
18+ raise osv.except_osv(
19+ _('Error :'),
20+ _("Analytic policy is set to 'Never' with account %s '%s' "
21+ "but the account move line with label '%s' has an "
22+ "analytic account %s '%s'.") % (
23+ account.code, account.name, vals.get('name', False),
24+ cur_analytic_account['code'],
25+ cur_analytic_account['name']))
26 return True
27
28 def create(self, cr, uid, vals, context=None, check=True):
29
30=== modified file 'account_analytic_required/i18n/account_analytic_required.pot'
31--- account_analytic_required/i18n/account_analytic_required.pot 2012-11-21 08:56:48 +0000
32+++ account_analytic_required/i18n/account_analytic_required.pot 2013-04-18 21:09:25 +0000
33@@ -86,9 +86,20 @@
34 msgstr ""
35
36 #. module: account_analytic_required
37-#: code:addons/account_analytic_required/account.py:53
38-#: code:addons/account_analytic_required/account.py:56
39+#: code:addons/account_analytic_required/account.py:54
40+#: code:addons/account_analytic_required/account.py:62
41 #, python-format
42 msgid "Error :"
43 msgstr ""
44
45+#. module: account_analytic_required
46+#: code:addons/account_analytic_required/account.py:55
47+#, python-format
48+msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'."
49+msgstr ""
50+
51+#. module: account_analytic_required
52+#: code:addons/account_analytic_required/account.py:63
53+#, python-format
54+msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'."
55+msgstr ""
56
57=== added file 'account_analytic_required/i18n/nl.po'
58--- account_analytic_required/i18n/nl.po 1970-01-01 00:00:00 +0000
59+++ account_analytic_required/i18n/nl.po 2013-04-18 21:09:25 +0000
60@@ -0,0 +1,78 @@
61+# Translation of OpenERP Server.
62+# This file contains the translation of the following modules:
63+# * account_analytic_required
64+#
65+msgid ""
66+msgstr ""
67+"Project-Id-Version: OpenERP Server 6.1\n"
68+"Report-Msgid-Bugs-To: support@openerp.com\n"
69+"POT-Creation-Date: 2011-06-10 07:49+0000\n"
70+"PO-Revision-Date: 2013-04-17 07:49+0000\n"
71+"Last-Translator: <stefan@therp.nl>\n"
72+"Language-Team: \n"
73+"MIME-Version: 1.0\n"
74+"Content-Type: text/plain; charset=UTF-8\n"
75+"Content-Transfer-Encoding: \n"
76+"Plural-Forms: \n"
77+
78+#. module: account_analytic_required
79+#: field:account.account.type,analytic_policy:0
80+msgid "Policy for analytic account"
81+msgstr "Kostenplaatsenbeleid"
82+
83+#. module: account_analytic_required
84+#: help:account.account.type,analytic_policy:0
85+msgid "Set the policy for analytic accounts : if you select 'Optional', the accountant is free to put an analytic account on an account move line with this type of account ; if you select 'Always', the accountant will get an error message if there is no analytic account ; if you select 'Never', the accountant will get an error message if an analytic account is present."
86+msgstr "Stel het beleid in voor kostenplaatsen: bij 'Altijd' is het opgeven van een kostenplaats verplicht bij rekeningen van dit type. 'Nooit': er treedt een foutmelding op als er bij een boeking een kostenplaats wordt opgegeven. 'Optioneel': het staat de medewerker vrij om al dan niet een kostenplaats op te geven."
87+
88+#. module: account_analytic_required
89+#: selection:account.account.type,analytic_policy:0
90+msgid "Optional"
91+msgstr "Optioneel"
92+
93+#. module: account_analytic_required
94+#: model:ir.module.module,description:account_analytic_required.module_meta_information
95+msgid "This module adds an option 'analytic policy' on account types. You have the choice between 3 policies : always, never and optional.\n"
96+"\n"
97+"For example, if you want to have an analytic account on all your expenses, set the policy to 'always' for the account type 'expense' ; then, if you try to save an account move line with an account of type 'expense' without analytic account, you will get an error message.\n"
98+"\n"
99+"Module developped by Alexis de Lattre <alexis.delattre@akretion.com> during the Akretion-Camptocamp code sprint of June 2011.\n"
100+msgstr "Deze module voegt de optie 'Beleid kostenplaatsen' toe aan rekeningcategorieën. Er zijn drie mogelijkheden: altijd, nooit en optioneel.\n"
101+"\n"
102+"Bij voorbeeld, als je wilt afdwingen dat er altijd een kostenplaats wordt opgegeven bij boekingen op een kostenrekening, zet dan het beleid op 'altijd' voor het rekeningtype 'Kosten'. Vanaf dat moment krijgt de medewerker een foutmelding als er geprobeerd wordt om een boeking te maken op een rekening van dit type zonder dat er een kostenplaats is opgegeven.\n"
103+"\n"
104+"Deze module is ontwikkeld door Alexis de Lattre <alexis.delattre@akretion.com> tijdens de Akretion-Camptocamp code sprint van juni 2011.\n"
105+
106+#. module: account_analytic_required
107+#: selection:account.account.type,analytic_policy:0
108+msgid "Always"
109+msgstr "Altijd"
110+
111+#. module: account_analytic_required
112+#: selection:account.account.type,analytic_policy:0
113+msgid "Never"
114+msgstr "Nooit"
115+
116+#. module: account_analytic_required
117+#: model:ir.module.module,shortdesc:account_analytic_required.module_meta_information
118+msgid "Account analytic required"
119+msgstr "Kostenplaatsenbeleid"
120+
121+#. module: account_analytic_required
122+#: code:addons/account_analytic_required/account.py:54
123+#: code:addons/account_analytic_required/account.py:62
124+#, python-format
125+msgid "Error :"
126+msgstr "Fout:"
127+
128+#. module: account_analytic_required
129+#: code:addons/account_analytic_required/account.py:55
130+#, python-format
131+msgid "Analytic policy is set to 'Always' with account %s '%s' but the analytic account is missing in the account move line with label '%s'."
132+msgstr "Het is verplicht een kostenplaats op te geven bij boekingen op rekening %s '%s', maar deze ontbreekt in de boekingsregel met de omschrijving '%s'."
133+
134+#. module: account_analytic_required
135+#: code:addons/account_analytic_required/account.py:63
136+#, python-format
137+msgid "Analytic policy is set to 'Never' with account %s '%s' but the account move line with label '%s' has an analytic account %s '%s'."
138+msgstr "Het is niet toegestaan om een kostenplaats op te geven bij boekingen op rekening %s '%s', maar in boekingsregel met de omschrijving '%s' staat toch de kostenplaats %s '%s'."

Subscribers

People subscribed via source and target branches

to status/vote changes: