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

Proposed by jftempo
Status: Merged
Merged at revision: 6132
Proposed branch: lp:~julie-w/unifield-server/US-7836
Merge into: lp:unifield-server
Diff against target: 119 lines (+40/-3)
6 files modified
bin/addons/account/wizard/account_invoice_refund.py (+10/-0)
bin/addons/account_corrections/wizard/analytic_distribution_wizard.py (+12/-0)
bin/addons/analytic_distribution/analytic_line.py (+2/-1)
bin/addons/analytic_override/analytic_line.py (+1/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+13/-0)
bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+2/-2)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-7836
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+412846@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/account/wizard/account_invoice_refund.py'
2--- bin/addons/account/wizard/account_invoice_refund.py 2021-11-10 16:14:10 +0000
3+++ bin/addons/account/wizard/account_invoice_refund.py 2021-12-07 10:10:12 +0000
4@@ -131,6 +131,7 @@
5 inv_tax_obj = self.pool.get('account.invoice.tax')
6 inv_line_obj = self.pool.get('account.invoice.line')
7 res_users_obj = self.pool.get('res.users')
8+ aal_obj = self.pool.get('account.analytic.line')
9 if context is None:
10 context = {}
11
12@@ -267,6 +268,15 @@
13 # get the list of move lines excluding invoice header
14 ml_list = [ml.id for ml in movelines if not ml.is_counterpart]
15 account_m_line_obj.set_as_corrected(cr, uid, ml_list, manual=False, context=None)
16+ # blocks the refund Cancel or Modify in case the AD of one of the related AJI has been updated
17+ # Note that the case where REV/COR have been generated is handled in "set_as_corrected", which is also used out of refunds.
18+ for ml_id in ml_list:
19+ if aal_obj.search_exist(cr, uid, [('move_id', '=', ml_id), ('ad_updated', '=', True)], context=context):
20+ move_name = account_m_line_obj.browse(cr, uid, ml_id, fields_to_fetch=['move_id'], context=context).move_id.name
21+ raise osv.except_osv(_('Error'), _('The Analytic Distribution linked to the entry %s has '
22+ 'been updated since the invoice validation.\n'
23+ 'Refunds of type "Modify" and "Cancel" are not allowed.')
24+ % move_name)
25 # all JI lines of the SI and SR (including header) should be not corrigible, no matter if they
26 # are marked as corrected, reversed...
27 ji_ids = []
28
29=== modified file 'bin/addons/account_corrections/wizard/analytic_distribution_wizard.py'
30--- bin/addons/account_corrections/wizard/analytic_distribution_wizard.py 2021-05-04 13:43:39 +0000
31+++ bin/addons/account_corrections/wizard/analytic_distribution_wizard.py 2021-12-07 10:10:12 +0000
32@@ -620,6 +620,18 @@
33 if to_reverse or to_override or to_create:
34 self.pool.get('account.move.line').corrected_upstream_marker(cr, uid, [ml.id], context=context)
35
36+ # In case of no REV/COR, set the analytic lines as ad_updated. This shows that the Corr. Wizard has been used,
37+ # whatever the changes made (even if no change has been made, or e.g. only a Free1/2 line has been deleted)
38+ if not has_generated_cor:
39+ # get all the analytic lines related to the JI, INCLUDING the free1/2 lines
40+ all_analytic_lines_ids = ana_line_obj.search(cr, uid, [
41+ ('move_id', '=', ml.id),
42+ ('is_reversal', '=', False), # no need to include the REV lines...
43+ ('is_reallocated', '=', False), # ...or the lines set as reallocated from a previous corr.
44+ ], order='NO_ORDER', context=context)
45+ if all_analytic_lines_ids:
46+ ana_line_obj.write(cr, uid, all_analytic_lines_ids, {'ad_updated': True}, context=context)
47+
48 if context and 'ji_correction_account_or_tp_changed' in context:
49 if (any_reverse or to_reverse) and \
50 not context['ji_correction_account_or_tp_changed']:
51
52=== modified file 'bin/addons/analytic_distribution/analytic_line.py'
53--- bin/addons/analytic_distribution/analytic_line.py 2021-09-10 14:17:11 +0000
54+++ bin/addons/analytic_distribution/analytic_line.py 2021-12-07 10:10:12 +0000
55@@ -324,6 +324,7 @@
56 fieldname: account_id,
57 'date': aline.date,
58 'source_date': curr_date,
59+ 'ad_updated': True,
60 }
61 self.write(cr, uid, [aline.id], vals, context=context)
62 # else reverse line before recreating them with right values
63@@ -395,7 +396,7 @@
64 cr.execute('update account_analytic_line set entry_sequence = %s where id = %s', (entry_seq, rev_cor_id))
65 else:
66 # Update account
67- self.write(cr, uid, [aline.id], {'account_id': account_id}, context=context)
68+ self.write(cr, uid, [aline.id], {'account_id': account_id, 'ad_updated': True}, context=context)
69 # Set line as corrected upstream if we are in COORDO/HQ instance
70 if aline.move_id:
71 self.pool.get('account.move.line').corrected_upstream_marker(cr, uid, [aline.move_id.id], context=context)
72
73=== modified file 'bin/addons/analytic_override/analytic_line.py'
74--- bin/addons/analytic_override/analytic_line.py 2021-09-10 14:17:11 +0000
75+++ bin/addons/analytic_override/analytic_line.py 2021-12-07 10:10:12 +0000
76@@ -121,6 +121,7 @@
77 'source_date': fields.date('Source date', help="Date used for FX rate re-evaluation"),
78 'is_reversal': fields.boolean('Reversal?'),
79 'is_reallocated': fields.boolean('Reallocated?'),
80+ 'ad_updated': fields.boolean('Analytic Distribution Updated'),
81 'date': fields.date('Posting Date', required=True, select=True, readonly=True),
82 'document_date': fields.date('Document Date', readonly=True, required=True),
83 'functional_currency_id': fields.related('company_id', 'currency_id', string="Func. Currency", type="many2one", relation="res.currency", readonly=True, write_relate=False),
84
85=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
86--- bin/addons/msf_profile/i18n/fr_MF.po 2021-11-18 11:18:31 +0000
87+++ bin/addons/msf_profile/i18n/fr_MF.po 2021-12-07 10:10:12 +0000
88@@ -113251,3 +113251,16 @@
89 #, python-format
90 msgid "You must select an old version of the Kit to be able to import from it"
91 msgstr "Vous devez sélectionner une ancienne version de ce Kit pour pouvoir importer depuis ce Kit"
92+
93+#. module: analytic_override
94+#: field:account.analytic.line,ad_updated:0
95+msgid "Analytic Distribution Updated"
96+msgstr "Distribution Analytique Mise à Jour"
97+
98+#. module: account
99+#: code:addons/account/wizard/account_invoice_refund.py:276
100+#, python-format
101+msgid "The Analytic Distribution linked to the entry %s has been updated since the invoice validation.\n"
102+"Refunds of type \"Modify\" and \"Cancel\" are not allowed."
103+msgstr "La Distribution Analytique liée à l'écriture %s a été mise à jour depuis la validation de la facture.\n"
104+"Les avoirs de type \"Modifier\" et \"Annuler\" ne sont pas autorisés."
105
106=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv'
107--- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2021-10-21 09:30:27 +0000
108+++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2021-12-07 10:10:12 +0000
109@@ -92,8 +92,8 @@
110 msf_sync_data_server.account_move_line_corrected_upstream,FALSE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,[],"['corrected_upstream', 'instance_id/id']",HQ + MISSION,account.move.line,instance_id,Account Move Line Corrected Upstream,Valid,,417
111 msf_sync_data_server.account_move_unreconcile,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional,"[]","['unreconcile_date', 'delete_reconcile_txt', 'move_sdref_txt', 'reconcile_sdref']",HQ + MISSION,account.move.unreconcile,,Account Move UnReconcile,Valid,,423
112 msf_sync_data_server.account_move_reconcile,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,"[]","['name', 'type', 'is_multi_instance', 'multi_instance_level_creation', 'instance_id', 'nb_partial_legs', 'line_id/id', 'line_partial_ids/id', 'action_date']",HQ + MISSION,account.move.reconcile,,Account Move Reconcile,Valid,,424
113-msf_sync_data_server.analytical_line,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional-Private,"[('account_id.category', '=', 'FUNDING')]","['from_commitment_line', 'account_id/id', 'amount', 'amount_currency','correction_date', 'code', 'cost_center_id/id', 'currency_id/id', 'date', 'destination_id/id', 'distrib_line_id', 'distribution_id/id', 'document_date', 'general_account_id/id', 'instance_id/id', 'is_reallocated', 'is_reversal', 'journal_id/id', 'move_id/id', 'name', 'partner_txt', 'ref', 'reversal_origin/id', 'source_date', 'entry_sequence', 'real_period_id/id']",HQ + MISSION,account.analytic.line,cost_center_id,Analytical Line,Valid,,420
114-msf_sync_data_server.analytical_line_free,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('account_id.category', 'in', ['FREE1', 'FREE2'])]","['account_id/id', 'amount', 'amount_currency', 'code', 'currency_id/id', 'date', 'distrib_line_id', 'correction_date','document_date', 'general_account_id/id', 'instance_id/id', 'is_reallocated', 'is_reversal', 'journal_id/id', 'move_id/id', 'name', 'partner_txt', 'ref', 'reversal_origin/id', 'source_date', 'entry_sequence', 'real_period_id/id', 'distribution_id/id']",MISSION,account.analytic.line,,Analytic Line (Free 1 and Free 2),Valid,,421
115+msf_sync_data_server.analytical_line,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional-Private,"[('account_id.category', '=', 'FUNDING')]","['from_commitment_line', 'account_id/id', 'amount', 'amount_currency','correction_date', 'code', 'cost_center_id/id', 'currency_id/id', 'date', 'destination_id/id', 'distrib_line_id', 'distribution_id/id', 'document_date', 'general_account_id/id', 'instance_id/id', 'is_reallocated', 'is_reversal', 'ad_updated', 'journal_id/id', 'move_id/id', 'name', 'partner_txt', 'ref', 'reversal_origin/id', 'source_date', 'entry_sequence', 'real_period_id/id']",HQ + MISSION,account.analytic.line,cost_center_id,Analytical Line,Valid,,420
116+msf_sync_data_server.analytical_line_free,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('account_id.category', 'in', ['FREE1', 'FREE2'])]","['account_id/id', 'amount', 'amount_currency', 'code', 'currency_id/id', 'date', 'distrib_line_id', 'correction_date','document_date', 'general_account_id/id', 'instance_id/id', 'is_reallocated', 'is_reversal', 'ad_updated', 'journal_id/id', 'move_id/id', 'name', 'partner_txt', 'ref', 'reversal_origin/id', 'source_date', 'entry_sequence', 'real_period_id/id', 'distribution_id/id']",MISSION,account.analytic.line,,Analytic Line (Free 1 and Free 2),Valid,,421
117 msf_sync_data_server.analytical_line_correction,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,"[('account_id.category', '=', 'FUNDING'), ('imported_commitment','=',False)]","['last_corrected_id/id', 'cost_center_id/id', 'reversal_origin/id']",HQ + MISSION,account.analytic.line,cost_center_id,Analytical Line,Valid,,422
118 msf_sync_data_server.decision_moment,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,[],"['name', 'order']",HQ + MISSION,msf.budget.decision.moment,,Decision Moment,Valid,,429
119 msf_sync_data_server.budget,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('type','=','normal'), ('state', '!=', 'draft')]","['code', 'cost_center_id/id', 'currency_id/id', 'decision_moment_id/id', 'decision_moment_order', 'fiscalyear_id/id', 'name', 'type', 'version']",OC,msf.budget,,Budget,Valid,,430

Subscribers

People subscribed via source and target branches