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

Proposed by jftempo
Status: Merged
Merged at revision: 4980
Proposed branch: lp:~julie-w/unifield-server/US-4283
Merge into: lp:unifield-server
Diff against target: 109 lines (+26/-4)
5 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+9/-0)
bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+1/-1)
bin/addons/register_accounting/account_bank_statement.py (+9/-1)
bin/addons/register_accounting/report/fully_report_xls.mako (+3/-2)
bin/addons/register_accounting/wizard/wizard_cash_return.py (+4/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-4283
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+349147@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 2018-06-15 12:30:42 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-07-09 08:36:18 +0000
4@@ -101265,3 +101265,12 @@
5 msgid "Not Invoice"
6 msgstr "Pas de Facture"
7
8+#. module: register_accounting
9+#: field:account.bank.statement.line,advance_invoice_move_id:0
10+msgid "Account Move of the Invoice used to close the Advance"
11+msgstr "Ecriture Comptable de la Facture utilisée pour clôturer l'Avance"
12+
13+#. module: register_accounting
14+#: help:account.bank.statement.line,advance_invoice_move_id:0
15+msgid "When a SI is used to close an Advance, the related JE is stored in this field"
16+msgstr "Lorsqu'une facture est utilisée pour clôturer une avance, l'écriture comptable associée est stockée dans ce champ"
17
18=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv'
19--- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2018-05-18 15:58:40 +0000
20+++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2018-07-09 08:36:18 +0000
21@@ -79,7 +79,7 @@
22 msf_sync_data_server.account_move_line,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional-Private,[],"['account_id/id', 'accrual', 'analytic_account_id/id', 'analytic_distribution_id/id', 'blocked', 'cheque_number','corrected', 'credit', 'credit_currency', 'currency_id/id', 'date_created', 'date_maturity', 'debit', 'debit_currency', 'document_date', 'employee_id/id', 'have_an_historic', 'instance_id/id', 'is_addendum_line', 'is_counterpart', 'is_transfer_with_change', 'is_write_off', 'journal_id/id', 'last_cor_was_only_analytic', 'move_id/id', 'name', 'partner_id/id','partner_txt','period_id/id', 'reconcile_id/id', 'reconcile_partial_id/id', 'ref', 'reversal', 'source_date', 'statement_id/id', 'reference', 'state','transfer_journal_id/id', 'transfer_amount', 'is_downpayment', 'reconcile_date', 'is_revaluated_ok', 'unreconcile_date', 'unreconcile_txt', 'is_manually_corrected', 'is_si_refund']",HQ + MISSION,account.move.line,instance_id,Account Move Line,Valid,,412
23 msf_sync_data_server.account_move_line_correction,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,"[('move_id','in',('account.move','id',[('state','=','posted')]))]","['corrected_line_id/id', 'instance_id/id', 'reversal_line_id/id']",HQ + MISSION,account.move.line,instance_id,Account Move Line Correction,Valid,,413
24 msf_sync_data_server.account_move_line_register_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,[],"['corrected_st_line_id/id', 'instance_id/id']",MISSION,account.move.line,instance_id,Account Move Line / Register Line,Valid,,414
25-msf_sync_data_server.register_line_account_move_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,"[('instance_id' , 'in' , ('msf.instance' , 'id' , [('level' , '=' , 'project')])),('statement_id','in',('account.bank.statement','id',[('state','!=','draft')])),'!',('state','=','draft')]","['direct_invoice_move_id/id', 'first_move_line_id/id', 'from_import_cheque_id/id', 'imported_invoice_line_ids/id','instance_id/id', 'cash_return_move_line_id/id']",MISSION,account.bank.statement.line,instance_id,Register Line / Account Move Line,Valid,,415
26+msf_sync_data_server.register_line_account_move_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,"[('instance_id' , 'in' , ('msf.instance' , 'id' , [('level' , '=' , 'project')])),('statement_id','in',('account.bank.statement','id',[('state','!=','draft')])),'!',('state','=','draft')]","['direct_invoice_move_id/id', 'first_move_line_id/id', 'from_import_cheque_id/id', 'imported_invoice_line_ids/id','instance_id/id', 'cash_return_move_line_id/id', 'advance_invoice_move_id/id']",MISSION,account.bank.statement.line,instance_id,Register Line / Account Move Line,Valid,,415
27 msf_sync_data_server.account_move_state,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional-Private,[],"['instance_id/id', 'state']",HQ + MISSION,account.move,instance_id,Account Move State,Valid,,416
28 msf_sync_data_server.account_move_line_corrected_upstream,TRUE,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
29 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
30
31=== modified file 'bin/addons/register_accounting/account_bank_statement.py'
32--- bin/addons/register_accounting/account_bank_statement.py 2018-06-11 13:34:07 +0000
33+++ bin/addons/register_accounting/account_bank_statement.py 2018-07-09 08:36:18 +0000
34@@ -1130,6 +1130,9 @@
35 # hard posted direct invoice regline case (and sync P1->C1)
36 if absl.direct_invoice_move_id:
37 res.add(absl.direct_invoice_move_id.id)
38+ # advance closed by a SI in project => in upper inst. invoice_id is empty: use advance_invoice_move_id
39+ elif not absl.invoice_id and absl.advance_invoice_move_id:
40+ res.add(absl.advance_invoice_move_id.id)
41 return list(res)
42
43 def _get_fp_analytic_lines(self, cr, uid, ids, field_name=None, args=None, context=None):
44@@ -1227,6 +1230,9 @@
45 'red_on_supplier': fields.function(_check_red_on_supplier, method=True, type="boolean", string="Supplier flag", store=False, readonly=True, multi="m"),
46 'journal_id': fields.related('statement_id','journal_id', string="Journal", type='many2one', relation='account.journal', readonly=True),
47 'direct_invoice_move_id': fields.many2one('account.move', 'Direct Invoice Move', readonly=True, help="This field have been added to get the move that comes from the direct invoice because after synchronization some lines lost the direct invoice link. And so we can't see which move have been linked to the invoice in case the register line is temp posted."),
48+ 'advance_invoice_move_id': fields.many2one('account.move', 'Account Move of the Invoice used to close the Advance',
49+ readonly=True,
50+ help="When a SI is used to close an Advance, the related JE is stored in this field"),
51 }
52
53 _defaults = {
54@@ -1269,7 +1275,7 @@
55 cash_adv_return_move_line_ids = [
56 absl.cash_return_move_line_id.id \
57 for absl in absl_brs \
58- if not absl.invoice_id and absl.from_cash_return and \
59+ if not absl.invoice_id and not absl.advance_invoice_move_id and absl.from_cash_return and \
60 absl.cash_return_move_line_id
61 # NOTE: for imported invoices we let the default behaviour
62 # (display of invoice AJIs)
63@@ -2224,6 +2230,8 @@
64 'down_payment_id': False,
65 'cash_return_move_line_id': False, # BKLG-60
66 'partner_move_ids': [],
67+ 'advance_invoice_move_id': False,
68+ 'direct_invoice_move_id': False,
69 })
70 # Copy analytic distribution if exists
71 line = self.browse(cr, uid, [absl_id], context=context)[0]
72
73=== modified file 'bin/addons/register_accounting/report/fully_report_xls.mako'
74--- bin/addons/register_accounting/report/fully_report_xls.mako 2018-02-26 11:25:57 +0000
75+++ bin/addons/register_accounting/report/fully_report_xls.mako 2018-07-09 08:36:18 +0000
76@@ -807,8 +807,9 @@
77
78 <!-- Direct invoice and invoice that comes from a PL (in a cash return) -->
79 <% move_lines = [] %>
80-% if line.invoice_id:
81-<% move_lines = getMoveLines([line.invoice_id.move_id], line) %>
82+<% invoice_move = line.invoice_id and line.invoice_id.move_id or line.advance_invoice_move_id %>
83+% if invoice_move:
84+<% move_lines = getMoveLines([invoice_move], line) %>
85 % elif line.imported_invoice_line_ids:
86 <% move_lines = getImportedMoveLines([ml for ml in line.imported_invoice_line_ids], line) %>
87 % elif line.direct_invoice_move_id:
88
89=== modified file 'bin/addons/register_accounting/wizard/wizard_cash_return.py'
90--- bin/addons/register_accounting/wizard/wizard_cash_return.py 2018-02-22 14:45:02 +0000
91+++ bin/addons/register_accounting/wizard/wizard_cash_return.py 2018-07-09 08:36:18 +0000
92@@ -541,6 +541,7 @@
93 # Fetch objects
94 move_line_obj = self.pool.get('account.move.line')
95 absl_obj = self.pool.get('account.bank.statement.line')
96+ inv_obj = self.pool.get('account.invoice')
97 move_line = move_line_obj.browse(cr, uid, move_line_id, context=context)
98
99 # Prepare some values
100@@ -588,6 +589,9 @@
101 # Add invoice link if exists
102 if invoice_id:
103 vals.update({'invoice_id': invoice_id,})
104+ # also store the invoice JE
105+ inv = inv_obj.browse(cr, uid, invoice_id, fields_to_fetch=['move_id'], context=context)
106+ vals.update({'advance_invoice_move_id': inv and inv.move_id and inv.move_id.id or False})
107
108 # Create the statement line with vals
109 st_line_id = absl_obj.create(cr, uid, vals, context=context)

Subscribers

People subscribed via source and target branches