Merge lp:~julie-w/unifield-server/US-2659 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4424
Proposed branch: lp:~julie-w/unifield-server/US-2659
Merge into: lp:unifield-server
Diff against target: 252 lines (+162/-31)
2 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+80/-14)
bin/addons/res_currency_tables/res_currency.py (+82/-17)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-2659
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+327505@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
2--- bin/addons/msf_profile/i18n/fr_MF.po 2017-07-06 14:23:27 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2017-07-17 07:08:42 +0000
4@@ -10552,12 +10552,6 @@
5 msgid " Code: %s"
6 msgstr " Code: %s"
7
8-#. module: res_currency_tables
9-#: code:addons/res_currency_tables/res_currency.py:215
10-#, python-format
11-msgid "The currency you want to %s is currently used on at least one sale order or purchase order."
12-msgstr "La devise que vous désirez %s est utilisée par au moins une commande client ou un bon de commande"
13-
14 #. modules: stock_override, product_list, stock
15 #: view:product.list:0
16 #: field:product.list,location_id:0
17@@ -25401,7 +25395,7 @@
18 #: code:addons/res_currency_tables/res_currency.py:215
19 #: code:addons/res_currency_tables/res_currency.py:232
20 #, python-format
21-msgid "Currency currently used !"
22+msgid "Currency currently used!"
23 msgstr "Devise actuellement utilisée !"
24
25 #. module: consumption_calculation
26@@ -88271,7 +88265,7 @@
27 #: code:addons/res_currency_tables/res_currency.py:232
28 #, python-format
29 msgid "The currency cannot be deleted as one or more journal items are currently using it!"
30-msgstr "The currency cannot be deleted as one or more journal items are currently using it!"
31+msgstr "La devise ne peut pas être supprimée car au moins une ligne d'écriture comptable l'utilise."
32
33 #. module: sync_client
34 #: field:ir.model.data,last_modification:0
35@@ -94941,12 +94935,6 @@
36 msgid "# lines"
37 msgstr "# de lignes"
38
39-#. module: res_currency_tables
40-#: code:addons/res_currency_tables/res_currency.py:211
41-#, python-format
42-msgid "The currency you want to %s is currently used on at least one partner form."
43-msgstr "La devise que vous désirez %s est utilisée par au moins un formulaire partenaire."
44-
45 #. module: account
46 #: help:account.chart.template,property_reserve_and_surplus_account:0
47 msgid "This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss: Amount will be deducted.), Which is calculated from Profilt & Loss Report"
48@@ -98688,3 +98676,81 @@
49 #, python-format
50 msgid "Warning, you have removed header value source location! The lines will be re-set to have 'Other Supplier' as the source location. Please check this is correct!"
51 msgstr "Attention, vous avez supprimé la zone source d'en-tête! La zone source des lignes va être réinitialisée avec la valeur 'Autre Fournisseur'. Merci de vérifier leur cohérence!"
52+
53+#. module: res_currency_tables
54+#: code:addons/res_currency_tables/res_currency.py:0
55+#, python-format
56+msgid "delete"
57+msgstr "supprimer"
58+
59+#. module: res_currency_tables
60+#: code:addons/res_currency_tables/res_currency.py:0
61+#, python-format
62+msgid "de-activate"
63+msgstr "désactiver"
64+
65+#. module: res_currency_tables
66+#: code:addons/res_currency_tables/res_currency.py:225
67+#, python-format
68+msgid "The currency you want to %s is used in at least one active partner form."
69+msgstr "La devise que vous désirez %s est utilisée dans au moins un formulaire d'un partenaire actif."
70+
71+#. module: res_currency_tables
72+#: code:addons/res_currency_tables/res_currency.py:216
73+#, python-format
74+msgid "The currency you want to %s is used in at least one Field Order which isn't Closed."
75+msgstr "La devise que vous désirez %s est utilisée dans au moins une Commande de Terrain qui n'est pas Clôturée."
76+
77+#. module: res_currency_tables
78+#: code:addons/res_currency_tables/res_currency.py:216
79+#, python-format
80+msgid "The currency you want to %s is used in at least one Purchase Order which isn't Closed."
81+msgstr "La devise que vous désirez %s est utilisée dans au moins un Bon de Commande qui n'est pas Clôturé."
82+
83+#. module: res_currency_tables
84+#: code:addons/res_currency_tables/res_currency.py:230
85+#, python-format
86+msgid "The currency you want to %s is used in at least one document in Draft or Open state."
87+msgstr "La devise que vous désirez %s est utilisée dans au moins un document à l'état Brouillon ou Ouvert."
88+
89+#. module: res_currency_tables
90+#: code:addons/res_currency_tables/res_currency.py:256
91+#, python-format
92+msgid "The currency you want to %s is used in at least one Register in Draft or Open state."
93+msgstr "La devise que vous désirez %s est utilisée dans au moins un Registre à l'état Brouillon ou Ouvert."
94+
95+#. module: res_currency_tables
96+#: code:addons/res_currency_tables/res_currency.py:236
97+#, python-format
98+msgid "The currency you want to %s is used in at least one Journal Item in Unposted state."
99+msgstr "La devise que vous désirez %s est utilisée dans au moins une Ligne d'écriture comptable non comptabilisée."
100+
101+#. module: res_currency_tables
102+#: code:addons/res_currency_tables/res_currency.py:263
103+#, python-format
104+msgid "The currency you want to %s is used in at least one Recurring Entry having a state not Done."
105+msgstr "La devise que vous désirez %s est utilisée dans au moins une Ecriture Périodique avec un statut non Terminé."
106+
107+#. module: res_currency_tables
108+#: code:addons/res_currency_tables/res_currency.py:240
109+#, python-format
110+msgid "The currency you want to %s is used in at least one Commitment Voucher which isn't Done."
111+msgstr "La devise que vous désirez %s est utilisée dans un moins un Bon d'Engagement non Terminé."
112+
113+#. module: res_currency_tables
114+#: code:addons/res_currency_tables/res_currency.py:244
115+#, python-format
116+msgid "The currency you want to %s is used in at least one HQ Entry which isn't validated."
117+msgstr "La devise que vous désirez %s est utilisée dans au moins une Ecriture HQ non validée."
118+
119+#. module: res_currency_tables
120+#: code:addons/res_currency_tables/res_currency.py:272
121+#, python-format
122+msgid "The currency you want to %s is used in at least one Draft or Partially Posted Accrual Line."
123+msgstr "La devise que vous désirez %s est utilisée dans au moins une Ligne de Régularisation à l'état Brouillon ou Partiellement Comptabilisée."
124+
125+#. module: res_currency_tables
126+#: code:addons/res_currency_tables/res_currency.py:249
127+#, python-format
128+msgid "The currency you want to %s is used in at least one Payroll Entry which isn't validated."
129+msgstr "La devise que vous désirez %s est utilisée dans au moins une Ecriture de Paie non validée."
130
131=== modified file 'bin/addons/res_currency_tables/res_currency.py'
132--- bin/addons/res_currency_tables/res_currency.py 2017-01-31 11:13:35 +0000
133+++ bin/addons/res_currency_tables/res_currency.py 2017-07-17 07:08:42 +0000
134@@ -190,29 +190,94 @@
135 purchase_obj = self.pool.get('purchase.order')
136 sale_obj = self.pool.get('sale.order')
137 property_obj = self.pool.get('ir.property')
138+ acc_inv_obj = self.pool.get('account.invoice')
139+ aml_obj = self.pool.get('account.move.line')
140+ comm_voucher_obj = self.pool.get('account.commitment')
141+ hq_entry_obj = self.pool.get('hq.entries')
142+ payroll_obj = self.pool.get('hr.payroll.msf')
143+ reg_obj = self.pool.get('account.bank.statement')
144+ recurring_obj = self.pool.get('account.subscription')
145+ accrual_line_obj = self.pool.get('msf.accrual.line')
146+ keyword = _(keyword)
147
148 if isinstance(ids, (int, long)):
149 ids = [ids]
150
151- pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', 'in', ids), ('active', 'in', ['t', 'f'])], context=context)
152+ pricelist_ids = pricelist_obj.search(cr, uid, [('currency_id', 'in', ids), ('active', 'in', ['t', 'f'])],
153+ order='NO_ORDER', context=context)
154 if pricelist_ids:
155 # Get all documents which disallow the deletion of the currency
156- purchase_ids = purchase_obj.search(cr, uid, [('pricelist_id', 'in', pricelist_ids)], context=context)
157- sale_ids = sale_obj.search(cr, uid, [('pricelist_id', 'in', pricelist_ids)], context=context)
158-# partner_ids = partner_obj.search(cr, uid, ['|', ('property_product_pricelist', 'in', pricelist_ids),
159-# ('property_product_pricelist_purchase', 'in', pricelist_ids)], context=context)
160+ # Raise an error if the currency is used in a transaction that isn't closed/paid/posted
161+
162+ # Check on POs
163+ if purchase_obj.search_exist(cr, uid, [('pricelist_id', 'in', pricelist_ids), ('state', 'not in', ['done', 'cancel'])],
164+ context=context):
165+ raise osv.except_osv(_('Currency currently used!'), _(
166+ "The currency you want to %s is used in at least one "
167+ "Purchase Order which isn't Closed.") % keyword)
168+
169+ # Check on FOs
170+ if sale_obj.search_exist(cr, uid, [('pricelist_id', 'in', pricelist_ids), ('state', 'not in', ['done', 'cancel'])],
171+ context=context):
172+ raise osv.except_osv(_('Currency currently used!'), _(
173+ "The currency you want to %s is used in at least one "
174+ "Field Order which isn't Closed.") % keyword)
175+
176+ # Check on Partner (forms)
177 value_reference = ['product.pricelist,%s' % x for x in pricelist_ids]
178- partner_ids = property_obj.search(cr, uid, ['|', ('name', '=', 'property_product_pricelist'),
179- ('name', '=', 'property_product_pricelist_purcahse'),
180- ('value_reference', 'in', value_reference)])
181-
182- # Raise an error if the currency is used on partner form
183- if partner_ids:
184- raise osv.except_osv(_('Currency currently used !'), _('The currency you want to %s is currently used on at least one partner form.') % keyword)
185-
186- # Raise an error if the currency is used on sale or purchase order
187- if purchase_ids or sale_ids:
188- raise osv.except_osv(_('Currency currently used !'), _('The currency you want to %s is currently used on at least one sale order or purchase order.') % keyword)
189+ property_ids = property_obj.search(cr, uid, ['|', ('name', '=', 'property_product_pricelist'),
190+ ('name', '=', 'property_product_pricelist_purchase'),
191+ ('value_reference', 'in', value_reference)], order='NO_ORDER', context=context)
192+ for prop in property_obj.browse(cr, uid, property_ids, fields_to_fetch=['res_id'], context=context):
193+ if prop.res_id and prop.res_id._table_name == 'res.partner' and prop.res_id.active:
194+ raise osv.except_osv(_('Currency currently used!'), _('The currency you want to %s is used '
195+ 'in at least one active partner form.') % keyword)
196+
197+ # Check on account.invoice
198+ if acc_inv_obj.search_exist(cr, uid, [('currency_id', 'in', ids), ('state', 'not in', ['paid', 'cancel'])], context=context):
199+ raise osv.except_osv(_('Currency currently used!'), _('The currency you want to %s is used in at least '
200+ 'one document in Draft or Open state.') % keyword)
201+
202+ # Check on Journal Items
203+ if aml_obj.search_exist(cr, uid, ['|',
204+ ('currency_id', 'in', ids),
205+ ('functional_currency_id', 'in', ids),
206+ ('move_state', '=', 'draft')], context=context):
207+ raise osv.except_osv(_('Currency currently used!'), _('The currency you want to %s is used in at least '
208+ 'one Journal Item in Unposted state.') % keyword)
209+ # Check on Commitment Vouchers
210+ if comm_voucher_obj.search_exist(cr, uid, [('currency_id', 'in', ids), ('state', '!=', 'done')], context=context):
211+ raise osv.except_osv(_('Currency currently used!'), _("The currency you want to %s is used in at least "
212+ "one Commitment Voucher which isn't Done.") % keyword)
213+ # Check on HQ Entries
214+ if hq_entry_obj.search_exist(cr, uid, [('currency_id', 'in', ids), ('user_validated', '=', False)], context=context):
215+ raise osv.except_osv(_('Currency currently used!'), _("The currency you want to %s is used in at least "
216+ "one HQ Entry which isn't validated.") % keyword)
217+
218+ # Check on HR Payrolls
219+ if payroll_obj.search_exist(cr, uid, [('currency_id', 'in', ids), ('state', '=', 'draft')], context=context):
220+ raise osv.except_osv(_('Currency currently used!'), _("The currency you want to %s is used in at least "
221+ "one Payroll Entry which isn't validated.") % keyword)
222+
223+ # Check on Registers
224+ if reg_obj.search_exist(cr, uid, [('journal_id.currency', 'in', ids), ('state', 'in', ['draft', 'open'])], context=context):
225+ raise osv.except_osv(_('Currency currently used!'),
226+ _("The currency you want to %s is used in at least "
227+ "one Register in Draft or Open state.") % keyword)
228+
229+ # Check on Recurring Entries
230+ if recurring_obj.search_exist(cr, uid, [('model_id.currency_id', 'in', ids), ('state', '!=', 'done')], context=context):
231+ raise osv.except_osv(_('Currency currently used!'),
232+ _("The currency you want to %s is used in at least "
233+ "one Recurring Entry having a state not Done.") % keyword)
234+
235+ # Check on Accrual Lines
236+ if accrual_line_obj.search_exist(cr, uid,
237+ ['|', ('currency_id', 'in', ids), ('functional_currency_id', 'in', ids),
238+ ('state', 'in', ['draft', 'partially_posted'])], context=context):
239+ raise osv.except_osv(_('Currency currently used!'),
240+ _("The currency you want to %s is used in at least "
241+ "one Draft or Partially Posted Accrual Line.") % keyword)
242
243 return pricelist_ids
244
245@@ -229,7 +294,7 @@
246 ('currency_id','in',ids),
247 ('functional_currency_id', 'in', ids)], context=context)
248 if len(move_line_ids) > 0:
249- raise osv.except_osv(_('Currency currently used !'), _('The currency cannot be deleted as one or more journal items are currently using it!'))
250+ raise osv.except_osv(_('Currency currently used!'), _('The currency cannot be deleted as one or more journal items are currently using it!'))
251
252 pricelist_obj = self.pool.get('product.pricelist')
253

Subscribers

People subscribed via source and target branches