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

Proposed by jftempo
Status: Merged
Merged at revision: 5058
Proposed branch: lp:~julie-w/unifield-server/US-3873
Merge into: lp:unifield-server
Diff against target: 3428 lines (+1389/-789) (has conflicts)
14 files modified
bin/addons/account/report/account_partner_balance.rml (+49/-44)
bin/addons/account/report/account_partner_ledger.mako (+156/-65)
bin/addons/account/report/account_partner_ledger.py (+199/-42)
bin/addons/account/report/account_partner_ledger.rml (+462/-180)
bin/addons/account/report/account_partner_ledger_other.rml (+145/-62)
bin/addons/account/wizard/account_report_partner_ledger.py (+17/-6)
bin/addons/account/wizard/account_report_partner_ledger_view.xml (+4/-2)
bin/addons/finance/report/account_partner_balance_tree.py (+40/-37)
bin/addons/finance/report/account_partner_balance_tree_xls.mako (+40/-96)
bin/addons/finance/wizard/account_report_partner_balance_tree.py (+118/-193)
bin/addons/finance/wizard/account_report_partner_balance_tree_view.xml (+3/-14)
bin/addons/msf_profile/data/patches.xml (+17/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+75/-48)
bin/addons/msf_profile/msf_profile.py (+64/-0)
Text conflict in bin/addons/msf_profile/data/patches.xml
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
Text conflict in bin/addons/msf_profile/msf_profile.py
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-3873
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+352984@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/report/account_partner_balance.rml'
2--- bin/addons/account/report/account_partner_balance.rml 2017-06-01 09:47:21 +0000
3+++ bin/addons/account/report/account_partner_balance.rml 2018-08-17 15:39:40 +0000
4@@ -186,25 +186,27 @@
5 </para>
6 <section>
7 [[ repeatIn(get_partners(data), 'p_entries') ]]
8- <blockTable colWidths="50.0,40.0,85.0,50.0,124.0,50.0,91.0,50.0" style="Table2_header">
9+ <!-- NOTE: if this HEADER has to be modified: modify also the "no data" version (below) -->
10+ <blockTable colWidths="50.0,37.0,81.0,50.0,91.0,118.0,90.0,43.0" style="Table2_header">
11 <tr>
12 <td><para style="terp_tblheader_General_Centre">Chart of Account</para></td>
13 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
14 <td><para style="terp_tblheader_General_Centre">Journals</para></td>
15- <td><para style="terp_tblheader_General_Centre">Partner's</para></td>
16- <td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
17- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
18+ <td><para style="terp_tblheader_General_Centre">Accounts</para></td>
19 <td><para style="terp_tblheader_General_Centre">Proprietary Instances</para></td>
20- <td><para style="terp_tblheader_General_Centre">Accounts</para></td>
21+ <td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para></td>
22+ <td><para style="terp_tblheader_General_Centre">Display</para></td>
23+ <td><para style="terp_tblheader_General_Centre">Func. Currency</para></td>
24 </tr>
25 <tr>
26 <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
27 <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
28 <td> <para style="terp_default_Centre_8">[[ get_journals_str(data) ]] </para></td>
29- <td> <para style="terp_default_Centre_8">[[ get_type_of_accounts() ]]</para></td>
30+ <td><para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para></td>
31+ <td><para style="terp_default_Centre_8">[[ get_prop_instances_str(data, pdf=True) ]]</para></td>
32
33 <td><para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]] </para>
34- <blockTable colWidths="57.0,57.0" style="Table3">[[ get_filter(data)==translate('Date') or removeParentNode('blockTable') ]]
35+ <blockTable colWidths="55.0,55.0" style="Table3">[[ get_filter(data)==translate('Date') or removeParentNode('blockTable') ]]
36 <tr>
37 <td><para style="terp_tblheader_General_Centre">Start Date</para></td>
38 <td><para style="terp_tblheader_General_Centre">End Date</para></td>
39@@ -214,7 +216,7 @@
40 <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
41 </tr>
42 </blockTable>
43- <blockTable colWidths="57.0,57.0" style="Table3">[[ get_filter(data)==translate('Periods') or removeParentNode('blockTable') ]]
44+ <blockTable colWidths="55.0,55.0" style="Table3">[[ get_filter(data)==translate('Periods') or removeParentNode('blockTable') ]]
45 <tr>
46 <td><para style="terp_tblheader_General_Centre">Start Period</para></td>
47 <td><para style="terp_tblheader_General_Centre">End Period</para></td>
48@@ -225,19 +227,23 @@
49 </tr>
50 </blockTable>
51 </td>
52- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
53- <td><para style="terp_default_Centre_8">[[ get_prop_instances_str(data, pdf=True) ]]</para></td>
54- <td><para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para></td>
55+ <td>
56+ <para style="terp_default_Centre_8">[[ "%s: %s, %s: %s, %s: %s, %s: %s" % (
57+ translate("Partner's"), get_type_of_accounts(),
58+ translate('Target Moves'), get_target_move(data),
59+ translate('Reconciled'), get_reconcile_selection(data),
60+ translate('Display Partners'), get_display_partners_selection(data),
61+ ) ]]</para>
62+ </td>
63+ <td>
64+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
65+ </td>
66 </tr>
67 </blockTable>
68
69 <para style="terp_default_8">
70 <font color="white"> </font>
71 </para>
72- <para style="P12a"><u>[[ p_entries and (p_entries[0].account_type == 'payable' and translate('Payable Accounts') or translate('Receivable Accounts')) ]]</u></para>
73- <para style="terp_default_8">
74- <font color="white"> </font>
75- </para>
76 <blockTable colWidths="140.0,55.0,75.0,65.0,70.0,70.0,69.0" repeatRows="1" style="Table2">
77 <tr>
78 <td><para style="P12a">Partner</para></td>
79@@ -252,19 +258,18 @@
80 <td><para style="P7">TOTAL PARTNERS:</para></td>
81 <td><para style="P8"></para></td>
82 <td><para style="P8"><u>[[ company.currency_id.name ]]</u></para></td>
83- <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance_by_account_type(p_entries[0].account_type, data)[0] or 0.0) ]]</u></para></td>
84- <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance_by_account_type(p_entries[0].account_type, data)[1] or 0.0) ]]</u></para></td>
85+ <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance(data)[0] or 0.0) ]]</u></para></td>
86+ <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance(data)[1] or 0.0) ]]</u></para></td>
87 <td><para style="P10">-</para></td>
88- <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance_by_account_type(p_entries[0].account_type, data)[2] or 0.0) ]]</u></para></td>
89+ <td><para style="P8"><u>[[ formatLang(get_partners_total_debit_credit_balance(data)[2] or 0.0) ]]</u></para></td>
90 </tr>
91 <tr>
92 [[ repeatIn(p_entries, 'p_obj') ]]
93- <!-- For each partner: show one header line, another optional line if the initial balance must be displayed,
94- and the detail per account -->
95+ <!-- For each partner: show one header line and the detail per account -->
96 <td>
97 <blockTable colWidths="135.0,69.0,60.0,63.0,71.0,68.0,68.0">
98 <tr>
99- <td><para style="P15">[[ p_obj.name or '' ]][[ p_obj.partner_id and p_obj.partner_id.ref and ' - %s' % p_obj.partner_id.ref ]]</para></td>
100+ <td><para style="P15">[[ p_obj.name or '' ]]</para></td>
101 <td><para style="P15"></para></td>
102 <td><para style="P4Bold">[[ company.currency_id.name ]]</para></td>
103 <td><para style="P4Bold" fontSize="8.5">[[ formatLang(p_obj.debit or 0.0) ]]</para></td>
104@@ -272,17 +277,8 @@
105 <td><para style="P4Bold" fontSize="8.5">[[ formatLang(p_obj.balance or 0.0) ]]</para></td>
106 <td><para style="P4Bold" fontSize="8.5">[[ formatLang(p_obj.balance or 0.0) ]]</para></td>
107 </tr>
108- <tr> [[data['form']['initial_balance'] == True and ' ' or removeParentNode('tr') ]]
109- <td><para style="P4"></para></td>
110- <td><para style="P4">Initial Balance</para></td>
111- <td><para style="P4">[[ company.currency_id.name ]]</para></td>
112- <td><para style="P4">[[ formatLang(p_obj.ib_debit or 0.0) ]]</para></td>
113- <td><para style="P4">[[ formatLang(p_obj.ib_credit or 0.0) ]]</para></td>
114- <td><para style="P4">[[ formatLang(p_obj.ib_balance or 0.0) ]]</para></td>
115- <td><para style="P4">[[ formatLang(p_obj.ib_balance or 0.0) ]]</para></td>
116- </tr>
117 <tr>
118- [[ repeatIn(get_partner_account_move_lines(p_entries[0].account_type, p_obj.partner_id.id, data), 'aml') ]]
119+ [[ repeatIn(get_partner_account_move_lines(p_obj.partner_id.id, data), 'aml') ]]
120 <!-- For each account: display one line with the total in functional currency,
121 and one line per booking currency used -->
122 <td>
123@@ -297,7 +293,7 @@
124 <td><para style="P4Bold">[[ formatLang(aml.get('total') or 0.0) ]]</para></td>
125 </tr>
126 <tr>
127- [[ repeatIn(get_lines_per_currency(p_entries[0].account_type, p_obj.partner_id.id, data, aml.get('account')), 'detail_line') ]]
128+ [[ repeatIn(get_lines_per_currency(p_obj.partner_id.id, data, aml.get('account')), 'detail_line') ]]
129 <td><para style="P4"></para></td>
130 <td><para style="P4">Subtotal</para></td>
131 <td><para style="P4">[[ detail_line.get('currency_booking', '') ]]</para></td>
132@@ -313,28 +309,29 @@
133 </td>
134 </tr>
135 </blockTable>
136- <pageBreak>[[ (p_entries[0].account_type != 'payable' or get_nb_account_types() &lt; 2) and removeParentNode('pageBreak')]]</pageBreak>
137 </section>
138- <blockTable colWidths="50.0,40.0,85.0,50.0,124.0,50.0,91.0,50.0" style="Table2_header">
139+ <!-- if there is NO DATA to be displayed: display the header only -->
140+ <blockTable colWidths="50.0,37.0,81.0,50.0,91.0,118.0,90.0,43.0" style="Table2_header">
141 [[ get_has_data() and removeParentNode('blockTable') ]]
142 <tr>
143 <td><para style="terp_tblheader_General_Centre">Chart of Account</para></td>
144 <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
145 <td><para style="terp_tblheader_General_Centre">Journals</para></td>
146- <td><para style="terp_tblheader_General_Centre">Partner's</para></td>
147- <td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!='No Filter' and get_filter(data) ]]</para></td>
148- <td><para style="terp_tblheader_General_Centre">Target Moves</para></td>
149+ <td><para style="terp_tblheader_General_Centre">Accounts</para></td>
150 <td><para style="terp_tblheader_General_Centre">Proprietary Instances</para></td>
151- <td><para style="terp_tblheader_General_Centre">Accounts</para></td>
152+ <td><para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para></td>
153+ <td><para style="terp_tblheader_General_Centre">Display</para></td>
154+ <td><para style="terp_tblheader_General_Centre">Func. Currency</para></td>
155 </tr>
156 <tr>
157 <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td>
158 <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
159 <td> <para style="terp_default_Centre_8">[[ get_journals_str(data) ]] </para></td>
160- <td> <para style="terp_default_Centre_8">[[ get_type_of_accounts() ]]</para></td>
161+ <td><para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para></td>
162+ <td><para style="terp_default_Centre_8">[[ get_prop_instances_str(data, pdf=True) ]]</para></td>
163
164 <td><para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]] </para>
165- <blockTable colWidths="57.0,57.0" style="Table3">[[ get_filter(data)==translate('Date') or removeParentNode('blockTable') ]]
166+ <blockTable colWidths="55.0,55.0" style="Table3">[[ get_filter(data)==translate('Date') or removeParentNode('blockTable') ]]
167 <tr>
168 <td><para style="terp_tblheader_General_Centre">Start Date</para></td>
169 <td><para style="terp_tblheader_General_Centre">End Date</para></td>
170@@ -344,7 +341,7 @@
171 <td><para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para></td>
172 </tr>
173 </blockTable>
174- <blockTable colWidths="57.0,57.0" style="Table3">[[ get_filter(data)==translate('Periods') or removeParentNode('blockTable') ]]
175+ <blockTable colWidths="55.0,55.0" style="Table3">[[ get_filter(data)==translate('Periods') or removeParentNode('blockTable') ]]
176 <tr>
177 <td><para style="terp_tblheader_General_Centre">Start Period</para></td>
178 <td><para style="terp_tblheader_General_Centre">End Period</para></td>
179@@ -355,9 +352,17 @@
180 </tr>
181 </blockTable>
182 </td>
183- <td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
184- <td><para style="terp_default_Centre_8">[[ get_prop_instances_str(data, pdf=True) ]]</para></td>
185- <td><para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para></td>
186+ <td>
187+ <para style="terp_default_Centre_8">[[ "%s: %s, %s: %s, %s: %s, %s: %s" % (
188+ translate("Partner's"), get_type_of_accounts(),
189+ translate('Target Moves'), get_target_move(data),
190+ translate('Reconciled'), get_reconcile_selection(data),
191+ translate('Display Partners'), get_display_partners_selection(data),
192+ ) ]]</para>
193+ </td>
194+ <td>
195+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
196+ </td>
197 </tr>
198 </blockTable>
199
200
201=== modified file 'bin/addons/account/report/account_partner_ledger.mako'
202--- bin/addons/account/report/account_partner_ledger.mako 2017-06-01 09:47:21 +0000
203+++ bin/addons/account/report/account_partner_ledger.mako 2018-08-17 15:39:40 +0000
204@@ -148,6 +148,26 @@
205 <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
206 </Borders>
207 </Style>
208+<Style ss:ID="ssSubtotalLineLeft">
209+<Alignment ss:Vertical="Top" ss:Horizontal="Left" ss:WrapText="1"/>
210+<Font ss:Size="10"/>
211+<Borders>
212+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
213+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
214+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
215+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
216+</Borders>
217+</Style>
218+<Style ss:ID="ssSubtotalLineRight">
219+<Alignment ss:Vertical="Top" ss:Horizontal="Right" ss:WrapText="1"/>
220+<Font ss:Size="10"/>
221+<Borders>
222+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
223+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
224+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
225+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
226+</Borders>
227+</Style>
228 <Style ss:ID="ssAccountLineWrap">
229 <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1"/>
230 <Borders>
231@@ -172,6 +192,17 @@
232 </Borders>
233 <NumberFormat ss:Format="#,##0.00"/>
234 </Style>
235+<Style ss:ID="ssSubtotalLineNumber">
236+<Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
237+<Font ss:Size="10"/>
238+<Borders>
239+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
240+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
241+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
242+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
243+</Borders>
244+<NumberFormat ss:Format="#,##0.00"/>
245+</Style>
246 <Style ss:ID="ssAccountLineAccountCode">
247 <Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
248 <Font ss:Size="8"/>
249@@ -190,11 +221,11 @@
250 <Table x:FullColumns="1" x:FullRows="1">
251 <Column ss:AutoFitWidth="1" ss:Width="140" />
252 <Column ss:AutoFitWidth="1" ss:Width="60" />
253-<Column ss:AutoFitWidth="1" ss:Width="60" />
254-<Column ss:AutoFitWidth="1" ss:Width="60" />
255-<Column ss:AutoFitWidth="1" ss:Width="85" />
256-<Column ss:AutoFitWidth="1" ss:Width="80" />
257-<Column ss:AutoFitWidth="1" ss:Width="80" />
258+<Column ss:AutoFitWidth="1" ss:Width="70" />
259+<Column ss:AutoFitWidth="1" ss:Width="80" />
260+<Column ss:AutoFitWidth="1" ss:Width="45" />
261+<Column ss:AutoFitWidth="1" ss:Width="125" />
262+<Column ss:AutoFitWidth="1" ss:Width="60" />
263 <Column ss:AutoFitWidth="1" ss:Width="80" />
264 <Column ss:AutoFitWidth="1" ss:Width="80" />
265 <Column ss:AutoFitWidth="1" ss:Width="80" />
266@@ -207,13 +238,12 @@
267 <Row>
268 <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Chart of Account')}</Data></Cell>
269 <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Fiscal Year')}</Data></Cell>
270- <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Journal')}</Data></Cell>
271- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_("Partner's")}</Data></Cell>
272+ <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Journals')}</Data></Cell>
273 <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Accounts')}</Data></Cell>
274- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${'%s %s' % (_('Filters By'), (selected_filter != _('No Filter') and selected_filter or ''))|x}</Data></Cell>
275- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Target Moves')}</Data></Cell>
276 <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Proprietary Instances')}</Data></Cell>
277- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Currency')}</Data></Cell>
278+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${'%s %s' % (_('Filter By'), (selected_filter != _('No Filter') and selected_filter or ''))|x}</Data></Cell>
279+ <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Display')}</Data></Cell>
280+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Func. Currency')}</Data></Cell>
281 </Row>
282 <%
283 if selected_filter == _('Date'):
284@@ -233,20 +263,22 @@
285 <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
286 <Data ss:Type="String">${ get_journals_str(data)|x}</Data>
287 </Cell>
288- <Cell ss:StyleID="ssHeaderCell">
289- <Data ss:Type="String">${ get_partners()|x}</Data>
290- </Cell>
291 <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
292 <Data ss:Type="String">${ get_accounts_str(data)|x}</Data>
293 </Cell>
294+ <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
295+ <Data ss:Type="String">${ get_instances_str(data)|x}</Data>
296+ </Cell>
297 <Cell ss:StyleID="ssHeaderCell">
298 <Data ss:Type="String">${ filter|x}</Data>
299 </Cell>
300- <Cell ss:StyleID="ssHeaderCell">
301- <Data ss:Type="String">${ get_target_move(data)|x}</Data>
302- </Cell>
303 <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
304- <Data ss:Type="String">${ get_instances_str(data)|x}</Data>
305+ <Data ss:Type="String">${ "%s: %s, %s: %s, %s: %s, %s: %s" % (
306+ _("Partner's"), get_partners(),
307+ _('Target Moves'), get_target_move(data),
308+ _('Reconciled'), get_reconcile_selection(),
309+ _('Display Partners'), get_display_partners_selection(),
310+ )|x}</Data>
311 </Cell>
312 <Cell ss:StyleID="ssHeaderCell">
313 <Data ss:Type="String">${ company.currency_id.name |x}</Data>
314@@ -260,9 +292,6 @@
315 <Data ss:Type="String">${_('Partner')}</Data>
316 </Cell>
317 <Cell ss:StyleID="ssHeader">
318- <Data ss:Type="String">${_('Partner Ref.')}</Data>
319-</Cell>
320-<Cell ss:StyleID="ssHeader">
321 <Data ss:Type="String">${_('Date')}</Data>
322 </Cell>
323 <Cell ss:StyleID="ssHeader">
324@@ -278,6 +307,9 @@
325 <Data ss:Type="String">${_('Entry Label')}</Data>
326 </Cell>
327 <Cell ss:StyleID="ssHeader">
328+ <Data ss:Type="String">${_('Reconcile Number')}</Data>
329+</Cell>
330+<Cell ss:StyleID="ssHeader">
331 <Data ss:Type="String">${_('Currency')}</Data>
332 </Cell>
333 <Cell ss:StyleID="ssHeaderRight">
334@@ -294,14 +326,14 @@
335 </Cell>
336 </Row>
337
338-% for p in objects:
339+% for p in partners_to_display(objects):
340 <!-- PARTNER HEADER -->
341 <Row>
342 <Cell ss:StyleID="ssPartner">
343 <Data ss:Type="String">${p.name or ''|x}</Data>
344 </Cell>
345 <Cell ss:StyleID="ssPartner" ss:MergeAcross="5">
346- <Data ss:Type="String">${p.ref or ''|x}</Data>
347+ <Data ss:Type="String"></Data>
348 </Cell>
349 <Cell ss:StyleID="ssPartner">
350 <Data ss:Type="String">${company.currency_id.name|x}</Data>
351@@ -319,49 +351,108 @@
352 <Data ss:Type="Number">${(sum_debit_partner(p) or 0.) - (sum_credit_partner(p) or 0.)|x}</Data>
353 </Cell>
354 </Row>
355-<!-- PARTNER LINES -->
356-% for line in lines(p):
357-<Row>
358- <Cell ss:StyleID="ssAccountLine">
359- <Data ss:Type="String"></Data>
360- </Cell>
361- <Cell ss:StyleID="ssAccountLine">
362- <Data ss:Type="String"></Data>
363- </Cell>
364- <Cell ss:StyleID="ssAccountLine">
365- <Data ss:Type="String">${formatLang(line['date'], date=True)|x}</Data>
366- </Cell>
367- <Cell ss:StyleID="ssAccountLine">
368- <Data ss:Type="String">${line['code']|x}</Data>
369- </Cell>
370- <Cell ss:StyleID="ssAccountLine">
371- <Data ss:Type="String">${line['move_name']|x}</Data>
372- </Cell>
373- <Cell ss:StyleID="ssAccountLine">
374- <Data ss:Type="String">${line['a_code']|x}</Data>
375- </Cell>
376- <%
377- entry_label = '%s - %s' % (line['ref'] or '', line['name'] or '')
378- %>
379- <Cell ss:StyleID="ssAccountLine">
380- <Data ss:Type="String">${ entry_label |x}</Data>
381- </Cell>
382- <Cell ss:StyleID="ssAccountLine">
383- <Data ss:Type="String">${ line['currency_code'] or '' |x}</Data>
384- </Cell>
385- <Cell ss:StyleID="ssAccountLineNumber">
386- <Data ss:Type="Number">${ line['debit'] or 0.0|x}</Data>
387- </Cell>
388- <Cell ss:StyleID="ssAccountLineNumber">
389- <Data ss:Type="Number">${ line['credit'] or 0.0|x}</Data>
390- </Cell>
391- <Cell ss:StyleID="ssAccountLineNumber">
392- <Data ss:Type="Number">${ line['amount_currency'] or 0.0|x}</Data>
393- </Cell>
394- <Cell ss:StyleID="ssAccountLineNumber">
395- <Data ss:Type="Number">${ line['total_functional'] or 0.0|x}</Data>
396- </Cell>
397-</Row>
398+
399+% for account_code in get_accounts_to_display(p):
400+ <!-- TOTALS IN FUNCTIONAL -->
401+ <%
402+ fctal_totals = get_fctal_totals(p, account_code)
403+ %>
404+ <Row>
405+ <Cell ss:StyleID="ssSubtotalLineRight">
406+ <Data ss:Type="String">${p.name or ''|x}</Data>
407+ </Cell>
408+ <Cell ss:MergeAcross="5" ss:StyleID="ssSubtotalLineRight">
409+ <Data ss:Type="String">${ account_code |x}</Data>
410+ </Cell>
411+ <Cell ss:StyleID="ssSubtotalLineLeft">
412+ <Data ss:Type="String">${ company.currency_id.name |x}</Data>
413+ </Cell>
414+ <Cell ss:StyleID="ssSubtotalLineNumber">
415+ <Data ss:Type="Number">${ fctal_totals['debit_functional'] or 0.0|x}</Data>
416+ </Cell>
417+ <Cell ss:StyleID="ssSubtotalLineNumber">
418+ <Data ss:Type="Number">${ fctal_totals['credit_functional'] or 0.0|x}</Data>
419+ </Cell>
420+ <Cell ss:StyleID="ssSubtotalLineNumber">
421+ <Data ss:Type="Number">${ fctal_totals['total_functional'] or 0.0|x}</Data>
422+ </Cell>
423+ <Cell ss:StyleID="ssSubtotalLineNumber">
424+ <Data ss:Type="Number">${ fctal_totals['total_functional'] or 0.0|x}</Data>
425+ </Cell>
426+ </Row>
427+ <!-- SUBTOTAL LINES IN BOOKING -->
428+ <%
429+ subtotals = get_subtotals(p, account_code)
430+ %>
431+ % for curr in subtotals:
432+ <Row>
433+ <Cell ss:StyleID="ssSubtotalLineRight">
434+ <Data ss:Type="String">${p.name or ''|x}</Data>
435+ </Cell>
436+ <Cell ss:MergeAcross="5" ss:StyleID="ssSubtotalLineRight">
437+ <Data ss:Type="String">${ _('Subtotal') |x}</Data>
438+ </Cell>
439+ <Cell ss:StyleID="ssSubtotalLineLeft">
440+ <Data ss:Type="String">${ curr or '' |x}</Data>
441+ </Cell>
442+ <Cell ss:StyleID="ssSubtotalLineNumber">
443+ <Data ss:Type="Number">${ subtotals[curr]['debit'] or 0.0|x}</Data>
444+ </Cell>
445+ <Cell ss:StyleID="ssSubtotalLineNumber">
446+ <Data ss:Type="Number">${ subtotals[curr]['credit'] or 0.0|x}</Data>
447+ </Cell>
448+ <Cell ss:StyleID="ssSubtotalLineNumber">
449+ <Data ss:Type="Number">${ subtotals[curr]['amount_currency'] or 0.0|x}</Data>
450+ </Cell>
451+ <Cell ss:StyleID="ssSubtotalLineNumber">
452+ <Data ss:Type="Number">${ subtotals[curr]['total_functional'] or 0.0|x}</Data>
453+ </Cell>
454+ </Row>
455+ % endfor
456+ <!-- PARTNER LINES -->
457+ % for line in lines(p, account_code):
458+ <Row>
459+ <Cell ss:StyleID="ssAccountLine">
460+ <Data ss:Type="String"></Data>
461+ </Cell>
462+ <Cell ss:StyleID="ssAccountLine">
463+ <Data ss:Type="String">${formatLang(line['date'], date=True)|x}</Data>
464+ </Cell>
465+ <Cell ss:StyleID="ssAccountLine">
466+ <Data ss:Type="String">${line['code']|x}</Data>
467+ </Cell>
468+ <Cell ss:StyleID="ssAccountLine">
469+ <Data ss:Type="String">${line['move_name']|x}</Data>
470+ </Cell>
471+ <Cell ss:StyleID="ssAccountLine">
472+ <Data ss:Type="String">${line['a_code']|x}</Data>
473+ </Cell>
474+ <%
475+ entry_label = '%s - %s' % (line['ref'] or '', line['name'] or '')
476+ %>
477+ <Cell ss:StyleID="ssAccountLine">
478+ <Data ss:Type="String">${ entry_label |x}</Data>
479+ </Cell>
480+ <Cell ss:StyleID="ssAccountLine">
481+ <Data ss:Type="String">${ line['reconcile_txt'] or '' |x}</Data>
482+ </Cell>
483+ <Cell ss:StyleID="ssAccountLine">
484+ <Data ss:Type="String">${ line['currency_code'] or '' |x}</Data>
485+ </Cell>
486+ <Cell ss:StyleID="ssAccountLineNumber">
487+ <Data ss:Type="Number">${ line['debit'] or 0.0|x}</Data>
488+ </Cell>
489+ <Cell ss:StyleID="ssAccountLineNumber">
490+ <Data ss:Type="Number">${ line['credit'] or 0.0|x}</Data>
491+ </Cell>
492+ <Cell ss:StyleID="ssAccountLineNumber">
493+ <Data ss:Type="Number">${ line['amount_currency'] or 0.0|x}</Data>
494+ </Cell>
495+ <Cell ss:StyleID="ssAccountLineNumber">
496+ <Data ss:Type="Number">${ line['total_functional'] or 0.0|x}</Data>
497+ </Cell>
498+ </Row>
499+ % endfor
500 % endfor
501 % endfor
502
503
504=== modified file 'bin/addons/account/report/account_partner_ledger.py'
505--- bin/addons/account/report/account_partner_ledger.py 2017-06-12 09:56:20 +0000
506+++ bin/addons/account/report/account_partner_ledger.py 2018-08-17 15:39:40 +0000
507@@ -31,7 +31,15 @@
508
509 def __init__(self, cr, uid, name, context=None):
510 super(third_party_ledger, self).__init__(cr, uid, name, context=context)
511+ self.fctal_totals = {} # to store the totals in functional currency
512+ self.subtotals = {} # to store the subtotals per booking currency
513+ self.accounts_to_display = {}
514+ self.report_lines = {}
515+ self.debit_balances = {}
516+ self.credit_balances = {}
517+ self.current_partner_number = 0
518 self.localcontext.update({
519+ 'partners_to_display': self._partners_to_display,
520 'time': time,
521 'lines': self.lines,
522 'sum_debit_partner': self._sum_debit_partner,
523@@ -48,9 +56,17 @@
524 'get_journals_str': self._get_journals_str,
525 'get_partners':self._get_partners,
526 'get_target_move': self._get_target_move,
527+ 'get_reconcile_selection': self._get_reconcile_selection,
528+ 'get_display_partners_selection': self._get_display_partners_selection,
529 'get_instances_str': self._get_instances_str,
530 'get_accounts_str': self._get_accounts_str,
531 'format_entry_label': self._format_entry_label,
532+ 'get_accounts_to_display': self._get_accounts_to_display,
533+ 'get_fctal_totals': self._get_fctal_totals,
534+ 'get_subtotals': self._get_subtotals,
535+ 'nb_partners': lambda partners: len(self._partners_to_display(partners)),
536+ 'update_current_partner_number': self._update_current_partner_number,
537+ 'get_current_partner_number': lambda: self.current_partner_number,
538 })
539
540 def set_context(self, objects, data, ids, report_type=None):
541@@ -58,7 +74,7 @@
542 obj_partner = self.pool.get('res.partner')
543 obj_fy = self.pool.get('account.fiscalyear')
544 used_context = data['form'].get('used_context', {})
545- self.reconcil = data['form'].get('reconcil', False)
546+ self.reconciled = data['form'].get('reconciled', False)
547 self.result_selection = data['form'].get('result_selection', 'customer_supplier')
548 self.target_move = data['form'].get('target_move', 'all')
549 self.period_id = data['form'].get('period_from', False)
550@@ -66,10 +82,7 @@
551 self.exclude_tax = data['form'].get('tax', False)
552 self.instance_ids = data['form'].get('instance_ids', False)
553 self.account_ids = data['form'].get('account_ids', False)
554- PARTNER_REQUEST = ''
555- move_state = ['draft','posted']
556- if self.target_move == 'posted':
557- move_state = ['posted']
558+ self.display_partner = data['form'].get('display_partner', '')
559 self.fiscalyear_id = data['form'].get('fiscalyear_id', False)
560 if self.fiscalyear_id:
561 fy = obj_fy.read(self.cr, self.uid, [self.fiscalyear_id], ['date_start'], context=used_context)
562@@ -109,10 +122,6 @@
563 else:
564 self.INSTANCE_REQUEST = "AND l.instance_id IN %s" % (tuple(self.instance_ids),)
565
566- if (data['model'] == 'res.partner'):
567- ## Si on imprime depuis les partenaires
568- if ids:
569- PARTNER_REQUEST = "AND line.partner_id IN %s",(tuple(ids),)
570 if self.result_selection == 'supplier':
571 self.ACCOUNT_TYPE = ['payable']
572 elif self.result_selection == 'customer':
573@@ -134,26 +143,16 @@
574 if data['form'].get('partner_ids', False):
575 new_ids = data['form']['partner_ids'] # some partners are specifically selected
576 else:
577- # by default display the report only for the partners linked to entries having the requested state
578 partner_to_use = []
579 # check if we should display all partners or only active ones
580 active_selection = data['form'].get('only_active_partners') and ('t',) or ('t', 'f')
581 self.cr.execute(
582- "SELECT DISTINCT l.partner_id, rp.name "
583- "FROM account_move_line AS l, account_account AS account, "
584- "account_move AS am, res_partner AS rp "
585- "WHERE l.partner_id IS NOT NULL "
586- "AND l.account_id = account.id "
587- "AND am.id = l.move_id "
588- "AND am.state IN %s"
589- "AND l.partner_id = rp.id "
590- "AND l.account_id IN %s "
591- " " + self.INSTANCE_REQUEST + " "
592- " " + PARTNER_REQUEST + " "
593- "AND rp.active IN %s "
594- "AND account.active "
595- "ORDER BY rp.name",
596- (tuple(move_state), tuple(self.account_ids), active_selection,))
597+ "SELECT id as partner_id, name "
598+ "FROM res_partner "
599+ "WHERE active IN %s "
600+ "AND name != 'To be defined'"
601+ "ORDER BY name;",
602+ (active_selection,))
603 res = self.cr.dictfetchall()
604 for res_line in res:
605 partner_to_use.append(res_line['partner_id'])
606@@ -195,19 +194,59 @@
607 x += index
608 return "\n".join(parts)
609
610- def lines(self, partner):
611+ def _get_accounts_to_display(self, partner):
612+ """
613+ Returns the list of account codes to be displayed for the partner in parameter
614+ """
615+ if self.accounts_to_display:
616+ return self.accounts_to_display.get(partner.id, [])
617+ move_state = ['draft', 'posted']
618+ if self.target_move == 'posted':
619+ move_state = ['posted']
620+ if self.reconciled == 'yes':
621+ reconcile_tag = "AND l.reconcile_id IS NOT NULL"
622+ elif self.reconciled == 'no':
623+ reconcile_tag = "AND l.reconcile_id IS NULL AND acc.reconcile='t'" # reconcilable entries not reconciled
624+ else: # 'empty'
625+ reconcile_tag = " "
626+ self.cr.execute(
627+ "SELECT l.partner_id, acc.code "
628+ "FROM account_move_line l "
629+ "LEFT JOIN account_journal j ON l.journal_id = j.id "
630+ "LEFT JOIN account_account acc ON l.account_id = acc.id "
631+ "LEFT JOIN res_currency c ON l.currency_id = c.id "
632+ "LEFT JOIN account_move m ON m.id = l.move_id "
633+ "WHERE "
634+ " l.account_id IN %s AND " + self.query + " "
635+ "AND m.state IN %s "
636+ " " + reconcile_tag + " "
637+ " " + self.DATE_FROM + " "
638+ " " + self.INSTANCE_REQUEST + " "
639+ "GROUP BY l.partner_id, acc.code ORDER BY acc.code;",
640+ (tuple(self.account_ids), tuple(move_state)))
641+ for x in self.cr.fetchall():
642+ self.accounts_to_display.setdefault(x[0], []).append(x[1])
643+ return self.accounts_to_display.get(partner.id, [])
644+
645+ def lines(self, partner, account_code):
646+ if partner.id in self.report_lines and account_code in self.report_lines[partner.id]:
647+ return self.report_lines[partner.id][account_code]
648 move_state = ['draft','posted']
649 if self.target_move == 'posted':
650 move_state = ['posted']
651
652- if self.reconcil:
653+ if self.reconciled == 'yes':
654+ RECONCILE_TAG = "AND l.reconcile_id IS NOT NULL"
655+ elif self.reconciled == 'no':
656+ RECONCILE_TAG = "AND l.reconcile_id IS NULL AND acc.reconcile='t'" # reconcilable entries not reconciled
657+ else: # 'empty'
658 RECONCILE_TAG = " "
659- else:
660- RECONCILE_TAG = "AND l.reconcile_id IS NULL"
661 self.cr.execute(
662 "SELECT l.id, l.date, j.code, acc.code as a_code, acc.name as a_name, l.ref, m.name as move_name, l.name, "
663 "COALESCE(l.debit_currency, 0) as debit, COALESCE(l.credit_currency, 0) as credit, "
664- "l.debit - l.credit as total_functional, l.amount_currency, l.currency_id, c.name AS currency_code "
665+ "COALESCE(l.debit, 0) AS debit_functional, COALESCE(l.credit, 0) AS credit_functional, "
666+ "l.debit - l.credit as total_functional, l.amount_currency, l.currency_id, c.name AS currency_code, "
667+ "l.reconcile_txt "
668 "FROM account_move_line l " \
669 "LEFT JOIN account_journal j " \
670 "ON (l.journal_id = j.id) " \
671@@ -216,32 +255,98 @@
672 "LEFT JOIN res_currency c ON (l.currency_id=c.id)" \
673 "LEFT JOIN account_move m ON (m.id=l.move_id)" \
674 "WHERE l.partner_id = %s " \
675- "AND l.account_id IN %s AND " + self.query +" " \
676+ "AND l.account_id = (SELECT id FROM account_account WHERE code = %s LIMIT 1) "
677+ "AND " + self.query + " " \
678 "AND m.state IN %s " \
679 " " + RECONCILE_TAG + " "\
680 " " + self.DATE_FROM + " "\
681 " " + self.INSTANCE_REQUEST + " "
682- "ORDER BY l.date",
683- (partner.id, tuple(self.account_ids), tuple(move_state)))
684- return self.cr.dictfetchall()
685+ "ORDER BY l.date;",
686+ (partner.id, account_code, tuple(move_state)))
687+ if partner.id not in self.report_lines:
688+ self.report_lines[partner.id] = {}
689+ self.report_lines[partner.id][account_code] = self.cr.dictfetchall()
690+ # initialize totals in functional currency
691+ if partner.id not in self.fctal_totals:
692+ self.fctal_totals[partner.id] = {}
693+ if account_code not in self.fctal_totals[partner.id]:
694+ self.fctal_totals[partner.id][account_code] = {
695+ 'debit_functional': 0.0,
696+ 'credit_functional': 0.0,
697+ 'total_functional': 0.0,
698+ }
699+ # initialize subtotals in booking currency
700+ if partner.id not in self.subtotals:
701+ self.subtotals[partner.id] = {}
702+ if account_code not in self.subtotals[partner.id]:
703+ self.subtotals[partner.id][account_code] = {}
704+ # fill in fctal_totals/subtotals
705+ for line in self.report_lines[partner.id][account_code]:
706+ self.fctal_totals[partner.id][account_code]['debit_functional'] += line['debit_functional'] or 0.0
707+ self.fctal_totals[partner.id][account_code]['credit_functional'] += line['credit_functional'] or 0.0
708+ self.fctal_totals[partner.id][account_code]['total_functional'] += line['total_functional'] or 0.0
709+ if line['currency_code'] not in self.subtotals[partner.id][account_code]:
710+ self.subtotals[partner.id][account_code][line['currency_code']] = {
711+ 'debit': 0.0,
712+ 'credit': 0.0,
713+ 'amount_currency': 0.0,
714+ 'total_functional': 0.0,
715+ }
716+ self.subtotals[partner.id][account_code][line['currency_code']]['debit'] += line['debit'] or 0.0
717+ self.subtotals[partner.id][account_code][line['currency_code']]['credit'] += line['credit'] or 0.0
718+ self.subtotals[partner.id][account_code][line['currency_code']]['amount_currency'] += line['amount_currency'] or 0.0
719+ self.subtotals[partner.id][account_code][line['currency_code']]['total_functional'] += line['total_functional'] or 0.0
720+ return self.report_lines[partner.id][account_code]
721+
722+ def _get_subtotals(self, partner, account_code):
723+ """
724+ Returns a dictionary with key = currency code, and value = dict. of the subtotals values for the
725+ partner/account_code, i.e. {'credit': xxx, 'debit': xxx, 'amount_currency': xxx, 'total_functional': xxx}
726+ """
727+ if partner.id not in self.subtotals or account_code not in self.subtotals[partner.id]:
728+ self.lines(partner, account_code) # fills in the self.subtotals dictionary
729+ return self.subtotals[partner.id][account_code]
730+
731+ def _get_fctal_totals(self, partner, account_code):
732+ """
733+ Returns a dictionary with the total values in functional currency for the partner/code in param:
734+ {'credit_functional': xxx, 'debit_functional': xxx, 'total_functional': xxx}
735+ """
736+ if partner.id not in self.fctal_totals or account_code not in self.fctal_totals[partner.id]:
737+ self.lines(partner, account_code) # fills in the self.fctal_totals dictionary
738+ return self.fctal_totals[partner.id][account_code]
739+
740+ def _update_current_partner_number(self):
741+ """
742+ Increments the current partner number and always returns True (used for the display in rml template)
743+ """
744+ self.current_partner_number += 1
745+ return True
746
747 def _sum_debit_partner(self, partner):
748+ if partner.id in self.debit_balances:
749+ # compute the result only once per partner
750+ return self.debit_balances[partner.id]
751 move_state = ['draft','posted']
752 if self.target_move == 'posted':
753 move_state = ['posted']
754
755 result_tmp = 0.0
756- if self.reconcil:
757+ if self.reconciled == 'yes':
758+ RECONCILE_TAG = "AND l.reconcile_id IS NOT NULL"
759+ elif self.reconciled == 'no':
760+ RECONCILE_TAG = "AND l.reconcile_id IS NULL AND acc.reconcile='t'" # reconcilable entries not reconciled
761+ else: # 'empty'
762 RECONCILE_TAG = " "
763- else:
764- RECONCILE_TAG = "AND reconcile_id IS NULL"
765
766 self.cr.execute(
767 "SELECT sum(debit) " \
768 "FROM account_move_line AS l, " \
769- "account_move AS m "
770+ "account_move AS m, "
771+ "account_account AS acc "
772 "WHERE l.partner_id = %s " \
773 "AND m.id = l.move_id " \
774+ "AND l.account_id = acc.id "
775 "AND m.state IN %s "
776 "AND account_id IN %s" \
777 " " + RECONCILE_TAG + " " \
778@@ -255,25 +360,33 @@
779 result_tmp = contemp[0] or 0.0
780 else:
781 result_tmp = result_tmp + 0.0
782+ self.debit_balances[partner.id] = result_tmp
783 return result_tmp
784
785 def _sum_credit_partner(self, partner):
786+ if partner.id in self.credit_balances:
787+ # compute the result only once per partner
788+ return self.credit_balances[partner.id]
789 move_state = ['draft','posted']
790 if self.target_move == 'posted':
791 move_state = ['posted']
792
793 result_tmp = 0.0
794- if self.reconcil:
795+ if self.reconciled == 'yes':
796+ RECONCILE_TAG = "AND l.reconcile_id IS NOT NULL"
797+ elif self.reconciled == 'no':
798+ RECONCILE_TAG = "AND l.reconcile_id IS NULL AND acc.reconcile='t'" # reconcilable entries not reconciled
799+ else: # 'empty'
800 RECONCILE_TAG = " "
801- else:
802- RECONCILE_TAG = "AND reconcile_id IS NULL"
803
804 self.cr.execute(
805 "SELECT sum(credit) " \
806 "FROM account_move_line AS l, " \
807- "account_move AS m "
808+ "account_move AS m, "
809+ "account_account AS acc "
810 "WHERE l.partner_id=%s " \
811 "AND m.id = l.move_id " \
812+ "AND l.account_id = acc.id "
813 "AND m.state IN %s "
814 "AND account_id IN %s" \
815 " " + RECONCILE_TAG + " " \
816@@ -287,8 +400,28 @@
817 result_tmp = contemp[0] or 0.0
818 else:
819 result_tmp = result_tmp + 0.0
820+ self.credit_balances[partner.id] = result_tmp
821 return result_tmp
822
823+ def _partners_to_display(self, partners):
824+ """
825+ Returns the partners to be displayed in the report as a list of res.partner browse records
826+ """
827+ to_display = partners
828+ if self.display_partner == 'non-zero_balance':
829+ for p in partners:
830+ # fill in the dictionaries self.debit_balances and self.credit_balances
831+ self._sum_debit_partner(p)
832+ self._sum_credit_partner(p)
833+ to_display = [p for p in partners if abs(self.debit_balances[p.id] - self.credit_balances[p.id]) > 10**-3]
834+ elif self.display_partner == 'with_movements':
835+ for p in partners:
836+ for account_code in self._get_accounts_to_display(p):
837+ # fill in the dictionary self.report_lines
838+ self.lines(p, account_code)
839+ to_display = [p for p in partners if p.id in self.report_lines and self.report_lines[p.id]]
840+ return to_display
841+
842 def _get_partners(self):
843 if self.result_selection == 'customer':
844 return _('Receivable Accounts')
845@@ -298,6 +431,30 @@
846 return _('Receivable and Payable Accounts')
847 return ''
848
849+ def _get_reconcile_selection(self):
850+ """
851+ Returns "Yes" if "Reconciled: Yes" is selected in the wizard
852+ """
853+ selection = _('All')
854+ if self.reconciled == 'yes':
855+ selection = _('Yes')
856+ elif self.reconciled == 'no':
857+ selection = _('No')
858+ return selection
859+
860+ def _get_display_partners_selection(self):
861+ """
862+ Returns the String to display in the "Display Partners" section of the report header
863+ """
864+ selection = '-'
865+ if self.display_partner == 'all':
866+ selection = _('All Partners')
867+ elif self.display_partner == 'with_movements':
868+ selection = _('With movements')
869+ elif self.display_partner == 'non-zero_balance':
870+ selection = _('With balance is not equal to 0')
871+ return selection
872+
873 def _sum_currency_amount_account(self, account, form):
874 self._set_get_account_currency_code(account.id)
875 self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %s ", (account.id,))
876
877=== modified file 'bin/addons/account/report/account_partner_ledger.rml'
878--- bin/addons/account/report/account_partner_ledger.rml 2017-06-01 09:47:21 +0000
879+++ bin/addons/account/report/account_partner_ledger.rml 2018-08-17 15:39:40 +0000
880@@ -173,6 +173,7 @@
881 <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
882 <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
883 <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
884+ <lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
885 </blockTableStyle>
886 <blockTableStyle id="Table3">
887 <blockAlignment value="LEFT"/>
888@@ -244,7 +245,7 @@
889 <initialize>
890 <paraStyle name="all" alignment="justify"/>
891 </initialize>
892- <paraStyle name="P1" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
893+ <paraStyle name="P1" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
894 <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
895 <paraStyle name="P3" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
896 <paraStyle name="P4" fontName="Helvetica" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
897@@ -253,6 +254,8 @@
898 <paraStyle name="P7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
899 <paraStyle name="P8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
900 <paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
901+ <paraStyle name="PRightBold" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
902+ <paraStyle name="PCenteredBold" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
903 <paraStyle name="Standard" fontName="Helvetica"/>
904 <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
905 <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
906@@ -290,118 +293,459 @@
907 </stylesheet>
908 <story>
909 <para style="terp_default_8">[[ setLang(data['lang']) ]]</para>
910- <para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
911- <para style="terp_default_8">
912- <font color="white"> </font>
913- </para>
914- <para style="terp_header_Centre">Partner Ledger</para>
915- <para style="terp_default_8">
916- <font color="white"> </font>
917- </para>
918- <blockTable colWidths="65.0,65.0,125.0,85.0,85.0,167.0,85.0,85.0" style="Table1">
919- <tr>
920- <td>
921- <para style="terp_tblheader_General_Centre">Chart of Account</para>
922- </td>
923- <td>
924- <para style="terp_tblheader_General_Centre">Fiscal Year</para>
925- </td>
926- <td>
927- <para style="terp_tblheader_General_Centre">Journal</para>
928- </td>
929- <td>
930- <para style="terp_tblheader_General_Centre">Partner's</para>
931- </td>
932- <td>
933- <para style="terp_tblheader_General_Centre">Accounts</para>
934- </td>
935- <td>
936- <para style="terp_tblheader_General_Centre">Filters By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para>
937- </td>
938- <td>
939- <para style="terp_tblheader_General_Centre">Target Moves</para>
940- </td>
941- <td>
942- <para style="terp_tblheader_General_Centre">Proprietary Instances</para>
943- </td>
944- </tr>
945- </blockTable>
946- <blockTable colWidths="65.0,65.0,125.0,85.0,85.0,167.0,85.0,85.0" style="Table4">
947- <tr>
948- <td>
949- <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
950- </td>
951- <td>
952- <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
953- </td>
954- <td>
955- <para style="terp_default_Centre_8">[[ get_journals_str(data) ]]</para>
956- </td>
957- <td>
958- <para style="terp_default_Centre_8">[[ get_partners() ]]</para>
959- </td>
960- <td>
961- <para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para>
962- </td>
963- <td>
964- <para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]]</para>
965- <blockTable colWidths="79.0,79.0" style="Table7">
966- <tr>
967- <td>
968- <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Date') and translate('Start Date') or removeParentNode('blockTable') ]]</para>
969- </td>
970- <td>
971- <para style="terp_tblheader_General_Centre">End Date</para>
972- </td>
973- </tr>
974- </blockTable>
975- <blockTable colWidths="79.0,79.0" style="Table9">
976- <tr>
977- <td>
978- <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Date') and ' ' or removeParentNode('blockTable') ]] [[ formatLang(get_start_date(data),date=True) ]]</para>
979- </td>
980- <td>
981- <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
982- </td>
983- </tr>
984- </blockTable>
985- <blockTable colWidths="79.0,79.0" style="Table10">
986- <tr>
987- <td>
988- <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Periods') and translate('Start Period') or removeParentNode('blockTable') ]]</para>
989- </td>
990- <td>
991- <para style="terp_tblheader_General_Centre">End Period</para>
992- </td>
993- </tr>
994- </blockTable>
995- <blockTable colWidths="79.0,79.0" style="Table11">
996- <tr>
997- <td>
998- <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Periods') and ' ' or removeParentNode('blockTable') ]] [[ get_start_period(data) or removeParentNode('para') ]]</para>
999- </td>
1000- <td>
1001- <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
1002- </td>
1003- </tr>
1004- </blockTable>
1005- <para style="terp_default_8">
1006- <font color="white"> </font>
1007- </para>
1008- </td>
1009- <td>
1010- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
1011- </td>
1012- <td>
1013- <para style="terp_default_Centre_8">[[ get_instances_str(data) ]]</para>
1014- </td>
1015- </tr>
1016- </blockTable>
1017- <para style="terp_default_8">
1018- <font color="white"> </font>
1019- </para>
1020 <section>
1021- <blockTable colWidths="72.0,25.0,101.0,46.0,114.0,61.0,77.0,77.0,87.0,99.0" style="Table2">
1022+ <para style="terp_default_8">[[ repeatIn(partners_to_display(objects), 'p') ]]</para>
1023+ <para style="terp_default_8">
1024+ <font color="white"> </font>
1025+ </para>
1026+ <!-- update the number of the current partner displayed -->
1027+ <para style="terp_header_Centre">[[ update_current_partner_number() and translate('Partner Ledger') ]]</para>
1028+ <para style="terp_default_8">
1029+ <font color="white"> </font>
1030+ </para>
1031+ <!-- NOTE: if this HEADER has to be modified: modify also the "no data" version (below) and the "partners
1032+ displayed one after another" version -->
1033+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table1">
1034+ <tr>
1035+ <td>
1036+ <para style="terp_tblheader_General_Centre">Chart of Account</para>
1037+ </td>
1038+ <td>
1039+ <para style="terp_tblheader_General_Centre">Fiscal Year</para>
1040+ </td>
1041+ <td>
1042+ <para style="terp_tblheader_General_Centre">Journals</para>
1043+ </td>
1044+ <td>
1045+ <para style="terp_tblheader_General_Centre">Accounts</para>
1046+ </td>
1047+ <td>
1048+ <para style="terp_tblheader_General_Centre">Proprietary Instances</para>
1049+ </td>
1050+ <td>
1051+ <para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para>
1052+ </td>
1053+ <td>
1054+ <para style="terp_tblheader_General_Centre">Display</para>
1055+ </td>
1056+ <td>
1057+ <para style="terp_tblheader_General_Centre">Func. Currency</para>
1058+ </td>
1059+ </tr>
1060+ </blockTable>
1061+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table4">
1062+ <tr>
1063+ <td>
1064+ <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
1065+ </td>
1066+ <td>
1067+ <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
1068+ </td>
1069+ <td>
1070+ <para style="terp_default_Centre_8">[[ get_journals_str(data) ]]</para>
1071+ </td>
1072+ <td>
1073+ <para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para>
1074+ </td>
1075+ <td>
1076+ <para style="terp_default_Centre_8">[[ get_instances_str(data) ]]</para>
1077+ </td>
1078+ <td>
1079+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]]</para>
1080+ <blockTable colWidths="79.0,79.0" style="Table7">
1081+ <tr>
1082+ <td>
1083+ <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Date') and translate('Start Date') or removeParentNode('blockTable') ]]</para>
1084+ </td>
1085+ <td>
1086+ <para style="terp_tblheader_General_Centre">End Date</para>
1087+ </td>
1088+ </tr>
1089+ </blockTable>
1090+ <blockTable colWidths="79.0,79.0" style="Table9">
1091+ <tr>
1092+ <td>
1093+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Date') and ' ' or removeParentNode('blockTable') ]] [[ formatLang(get_start_date(data),date=True) ]]</para>
1094+ </td>
1095+ <td>
1096+ <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
1097+ </td>
1098+ </tr>
1099+ </blockTable>
1100+ <blockTable colWidths="79.0,79.0" style="Table10">
1101+ <tr>
1102+ <td>
1103+ <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Periods') and translate('Start Period') or removeParentNode('blockTable') ]]</para>
1104+ </td>
1105+ <td>
1106+ <para style="terp_tblheader_General_Centre">End Period</para>
1107+ </td>
1108+ </tr>
1109+ </blockTable>
1110+ <blockTable colWidths="79.0,79.0" style="Table11">
1111+ <tr>
1112+ <td>
1113+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Periods') and ' ' or removeParentNode('blockTable') ]] [[ get_start_period(data) or removeParentNode('para') ]]</para>
1114+ </td>
1115+ <td>
1116+ <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
1117+ </td>
1118+ </tr>
1119+ </blockTable>
1120+ <para style="terp_default_8">
1121+ <font color="white"> </font>
1122+ </para>
1123+ </td>
1124+ <td>
1125+ <para style="terp_default_Centre_8">[[ "%s: %s, %s: %s, %s: %s, %s: %s" % (
1126+ translate("Partner's"), get_partners(),
1127+ translate('Target Moves'), get_target_move(data),
1128+ translate('Reconciled'), get_reconcile_selection(),
1129+ translate('Display Partners'), get_display_partners_selection(),
1130+ ) ]]</para>
1131+ </td>
1132+ <td>
1133+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
1134+ </td>
1135+ </tr>
1136+ </blockTable>
1137+ <para style="terp_default_8">
1138+ <font color="white"> </font>
1139+ </para>
1140+ <para style="terp_default_8">
1141+ <font color="white"> </font>
1142+ </para>
1143+ <section>
1144+ <blockTable colWidths="72.0,25.0,101.0,46.0,104.0,60.0,51.0,67.0,67.0,77.0,89.0" style="Table2">
1145+ <tr>
1146+ <td>
1147+ <para style="terp_tblheader_Details">Date</para>
1148+ </td>
1149+ <td>
1150+ <para style="terp_tblheader_Details">JRNL</para>
1151+ </td>
1152+ <td>
1153+ <para style="terp_tblheader_Details_Centre">Entry Sequence</para>
1154+ </td>
1155+ <td>
1156+ <para style="terp_tblheader_Details_Centre">Account</para>
1157+ </td>
1158+ <td>
1159+ <para style="terp_tblheader_Details_Centre">Entry Label</para>
1160+ </td>
1161+ <td>
1162+ <para style="terp_tblheader_Details">Reconcile Number</para>
1163+ </td>
1164+ <td>
1165+ <para style="terp_tblheader_Details">Currency</para>
1166+ </td>
1167+ <td>
1168+ <para style="terp_tblheader_Details_Centre">Debit</para>
1169+ </td>
1170+ <td>
1171+ <para style="terp_tblheader_Details_Centre">Credit</para>
1172+ </td>
1173+ <td>
1174+ <para style="terp_tblheader_Details_Right">Booking Balance</para>
1175+ </td>
1176+ <td>
1177+ <para style="terp_tblheader_Details_Right">Balance [[ company.currency_id.name ]]</para>
1178+ </td>
1179+ </tr>
1180+ </blockTable>
1181+ <blockTable colWidths="370.0,40.0,80.0,80.0,90.0,102.0" style="Table8">
1182+ <tr>
1183+ <td>
1184+ <para style="terp_tblheader_Details">
1185+ <font color="white"> </font>
1186+ </para>
1187+ </td>
1188+ <td>
1189+ <para style="terp_tblheader_Details">
1190+ <font color="white"> </font>
1191+ </para>
1192+ </td>
1193+ <td>
1194+ <para style="terp_tblheader_Details_Centre">
1195+ <font color="white"> </font>
1196+ </para>
1197+ </td>
1198+ <td>
1199+ <para style="terp_tblheader_Details_Centre">
1200+ <font color="white"> </font>
1201+ </para>
1202+ </td>
1203+ <td>
1204+ <para style="terp_tblheader_Details">
1205+ <font color="white"> </font>
1206+ </para>
1207+ </td>
1208+ <td>
1209+ <para style="terp_tblheader_Details_Right">
1210+ <font color="white"> </font>
1211+ </para>
1212+ </td>
1213+ </tr>
1214+ </blockTable>
1215+ <blockTable colWidths="420.0,30.0,70.0,70.0,80.0,92.0" style="Table12">
1216+ <tr>
1217+ <td>
1218+ <para style="terp_default_Bold_9">[[ p.name ]]</para>
1219+ </td>
1220+ <td>
1221+ <para style="terp_default_Bold_9">[[ company.currency_id.name ]]</para>
1222+ </td>
1223+ <td>
1224+ <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_partner(p) or 0.0) ]]</para>
1225+ </td>
1226+ <td>
1227+ <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_partner(p) or 0.0) ]]</para>
1228+ </td>
1229+ <td>
1230+ <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) or 0.0) - (sum_credit_partner(p) or 0.0)) ]]</para>
1231+ </td>
1232+ <td>
1233+ <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) or 0.0) - (sum_credit_partner(p) or 0.0)) ]]</para>
1234+ </td>
1235+ </tr>
1236+ </blockTable>
1237+
1238+ <section>
1239+ <para style="terp_default_8">[[ repeatIn(get_accounts_to_display(p), 'account_code') ]]</para>
1240+ <!-- TOTALS IN FUNCTIONAL -->
1241+ <section>
1242+ <blockTable colWidths="296.0,124.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1243+ <tr>
1244+ <td>
1245+ <para style="PCenteredBold">[[ p.name or '' ]]</para>
1246+ </td>
1247+ <td>
1248+ <para style="PRightBold">[[ account_code ]]</para>
1249+ </td>
1250+ <td>
1251+ <para style="terp_default_Bold_8">[[ company.currency_id.name ]]</para>
1252+ </td>
1253+ <td>
1254+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['debit_functional'] or 0.0) ]]</para>
1255+ </td>
1256+ <td>
1257+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['credit_functional'] or 0.0) ]]</para>
1258+ </td>
1259+ <td>
1260+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['total_functional'] or 0.0) ]]</para>
1261+ </td>
1262+ <td>
1263+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['total_functional'] or 0.0) ]]</para>
1264+ </td>
1265+ </tr>
1266+ </blockTable>
1267+ <para style="terp_default_2">
1268+ <font color="white"> </font>
1269+ </para>
1270+ </section>
1271+ <!-- SUBTOTAL LINES IN BOOKING -->
1272+ <section>
1273+ <para style="terp_default_8">[[ repeatIn(get_subtotals(p, account_code), 'curr') ]]</para>
1274+ <blockTable colWidths="296.0,124.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1275+ <tr>
1276+ <td>
1277+ <para style="PCenteredBold">[[ p.name or '' ]]</para>
1278+ </td>
1279+ <td>
1280+ <para style="PRightBold">Subtotal</para>
1281+ </td>
1282+ <td>
1283+ <para style="terp_default_Bold_8">[[ curr or '' ]]</para>
1284+ </td>
1285+ <td>
1286+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['debit'] or 0.0) ]]</para>
1287+ </td>
1288+ <td>
1289+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['credit'] or 0.0) ]]</para>
1290+ </td>
1291+ <td>
1292+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['amount_currency'] or 0.0) ]]</para>
1293+ </td>
1294+ <td>
1295+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['total_functional'] or 0.0) ]]</para>
1296+ </td>
1297+ </tr>
1298+ </blockTable>
1299+ <para style="terp_default_2">
1300+ <font color="white"> </font>
1301+ </para>
1302+ </section>
1303+ <!-- LINES -->
1304+ <section>
1305+ <para style="terp_default_8">[[ repeatIn(lines(p, account_code), 'line') ]]</para>
1306+ <blockTable colWidths="77.0,25.0,88.0,41.0,139.0,50.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1307+ <tr>
1308+ <td>
1309+ <para style="P3">[[ formatLang(line['date'], date=True) ]]</para>
1310+ </td>
1311+ <td>
1312+ <para style="P7">[[ line['code'] ]]</para>
1313+ </td>
1314+ <td>
1315+ <para style="P8">[[ line['move_name'] ]]</para>
1316+ </td>
1317+ <td>
1318+ <para style="P7">[[ line['a_code'] ]]</para>
1319+ </td>
1320+ <td>
1321+ <para style="P3">[[ format_entry_label('%s - %s' % (line['ref'] or '', line['name'] or ''), 29) ]]</para>
1322+ </td>
1323+ <td>
1324+ <para style="P3">[[ line['reconcile_txt'] or '' ]]</para>
1325+ </td>
1326+ <td>
1327+ <para style="P3">[[ line['currency_code'] or '' ]]</para>
1328+ </td>
1329+ <td>
1330+ <para style="P7">[[ formatLang(line['debit'] or 0.0) ]]</para>
1331+ </td>
1332+ <td>
1333+ <para style="P7">[[ formatLang(line['credit'] or 0.0) ]]</para>
1334+ </td>
1335+ <td>
1336+ <para style="P7">[[ (line['currency_id'] == None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] or 0.0) ]]</para>
1337+ </td>
1338+ <td>
1339+ <para style="P7">[[ formatLang(line['total_functional'] or 0.0) ]]</para>
1340+ </td>
1341+ </tr>
1342+ </blockTable>
1343+ <para style="terp_default_2">
1344+ <font color="white"> </font>
1345+ </para>
1346+ </section>
1347+ </section>
1348+ <para style="terp_default_2">
1349+ <font color="white"> </font>
1350+ </para>
1351+ </section>
1352+ <pageBreak>[[ (nb_partners(objects) == 0 or get_current_partner_number() == nb_partners(objects)) and removeParentNode('pageBreak')]]</pageBreak>
1353+ </section>
1354+ <section> <!-- if there is NO DATA to be displayed: display the header only -->
1355+ <para style="terp_default_8">
1356+ [[ nb_partners(objects) > 0 and removeParentNode('section') ]]
1357+ <font color="white"> </font>
1358+ </para>
1359+ <para style="terp_header_Centre">Partner Ledger</para>
1360+ <para style="terp_default_8">
1361+ <font color="white"> </font>
1362+ </para>
1363+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table1">
1364+ <tr>
1365+ <td>
1366+ <para style="terp_tblheader_General_Centre">Chart of Account</para>
1367+ </td>
1368+ <td>
1369+ <para style="terp_tblheader_General_Centre">Fiscal Year</para>
1370+ </td>
1371+ <td>
1372+ <para style="terp_tblheader_General_Centre">Journals</para>
1373+ </td>
1374+ <td>
1375+ <para style="terp_tblheader_General_Centre">Accounts</para>
1376+ </td>
1377+ <td>
1378+ <para style="terp_tblheader_General_Centre">Proprietary Instances</para>
1379+ </td>
1380+ <td>
1381+ <para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para>
1382+ </td>
1383+ <td>
1384+ <para style="terp_tblheader_General_Centre">Display</para>
1385+ </td>
1386+ <td>
1387+ <para style="terp_tblheader_General_Centre">Func. Currency</para>
1388+ </td>
1389+ </tr>
1390+ </blockTable>
1391+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table4">
1392+ <tr>
1393+ <td>
1394+ <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
1395+ </td>
1396+ <td>
1397+ <para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
1398+ </td>
1399+ <td>
1400+ <para style="terp_default_Centre_8">[[ get_journals_str(data) ]]</para>
1401+ </td>
1402+ <td>
1403+ <para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para>
1404+ </td>
1405+ <td>
1406+ <para style="terp_default_Centre_8">[[ get_instances_str(data) ]]</para>
1407+ </td>
1408+ <td>
1409+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]]</para>
1410+ <blockTable colWidths="79.0,79.0" style="Table7">
1411+ <tr>
1412+ <td>
1413+ <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Date') and translate('Start Date') or removeParentNode('blockTable') ]]</para>
1414+ </td>
1415+ <td>
1416+ <para style="terp_tblheader_General_Centre">End Date</para>
1417+ </td>
1418+ </tr>
1419+ </blockTable>
1420+ <blockTable colWidths="79.0,79.0" style="Table9">
1421+ <tr>
1422+ <td>
1423+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Date') and ' ' or removeParentNode('blockTable') ]] [[ formatLang(get_start_date(data),date=True) ]]</para>
1424+ </td>
1425+ <td>
1426+ <para style="terp_default_Centre_8">[[ formatLang(get_end_date(data),date=True) ]]</para>
1427+ </td>
1428+ </tr>
1429+ </blockTable>
1430+ <blockTable colWidths="79.0,79.0" style="Table10">
1431+ <tr>
1432+ <td>
1433+ <para style="terp_tblheader_General_Centre">[[ get_filter(data)==translate('Periods') and translate('Start Period') or removeParentNode('blockTable') ]]</para>
1434+ </td>
1435+ <td>
1436+ <para style="terp_tblheader_General_Centre">End Period</para>
1437+ </td>
1438+ </tr>
1439+ </blockTable>
1440+ <blockTable colWidths="79.0,79.0" style="Table11">
1441+ <tr>
1442+ <td>
1443+ <para style="terp_default_Centre_8">[[ get_filter(data)==translate('Periods') and ' ' or removeParentNode('blockTable') ]] [[ get_start_period(data) or removeParentNode('para') ]]</para>
1444+ </td>
1445+ <td>
1446+ <para style="terp_default_Centre_8">[[ get_end_period(data) or removeParentNode('para') ]]</para>
1447+ </td>
1448+ </tr>
1449+ </blockTable>
1450+ <para style="terp_default_8">
1451+ <font color="white"> </font>
1452+ </para>
1453+ </td>
1454+ <td>
1455+ <para style="terp_default_Centre_8">[[ "%s: %s, %s: %s, %s: %s, %s: %s" % (
1456+ translate("Partner's"), get_partners(),
1457+ translate('Target Moves'), get_target_move(data),
1458+ translate('Reconciled'), get_reconcile_selection(),
1459+ translate('Display Partners'), get_display_partners_selection(),
1460+ ) ]]</para>
1461+ </td>
1462+ <td>
1463+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
1464+ </td>
1465+ </tr>
1466+ </blockTable>
1467+ <para style="terp_default_8">
1468+ <font color="white"> </font>
1469+ </para>
1470+ <para style="terp_default_8">
1471+ <font color="white"> </font>
1472+ </para>
1473+ <blockTable colWidths="72.0,25.0,101.0,46.0,104.0,60.0,51.0,67.0,67.0,77.0,89.0" style="Table2">
1474 <tr>
1475 <td>
1476 <para style="terp_tblheader_Details">Date</para>
1477@@ -416,16 +760,19 @@
1478 <para style="terp_tblheader_Details_Centre">Account</para>
1479 </td>
1480 <td>
1481- <para style="terp_tblheader_Details">Entry Label</para>
1482+ <para style="terp_tblheader_Details_Centre">Entry Label</para>
1483+ </td>
1484+ <td>
1485+ <para style="terp_tblheader_Details">Reconcile Number</para>
1486 </td>
1487 <td>
1488 <para style="terp_tblheader_Details">Currency</para>
1489 </td>
1490 <td>
1491- <para style="terp_tblheader_Details_Right">Debit</para>
1492+ <para style="terp_tblheader_Details_Centre">Debit</para>
1493 </td>
1494 <td>
1495- <para style="terp_tblheader_Details_Right">Credit</para>
1496+ <para style="terp_tblheader_Details_Centre">Credit</para>
1497 </td>
1498 <td>
1499 <para style="terp_tblheader_Details_Right">Booking Balance</para>
1500@@ -435,71 +782,6 @@
1501 </td>
1502 </tr>
1503 </blockTable>
1504- <blockTable colWidths="370.0,40.0,80.0,80.0,90.0,102.0" style="Table12">
1505- <tr>
1506- <td>
1507- <para style="terp_default_Bold_9">[[ p.name ]][[ p.ref and ' - %s' % p.ref]]</para>
1508- </td>
1509- <td>
1510- <para style="terp_default_Bold_9">[[ company.currency_id.name ]]</para>
1511- </td>
1512- <td>
1513- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit_partner(p) or 0.0) ]]</para>
1514- </td>
1515- <td>
1516- <para style="terp_default_Bold_9_Right">[[ formatLang(sum_credit_partner(p) or 0.0) ]]</para>
1517- </td>
1518- <td>
1519- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) or 0.0) - (sum_credit_partner(p) or 0.0)) ]]</para>
1520- </td>
1521- <td>
1522- <para style="terp_default_Bold_9_Right">[[ formatLang((sum_debit_partner(p) or 0.0) - (sum_credit_partner(p) or 0.0)) ]]</para>
1523- </td>
1524- </tr>
1525- </blockTable>
1526- <section>
1527- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
1528- <blockTable colWidths="87.0,25.0,93.0,41.0,124.0,40.0,80.0,80.0,90.0,102.0" style="Table14">
1529- <tr>
1530- <td>
1531- <para style="P3">[[ formatLang(line['date'],date=True) ]]</para>
1532- </td>
1533- <td>
1534- <para style="P4">[[ line['code'] ]]</para>
1535- </td>
1536- <td>
1537- <para style="P8">[[ line['move_name'] ]]</para>
1538- </td>
1539- <td>
1540- <para style="P7">[[ line['a_code'] ]]</para>
1541- </td>
1542- <td>
1543- <para style="P3">[[ format_entry_label('%s - %s' % (line['ref'] or '', line['name'] or ''), 29) ]]</para>
1544- </td>
1545- <td>
1546- <para style="P3">[[ line['currency_code'] or '' ]]</para>
1547- </td>
1548- <td>
1549- <para style="P9">[[ formatLang(line['debit'] or 0.0) ]]</para>
1550- </td>
1551- <td>
1552- <para style="P9">[[ formatLang(line['credit'] or 0.0) ]]</para>
1553- </td>
1554- <td>
1555- <para style="P9">[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] or 0.0) ]]</para>
1556- </td>
1557- <td>
1558- <para style="P9">[[ formatLang(line['total_functional'] or 0.0) ]]</para>
1559- </td>
1560- </tr>
1561- </blockTable>
1562- <para style="terp_default_2">
1563- <font color="white"> </font>
1564- </para>
1565- </section>
1566- <para style="terp_default_2">
1567- <font color="white"> </font>
1568- </para>
1569 </section>
1570 </story>
1571 </document>
1572
1573=== modified file 'bin/addons/account/report/account_partner_ledger_other.rml'
1574--- bin/addons/account/report/account_partner_ledger_other.rml 2017-06-01 09:47:21 +0000
1575+++ bin/addons/account/report/account_partner_ledger_other.rml 2018-08-17 15:39:40 +0000
1576@@ -210,6 +210,7 @@
1577 <lineStyle kind="LINEBELOW" colorName="#000000" start="7,-1" stop="7,-1"/>
1578 <lineStyle kind="LINEBELOW" colorName="#000000" start="8,-1" stop="8,-1"/>
1579 <lineStyle kind="LINEBELOW" colorName="#000000" start="9,-1" stop="9,-1"/>
1580+ <lineStyle kind="LINEBELOW" colorName="#000000" start="10,-1" stop="10,-1"/>
1581 </blockTableStyle>
1582 <blockTableStyle id="Table8">
1583 <blockAlignment value="LEFT"/>
1584@@ -266,6 +267,8 @@
1585 <paraStyle name="P7" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
1586 <paraStyle name="P8" fontName="Helvetica" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
1587 <paraStyle name="P9" fontName="Helvetica" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
1588+ <paraStyle name="PRightBold" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
1589+ <paraStyle name="PCenteredBold" fontName="Helvetica-Bold" fontSize="7.0" leading="9" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
1590 <paraStyle name="Standard" fontName="Helvetica"/>
1591 <paraStyle name="Heading" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="12.0" spaceAfter="6.0"/>
1592 <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
1593@@ -310,7 +313,8 @@
1594 <para style="terp_default_8">
1595 <font color="white"> </font>
1596 </para>
1597- <blockTable colWidths="65.0,65.0,125.0,85.0,85.0,167.0,85.0,85.0" style="Table1">
1598+ <!-- NOTE: if this HEADER has to be modified: modify also the "One partner per page" version -->
1599+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table1">
1600 <tr>
1601 <td>
1602 <para style="terp_tblheader_General_Centre">Chart of Account</para>
1603@@ -319,26 +323,26 @@
1604 <para style="terp_tblheader_General_Centre">Fiscal Year</para>
1605 </td>
1606 <td>
1607- <para style="terp_tblheader_General_Centre">Journal</para>
1608- </td>
1609- <td>
1610- <para style="terp_tblheader_General_Centre">Partner's</para>
1611+ <para style="terp_tblheader_General_Centre">Journals</para>
1612 </td>
1613 <td>
1614 <para style="terp_tblheader_General_Centre">Accounts</para>
1615 </td>
1616 <td>
1617- <para style="terp_tblheader_General_Centre">Filters By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para>
1618- </td>
1619- <td>
1620- <para style="terp_tblheader_General_Centre">Target Moves</para>
1621- </td>
1622- <td>
1623 <para style="terp_tblheader_General_Centre">Proprietary Instances</para>
1624 </td>
1625+ <td>
1626+ <para style="terp_tblheader_General_Centre">Filter By [[ get_filter(data)!=translate('No Filter') and get_filter(data) ]]</para>
1627+ </td>
1628+ <td>
1629+ <para style="terp_tblheader_General_Centre">Display</para>
1630+ </td>
1631+ <td>
1632+ <para style="terp_tblheader_General_Centre">Func. Currency</para>
1633+ </td>
1634 </tr>
1635 </blockTable>
1636- <blockTable colWidths="65.0,65.0,125.0,85.0,85.0,167.0,85.0,85.0" style="Table4">
1637+ <blockTable colWidths="65.0,40.0,125.0,85.0,85.0,167.0,165.0,45.0" style="Table4">
1638 <tr>
1639 <td>
1640 <para style="terp_default_Centre_8">[[ get_account(data) or '' ]]</para>
1641@@ -350,12 +354,12 @@
1642 <para style="terp_default_Centre_8">[[ get_journals_str(data) ]]</para>
1643 </td>
1644 <td>
1645- <para style="terp_default_Centre_8">[[ get_partners() ]]</para>
1646- </td>
1647- <td>
1648 <para style="terp_default_Centre_8">[[ get_accounts_str(data) ]]</para>
1649 </td>
1650 <td>
1651+ <para style="terp_default_Centre_8">[[ get_instances_str(data) ]]</para>
1652+ </td>
1653+ <td>
1654 <para style="terp_default_Centre_8">[[ get_filter(data)==translate('No Filter') and get_filter(data) or removeParentNode('para') ]]</para>
1655 <blockTable colWidths="79.0,79.0" style="Table7">
1656 <tr>
1657@@ -402,10 +406,15 @@
1658 </para>
1659 </td>
1660 <td>
1661- <para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>
1662+ <para style="terp_default_Centre_8">[[ "%s: %s, %s: %s, %s: %s, %s: %s" % (
1663+ translate("Partner's"), get_partners(),
1664+ translate('Target Moves'), get_target_move(data),
1665+ translate('Reconciled'), get_reconcile_selection(),
1666+ translate('Display Partners'), get_display_partners_selection(),
1667+ ) ]]</para>
1668 </td>
1669 <td>
1670- <para style="terp_default_Centre_8">[[ get_instances_str(data) ]]</para>
1671+ <para style="terp_default_Centre_8">[[ company.currency_id.name ]]</para>
1672 </td>
1673 </tr>
1674 </blockTable>
1675@@ -415,7 +424,7 @@
1676 <para style="terp_default_8">
1677 <font color="white"> </font>
1678 </para>
1679- <blockTable colWidths="72.0,25.0,101.0,46.0,114.0,61.0,77.0,77.0,87.0,99.0" style="Table2">
1680+ <blockTable colWidths="72.0,25.0,101.0,46.0,104.0,60.0,51.0,67.0,67.0,77.0,89.0" style="Table2">
1681 <tr>
1682 <td>
1683 <para style="terp_tblheader_Details">Date</para>
1684@@ -430,16 +439,19 @@
1685 <para style="terp_tblheader_Details_Centre">Account</para>
1686 </td>
1687 <td>
1688- <para style="terp_tblheader_Details">Entry Label</para>
1689+ <para style="terp_tblheader_Details_Centre">Entry Label</para>
1690+ </td>
1691+ <td>
1692+ <para style="terp_tblheader_Details">Reconcile Number</para>
1693 </td>
1694 <td>
1695 <para style="terp_tblheader_Details">Currency</para>
1696 </td>
1697 <td>
1698- <para style="terp_tblheader_Details_Right">Debit</para>
1699+ <para style="terp_tblheader_Details_Centre">Debit</para>
1700 </td>
1701 <td>
1702- <para style="terp_tblheader_Details_Right">Credit</para>
1703+ <para style="terp_tblheader_Details_Centre">Credit</para>
1704 </td>
1705 <td>
1706 <para style="terp_tblheader_Details_Right">Booking Balance</para>
1707@@ -450,7 +462,7 @@
1708 </tr>
1709 </blockTable>
1710 <section>
1711- <para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
1712+ <para style="terp_default_8">[[ repeatIn(partners_to_display(objects), 'p') ]]</para>
1713 <blockTable colWidths="59.0,44.0,89.0,89.0,89.0,40.0,80.0,80.0,90.0,102.0" style="Table8">
1714 <tr>
1715 <td>
1716@@ -505,10 +517,10 @@
1717 </td>
1718 </tr>
1719 </blockTable>
1720- <blockTable colWidths="370.0,40.0,80.0,80.0,90.0,102.0" style="Table12">
1721+ <blockTable colWidths="420.0,30.0,70.0,70.0,80.0,92.0" style="Table12">
1722 <tr>
1723 <td>
1724- <para style="terp_default_Bold_9">[[ p.name ]][[ p.ref and ' - %s' % p.ref]]</para>
1725+ <para style="terp_default_Bold_9">[[ p.name ]]</para>
1726 </td>
1727 <td>
1728 <para style="terp_default_Bold_9">[[ company.currency_id.name ]]</para>
1729@@ -527,45 +539,116 @@
1730 </td>
1731 </tr>
1732 </blockTable>
1733+
1734 <section>
1735- <para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
1736- <blockTable colWidths="87.0,25.0,93.0,41.0,124.0,40.0,80.0,80.0,90.0,102.0" style="Table14">
1737- <tr>
1738- <td>
1739- <para style="P3">[[ formatLang(line['date'],date=True) ]]</para>
1740- </td>
1741- <td>
1742- <para style="P4">[[ line['code'] ]]</para>
1743- </td>
1744- <td>
1745- <para style="P8">[[ line['move_name'] ]]</para>
1746- </td>
1747- <td>
1748- <para style="P7">[[ line['a_code'] ]]</para>
1749- </td>
1750- <td>
1751- <para style="P3">[[ format_entry_label('%s - %s' % (line['ref'] or '', line['name'] or ''), 29) ]]</para>
1752- </td>
1753- <td>
1754- <para style="P3">[[ line['currency_code'] or '' ]]</para>
1755- </td>
1756- <td>
1757- <para style="P9">[[ formatLang(line['debit'] or 0.0) ]]</para>
1758- </td>
1759- <td>
1760- <para style="P9">[[ formatLang(line['credit'] or 0.0) ]]</para>
1761- </td>
1762- <td>
1763- <para style="P1">[[ (line['currency_id'] == None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] or 0.0) ]]</para>
1764- </td>
1765- <td>
1766- <para style="P9">[[ formatLang(line['total_functional'] or 0.0) ]]</para>
1767- </td>
1768- </tr>
1769- </blockTable>
1770- <para style="terp_default_2">
1771- <font color="white"> </font>
1772- </para>
1773+ <para style="terp_default_8">[[ repeatIn(get_accounts_to_display(p), 'account_code') ]]</para>
1774+ <!-- TOTALS IN FUNCTIONAL -->
1775+ <section>
1776+ <blockTable colWidths="296.0,124.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1777+ <tr>
1778+ <td>
1779+ <para style="PCenteredBold">[[ p.name or '' ]]</para>
1780+ </td>
1781+ <td>
1782+ <para style="PRightBold">[[ account_code ]]</para>
1783+ </td>
1784+ <td>
1785+ <para style="terp_default_Bold_8">[[ company.currency_id.name ]]</para>
1786+ </td>
1787+ <td>
1788+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['debit_functional'] or 0.0) ]]</para>
1789+ </td>
1790+ <td>
1791+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['credit_functional'] or 0.0) ]]</para>
1792+ </td>
1793+ <td>
1794+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['total_functional'] or 0.0) ]]</para>
1795+ </td>
1796+ <td>
1797+ <para style="PRightBold">[[ formatLang(get_fctal_totals(p, account_code)['total_functional'] or 0.0) ]]</para>
1798+ </td>
1799+ </tr>
1800+ </blockTable>
1801+ <para style="terp_default_2">
1802+ <font color="white"> </font>
1803+ </para>
1804+ </section>
1805+ <!-- SUBTOTAL LINES IN BOOKING -->
1806+ <section>
1807+ <para style="terp_default_8">[[ repeatIn(get_subtotals(p, account_code), 'curr') ]]</para>
1808+ <blockTable colWidths="296.0,124.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1809+ <tr>
1810+ <td>
1811+ <para style="PCenteredBold">[[ p.name or '' ]]</para>
1812+ </td>
1813+ <td>
1814+ <para style="PRightBold">Subtotal</para>
1815+ </td>
1816+ <td>
1817+ <para style="terp_default_Bold_8">[[ curr or '' ]]</para>
1818+ </td>
1819+ <td>
1820+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['debit'] or 0.0) ]]</para>
1821+ </td>
1822+ <td>
1823+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['credit'] or 0.0) ]]</para>
1824+ </td>
1825+ <td>
1826+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['amount_currency'] or 0.0) ]]</para>
1827+ </td>
1828+ <td>
1829+ <para style="PRightBold">[[ formatLang(get_subtotals(p, account_code)[curr]['total_functional'] or 0.0) ]]</para>
1830+ </td>
1831+ </tr>
1832+ </blockTable>
1833+ <para style="terp_default_2">
1834+ <font color="white"> </font>
1835+ </para>
1836+ </section>
1837+ <!-- LINES -->
1838+ <section>
1839+ <para style="terp_default_8">[[ repeatIn(lines(p, account_code), 'line') ]]</para>
1840+ <blockTable colWidths="77.0,25.0,88.0,41.0,139.0,50.0,30.0,70.0,70.0,80.0,92.0" style="Table14">
1841+ <tr>
1842+ <td>
1843+ <para style="P3">[[ formatLang(line['date'], date=True) ]]</para>
1844+ </td>
1845+ <td>
1846+ <para style="P7">[[ line['code'] ]]</para>
1847+ </td>
1848+ <td>
1849+ <para style="P8">[[ line['move_name'] ]]</para>
1850+ </td>
1851+ <td>
1852+ <para style="P7">[[ line['a_code'] ]]</para>
1853+ </td>
1854+ <td>
1855+ <para style="P3">[[ format_entry_label('%s - %s' % (line['ref'] or '', line['name'] or ''), 29) ]]</para>
1856+ </td>
1857+ <td>
1858+ <para style="P3">[[ line['reconcile_txt'] or '' ]]</para>
1859+ </td>
1860+ <td>
1861+ <para style="P3">[[ line['currency_code'] or '' ]]</para>
1862+ </td>
1863+ <td>
1864+ <para style="P7">[[ formatLang(line['debit'] or 0.0) ]]</para>
1865+ </td>
1866+ <td>
1867+ <para style="P7">[[ formatLang(line['credit'] or 0.0) ]]</para>
1868+ </td>
1869+ <td>
1870+ <para style="P7">[[ (line['currency_id'] == None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] or 0.0) ]]</para>
1871+ </td>
1872+ <td>
1873+ <para style="P7">[[ formatLang(line['total_functional'] or 0.0) ]]</para>
1874+ </td>
1875+ </tr>
1876+ </blockTable>
1877+ <para style="terp_default_2">
1878+ <font color="white"> </font>
1879+ </para>
1880+ </section>
1881 </section>
1882 <para style="terp_default_2">
1883 <font color="white"> </font>
1884
1885=== modified file 'bin/addons/account/wizard/account_report_partner_ledger.py'
1886--- bin/addons/account/wizard/account_report_partner_ledger.py 2017-05-24 14:58:15 +0000
1887+++ bin/addons/account/wizard/account_report_partner_ledger.py 2018-08-17 15:39:40 +0000
1888@@ -30,7 +30,11 @@
1889 _description = 'Account Partner Ledger'
1890
1891 _columns = {
1892- 'reconcil': fields.boolean('Include Reconciled Entries', help='Consider reconciled entries'),
1893+ 'reconciled': fields.selection([
1894+ ('empty', ''),
1895+ ('yes', 'Yes'),
1896+ ('no', 'No'),
1897+ ], string='Reconciled'),
1898 'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page (PDF version only)'),
1899 'partner_ids': fields.many2many('res.partner', 'account_partner_ledger_partner_rel', 'wizard_id', 'partner_id',
1900 string='Partners', help='Display the report for specific partners only'),
1901@@ -40,24 +44,30 @@
1902 'account_ids': fields.many2many('account.account', 'account_partner_ledger_account_rel', 'wizard_id', 'account_id',
1903 string='Accounts', help='Display the report for specific accounts only'),
1904 'tax': fields.boolean('Exclude tax', help="Exclude tax accounts from process"),
1905+ 'display_partner': fields.selection([('all', 'All Partners'),
1906+ ('with_movements', 'With movements'),
1907+ ('non-zero_balance', 'With balance is not equal to 0')],
1908+ string='Display Partners', required=True),
1909 }
1910
1911 _defaults = {
1912- 'reconcil': False,
1913+ 'reconciled': 'empty',
1914 'page_split': False,
1915 'result_selection': 'customer_supplier',
1916 'account_domain': "[('type', 'in', ['payable', 'receivable'])]",
1917 'only_active_partners': False,
1918 'tax': False, # UFTP-312: Add an exclude tax account possibility
1919 'fiscalyear_id': False,
1920+ 'display_partner': 'with_movements',
1921 }
1922
1923 def _print_report(self, cr, uid, ids, data, context=None):
1924 if context is None:
1925 context = {}
1926 data = self.pre_print_report(cr, uid, ids, data, context=context)
1927- data['form'].update(self.read(cr, uid, ids, ['reconcil', 'page_split', 'tax', 'partner_ids',
1928- 'only_active_partners', 'instance_ids', 'account_ids'])[0])
1929+ data['form'].update(self.read(cr, uid, ids, ['reconciled', 'page_split', 'tax', 'partner_ids',
1930+ 'only_active_partners', 'instance_ids', 'account_ids',
1931+ 'display_partner'])[0])
1932 self._check_dates_fy_consistency(cr, uid, data, context)
1933 if data['form']['page_split']:
1934 return {
1935@@ -84,8 +94,9 @@
1936 data['form']['used_context'] = used_context
1937
1938 data = self.pre_print_report(cr, uid, ids, data, context=context)
1939- data['form'].update(self.read(cr, uid, ids, ['reconcil', 'page_split', 'tax', 'partner_ids',
1940- 'only_active_partners', 'instance_ids', 'account_ids'])[0])
1941+ data['form'].update(self.read(cr, uid, ids, ['reconciled', 'page_split', 'tax', 'partner_ids',
1942+ 'only_active_partners', 'instance_ids', 'account_ids',
1943+ 'display_partner'])[0])
1944 self._check_dates_fy_consistency(cr, uid, data, context)
1945 return {
1946 'type': 'ir.actions.report.xml',
1947
1948=== modified file 'bin/addons/account/wizard/account_report_partner_ledger_view.xml'
1949--- bin/addons/account/wizard/account_report_partner_ledger_view.xml 2017-06-01 12:59:52 +0000
1950+++ bin/addons/account/wizard/account_report_partner_ledger_view.xml 2018-08-17 15:39:40 +0000
1951@@ -15,10 +15,12 @@
1952 </xpath>
1953 <xpath expr="//field[@name='target_move']" position="after">
1954 <field name="result_selection" on_change="onchange_result_selection_or_tax(result_selection, tax)"/>
1955- <field name="reconcil"/>
1956+ <field name="display_partner"/>
1957 <field name="page_split"/>
1958+ <field name="reconciled"/>
1959+ <field name="only_active_partners"/>
1960 <field name="tax" on_change="onchange_result_selection_or_tax(result_selection, tax)"/>
1961- <field name="only_active_partners"/>
1962+ <newline/>
1963 <field name="instance_ids" domain="[('instance_to_display_ids','=',True)]">
1964 <tree noteditable="1">
1965 <field name="code"/>
1966
1967=== modified file 'bin/addons/finance/report/account_partner_balance_tree.py'
1968--- bin/addons/finance/report/account_partner_balance_tree.py 2017-06-01 12:13:18 +0000
1969+++ bin/addons/finance/report/account_partner_balance_tree.py 2018-08-17 15:39:40 +0000
1970@@ -30,7 +30,6 @@
1971 super(account_partner_balance_tree, self).__init__(cr, uid, name, context=context)
1972 self.apbt_obj = self.pool.get('account.partner.balance.tree')
1973 self.uid = uid
1974- self.initial_balance = False
1975 self.has_data = True
1976 self.localcontext.update({
1977 # header
1978@@ -47,44 +46,23 @@
1979 'get_prop_instances_str': self._get_prop_instances_str,
1980 'get_type_of_accounts': self._get_type_of_accounts,
1981 'get_accounts_str': self._get_accounts_str,
1982- 'get_display_ib': self._get_display_ib,
1983+ 'get_reconcile_selection': self._get_reconcile_selection,
1984+ 'get_display_partners_selection': self._get_display_partners_selection,
1985
1986 # data
1987 'get_partners': self._get_partners,
1988 'get_partner_account_move_lines': self._get_partner_account_move_lines,
1989 'get_lines_per_currency': self._get_lines_per_currency,
1990- 'get_partners_total_debit_credit_balance_by_account_type': self._get_partners_total_debit_credit_balance_by_account_type,
1991- 'get_nb_account_types': self._get_nb_account_types,
1992+ 'get_partners_total_debit_credit_balance': self._get_partners_total_debit_credit_balance,
1993 'get_has_data': self._get_has_data,
1994 })
1995
1996 def set_context(self, objects, data, ids, report_type=None):
1997- self.initial_balance = data['form'].get('initial_balance', False)
1998 self.display_partner = data['form'].get('display_partner', 'non-zero_balance')
1999 self.result_selection = data['form'].get('result_selection')
2000 self.target_move = data['form'].get('target_move', 'all')
2001-
2002- if (self.result_selection == 'customer' ):
2003- self.ACCOUNT_TYPE = ('receivable',)
2004- elif (self.result_selection == 'supplier'):
2005- self.ACCOUNT_TYPE = ('payable',)
2006- else:
2007- self.ACCOUNT_TYPE = ('payable', 'receivable')
2008-
2009 return super(account_partner_balance_tree, self).set_context(objects, data, ids, report_type=report_type)
2010
2011- def _get_display_ib(self):
2012- """
2013- Returns True if the IB data must be displayed
2014- """
2015- return self.initial_balance
2016-
2017- def _get_nb_account_types(self):
2018- """
2019- Returns the number of different account types to display
2020- """
2021- return self.ACCOUNT_TYPE and len(self.ACCOUNT_TYPE) or 0
2022-
2023 def _get_type_of_accounts(self):
2024 if self.result_selection == 'customer':
2025 return _('Receivable Accounts')
2026@@ -103,23 +81,48 @@
2027 def _get_partners(self, data):
2028 """ return a list of 1 or 2 elements each element containing browse objects
2029 only [payable] or only [receivable] or [payable, receivable]
2030+ From US-3873: payable and receivable accounts are grouped together
2031 """
2032 res = []
2033- for at in self.ACCOUNT_TYPE:
2034- objects = self.apbt_obj.get_partner_data(self.cr, self.uid, [at], data)
2035- if objects:
2036- res.append(objects)
2037+ objects = self.apbt_obj.get_partner_data(self.cr, self.uid, data)
2038+ if objects:
2039+ res.append(objects)
2040 self.has_data = len(res)
2041 return res
2042
2043- def _get_partner_account_move_lines(self, account_type, partner_id, data):
2044- return self.apbt_obj.get_partner_account_move_lines_data(self.cr, self.uid, account_type, partner_id, data)
2045-
2046- def _get_lines_per_currency(self, account_type, partner_id, data, account_code):
2047- return self.apbt_obj.get_lines_per_currency(self.cr, self.uid, account_type, partner_id, data, account_code)
2048-
2049- def _get_partners_total_debit_credit_balance_by_account_type(self, account_type, data):
2050- return self.apbt_obj.get_partners_total_debit_credit_balance_by_account_type(self.cr, self.uid, account_type, data)
2051+ def _get_reconcile_selection(self, data):
2052+ """
2053+ Returns "Yes" if "Reconciled: Yes" is selected in the wizard
2054+ """
2055+ selection = _('All')
2056+ if data['form'].get('reconciled', '') == 'yes':
2057+ selection = _('Yes')
2058+ elif data['form'].get('reconciled', '') == 'no':
2059+ selection = _('No')
2060+ return selection
2061+
2062+ def _get_display_partners_selection(self, data):
2063+ """
2064+ Returns the String to display in the "Display Partners" section of the report header
2065+ """
2066+ selection = ''
2067+ display_partner = data['form'].get('display_partner', '')
2068+ if display_partner == 'all':
2069+ selection = _('All Partners')
2070+ elif display_partner == 'with_movements':
2071+ selection = _('With movements')
2072+ elif display_partner == 'non-zero_balance':
2073+ selection = _('With balance is not equal to 0')
2074+ return selection
2075+
2076+ def _get_partner_account_move_lines(self, partner_id, data):
2077+ return self.apbt_obj.get_partner_account_move_lines_data(self.cr, self.uid, partner_id, data)
2078+
2079+ def _get_lines_per_currency(self, partner_id, data, account_code):
2080+ return self.apbt_obj.get_lines_per_currency(self.cr, self.uid, partner_id, data, account_code)
2081+
2082+ def _get_partners_total_debit_credit_balance(self, data):
2083+ return self.apbt_obj.get_partners_total_debit_credit_balance(self.cr, self.uid, data)
2084
2085 def _get_filter_info(self, data):
2086 """ get filter info
2087
2088=== modified file 'bin/addons/finance/report/account_partner_balance_tree_xls.mako'
2089--- bin/addons/finance/report/account_partner_balance_tree_xls.mako 2017-06-01 09:47:21 +0000
2090+++ bin/addons/finance/report/account_partner_balance_tree_xls.mako 2018-08-17 15:39:40 +0000
2091@@ -171,16 +171,6 @@
2092 <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
2093 </Borders>
2094 </Style>
2095-<Style ss:ID="ssIBLine">
2096-<Alignment ss:Vertical="Top" ss:Horizontal="Right" ss:WrapText="1"/>
2097-<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11"/>
2098-<Borders>
2099- <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
2100- <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
2101- <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
2102- <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
2103-</Borders>
2104-</Style>
2105 <Style ss:ID="ssAccountLineWrap">
2106 <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1"/>
2107 <Borders>
2108@@ -225,17 +215,6 @@
2109 </Borders>
2110 <NumberFormat ss:Format="#,##0.00"/>
2111 </Style>
2112-<Style ss:ID="ssIBLineNumber">
2113-<Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
2114-<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11"/>
2115-<Borders>
2116- <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" />
2117- <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" />
2118- <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" />
2119- <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" />
2120-</Borders>
2121-<NumberFormat ss:Format="#,##0.00"/>
2122-</Style>
2123 <Style ss:ID="ssAccountLineAccountCode">
2124 <Alignment ss:Horizontal="Right" ss:Vertical="Top" ss:WrapText="1"/>
2125 <Font ss:Size="8"/>
2126@@ -278,72 +257,71 @@
2127 % else:
2128 % for p_entries in entries:
2129 <%
2130-if p_entries[0].account_type == 'payable':
2131- worsheet_name = _('Payable Accounts')
2132-else:
2133- worsheet_name = _('Receivable Accounts')
2134+worksheet_name = get_type_of_accounts()
2135 %>
2136-<Worksheet ss:Name="${worsheet_name}">
2137+<Worksheet ss:Name="${worksheet_name}">
2138 <%
2139 col_count = 9
2140 if data['model'] == 'account.account':
2141 header_company_or_chart_of_account = _('Company')
2142 else:
2143 header_company_or_chart_of_account = _('Chart of Account')
2144- if data['form'].get('display_partner', '') == 'non-zero_balance':
2145- display_account = _('With balance is not equal to 0')
2146- else:
2147- display_account = _('All')
2148 %>
2149 <Table x:FullColumns="1" x:FullRows="1">
2150-<Column ss:AutoFitWidth="1" ss:Width="140" />
2151-<Column ss:AutoFitWidth="1" ss:Width="80" />
2152+<Column ss:AutoFitWidth="1" ss:Width="150" />
2153 <Column ss:AutoFitWidth="1" ss:Width="60" />
2154-<Column ss:AutoFitWidth="1" ss:Width="70" />
2155-<Column ss:AutoFitWidth="1" ss:Width="80" />
2156-<Column ss:AutoFitWidth="1" ss:Width="80" />
2157-<Column ss:AutoFitWidth="1" ss:Width="80" />
2158-<Column ss:AutoFitWidth="1" ss:Width="80" />
2159-<Column ss:AutoFitWidth="1" ss:Width="80" />
2160+<Column ss:AutoFitWidth="1" ss:Width="120" />
2161+<Column ss:AutoFitWidth="1" ss:Width="120" />
2162+<Column ss:AutoFitWidth="1" ss:Width="120" />
2163+<Column ss:AutoFitWidth="1" ss:Width="100" />
2164+<Column ss:AutoFitWidth="1" ss:Width="100" />
2165+<Column ss:AutoFitWidth="1" ss:Width="100" />
2166+<Column ss:AutoFitWidth="1" ss:Width="100" />
2167 ## header
2168 <%
2169 header_col_merge_count = col_count - 1
2170+selected_filter = get_filter(data) or ''
2171 %>
2172 <Row>
2173- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${header_company_or_chart_of_account}&#10;${_('Fiscal Year')}</Data></Cell>
2174- <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Journals')}</Data></Cell>
2175- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Display Partners')}</Data></Cell>
2176- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${'%s %s' % (_('Filter By'), (get_filter(data) or ''))|x}</Data></Cell>
2177- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Target Moves')}</Data></Cell>
2178- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Functional Currency')}</Data></Cell>
2179+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${header_company_or_chart_of_account}</Data></Cell>
2180+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Fiscal Year')}</Data></Cell>
2181+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Journals')}</Data></Cell>
2182+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Accounts')}</Data></Cell>
2183 <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Proprietary Instances')}</Data></Cell>
2184- <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Accounts')}</Data></Cell>
2185+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${'%s %s' % (_('Filter By'), (selected_filter != _('No Filter') and selected_filter or ''))|x}</Data></Cell>
2186+ <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"><Data ss:Type="String">${_('Display')}</Data></Cell>
2187+ <Cell ss:StyleID="ssHeader"><Data ss:Type="String">${_('Func. Currency')}</Data></Cell>
2188 </Row>
2189 <Row>
2190 <Cell ss:StyleID="ssHeaderCell">
2191- <Data ss:Type="String">${(get_account(data) or '')|x}&#10;&#10;${(get_fiscalyear(data) or '')|x}</Data>
2192- </Cell>
2193- <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
2194+ <Data ss:Type="String">${(get_account(data) or '')|x}</Data>
2195+ </Cell>
2196+ <Cell ss:StyleID="ssHeaderCell">
2197+ <Data ss:Type="String">${(get_fiscalyear(data) or '')|x}</Data>
2198+ </Cell>
2199+ <Cell ss:StyleID="ssHeaderCell">
2200 <Data ss:Type="String">${ get_journals_str(data)|x}</Data>
2201 </Cell>
2202 <Cell ss:StyleID="ssHeaderCell">
2203- <Data ss:Type="String">${(display_account or '')|x}</Data>
2204+ <Data ss:Type="String">${ get_accounts_str(data)|x}</Data>
2205+ </Cell>
2206+ <Cell ss:StyleID="ssHeaderCell">
2207+ <Data ss:Type="String">${ get_prop_instances_str(data)|x}</Data>
2208 </Cell>
2209 <Cell ss:StyleID="ssHeaderCell">
2210 <Data ss:Type="String">${(get_filter_info(data) or '')|x}</Data>
2211 </Cell>
2212- <Cell ss:StyleID="ssHeaderCell">
2213- <Data ss:Type="String">${(get_target_move(data) or '')|x}</Data>
2214+ <Cell ss:StyleID="ssHeaderCell" ss:MergeAcross="1">
2215+ <Data ss:Type="String">${ "%s: %s, %s: %s, %s: %s, %s: %s" % (
2216+ _("Partner's"), get_type_of_accounts() or '',
2217+ _('Target Moves'), get_target_move(data) or '',
2218+ _('Reconciled'), get_reconcile_selection(data),
2219+ _('Display Partners'), get_display_partners_selection(data),
2220+ )|x}</Data>
2221 </Cell>
2222 <Cell ss:StyleID="ssHeaderCell">
2223 <Data ss:Type="String">${company.currency_id.name|x}</Data>
2224 </Cell>
2225- <Cell ss:StyleID="ssHeaderCell">
2226- <Data ss:Type="String">${ get_prop_instances_str(data)|x}</Data>
2227- </Cell>
2228- <Cell ss:StyleID="ssHeaderCell">
2229- <Data ss:Type="String">${ get_accounts_str(data)|x}</Data>
2230- </Cell>
2231 </Row>
2232 ## separation line after header
2233 <Row>
2234@@ -355,12 +333,9 @@
2235 </Row>
2236 ## partner header
2237 <Row>
2238-<Cell ss:StyleID="ssHeader">
2239+<Cell ss:StyleID="ssHeader" ss:MergeAcross="2">
2240 <Data ss:Type="String">${_('Partner')}</Data>
2241 </Cell>
2242-<Cell ss:StyleID="ssHeader" ss:MergeAcross="1">
2243- <Data ss:Type="String">${_('Partner Ref.')}</Data>
2244-</Cell>
2245 <Cell ss:StyleID="ssHeaderRight">
2246 <Data ss:Type="String">${_('Account')}</Data>
2247 </Cell>
2248@@ -384,7 +359,7 @@
2249 <Row>
2250 ## total debit / credit / balance row
2251 <%
2252-debit, credit, balance = get_partners_total_debit_credit_balance_by_account_type(p_entries[0].account_type, data)
2253+debit, credit, balance = get_partners_total_debit_credit_balance(data)
2254 %>
2255 <Cell ss:StyleID="ssCellRightBold" ss:MergeAcross="3">
2256 <Data ss:Type="String">${_('TOTAL PARTNERS')}</Data>
2257@@ -410,15 +385,11 @@
2258 % for p_obj in p_entries:
2259 <%
2260 partner_name = (p_obj.name or '')
2261-partner_ref = (p_obj.partner_id and p_obj.partner_id.ref or '')
2262 %>
2263 <Row>
2264-<Cell ss:StyleID="ssPartner">
2265+<Cell ss:StyleID="ssPartner" ss:MergeAcross="3">
2266 <Data ss:Type="String">${partner_name|x}</Data>
2267 </Cell>
2268-<Cell ss:StyleID="ssPartner" ss:MergeAcross="2">
2269- <Data ss:Type="String">${partner_ref|x}</Data>
2270-</Cell>
2271 <Cell ss:StyleID="ssPartnerRight">
2272 <Data ss:Type="String">${company.currency_id.name|x}</Data>
2273 </Cell>
2274@@ -436,35 +407,8 @@
2275 </Cell>
2276 </Row>
2277
2278-<!-- INITIAL BALANCE Section -->
2279-% if get_display_ib():
2280-<Row>
2281-<Cell ss:StyleID="ssIBLine" ss:MergeAcross="2">
2282- <Data ss:Type="String"></Data>
2283-</Cell>
2284-<Cell ss:StyleID="ssIBLine">
2285- <Data ss:Type="String">${_('Initial Balance')}</Data>
2286-</Cell>
2287-<Cell ss:StyleID="ssIBLine">
2288- <Data ss:Type="String">${company.currency_id.name|x}</Data>
2289-</Cell>
2290-<Cell ss:StyleID="ssIBLineNumber">
2291- <Data ss:Type="Number">${p_obj.ib_debit or 0.|x}</Data>
2292-</Cell>
2293-<Cell ss:StyleID="ssIBLineNumber">
2294- <Data ss:Type="Number">${p_obj.ib_credit or 0.|x}</Data>
2295-</Cell>
2296-<Cell ss:StyleID="ssIBLineNumber">
2297- <Data ss:Type="Number">${p_obj.ib_balance or 0.|x}</Data>
2298-</Cell>
2299-<Cell ss:StyleID="ssIBLineNumber">
2300- <Data ss:Type="Number">${p_obj.ib_balance or 0.|x}</Data>
2301-</Cell>
2302-</Row>
2303-% endif
2304-
2305 ## account move line row
2306-% for aml in get_partner_account_move_lines(p_entries[0].account_type, p_obj.partner_id.id, data):
2307+% for aml in get_partner_account_move_lines(p_obj.partner_id.id, data):
2308 <Row>
2309 <Cell ss:StyleID="ssAccountLine">
2310 <Data ss:Type="String"></Data>
2311@@ -496,7 +440,7 @@
2312 </Row>
2313
2314 <!-- SUBTOTALS per currency -->
2315-% for detail_line in get_lines_per_currency(p_entries[0].account_type, p_obj.partner_id.id, data, aml.get('account', '')):
2316+% for detail_line in get_lines_per_currency(p_obj.partner_id.id, data, aml.get('account', '')):
2317 <Row>
2318 <Cell ss:StyleID="ssSubtotalLine" ss:MergeAcross="2">
2319 <Data ss:Type="String"></Data>
2320
2321=== modified file 'bin/addons/finance/wizard/account_report_partner_balance_tree.py'
2322--- bin/addons/finance/wizard/account_report_partner_balance_tree.py 2018-04-03 10:18:51 +0000
2323+++ bin/addons/finance/wizard/account_report_partner_balance_tree.py 2018-08-17 15:39:40 +0000
2324@@ -35,112 +35,28 @@
2325 ('payable', 'Payable'),
2326 ('receivable', 'Receivable')
2327 ],
2328- 'Account type'),
2329+ 'Account type'), # not used since US-3873
2330 'partner_id': fields.many2one('res.partner', 'Partner', invisible=True),
2331 'name': fields.char('Partner', size=168), # partner name
2332 'partner_ref': fields.char('Partner Ref', size=64 ),
2333 'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')),
2334 'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')),
2335 'balance': fields.float('Balance', digits_compute=dp.get_precision('Account')),
2336- 'ib_debit': fields.float('Initial Balance Debit', digits_compute=dp.get_precision('Account')),
2337- 'ib_credit': fields.float('Initial Balance Credit', digits_compute=dp.get_precision('Account')),
2338- 'ib_balance': fields.float('IB Balance', digits_compute=dp.get_precision('Account')),
2339+ 'ib_debit': fields.float('Initial Balance Debit', digits_compute=dp.get_precision('Account')), # not used since US-3873
2340+ 'ib_credit': fields.float('Initial Balance Credit', digits_compute=dp.get_precision('Account')), # not used since US-3873
2341+ 'ib_balance': fields.float('IB Balance', digits_compute=dp.get_precision('Account')), # not used since US-3873
2342 }
2343
2344- _order = "account_type, partner_id"
2345+ _order = "name, partner_id"
2346
2347 def __init__(self, pool, cr):
2348 super(account_partner_balance_tree, self).__init__(pool, cr)
2349 self.total_debit_credit_balance = {}
2350 self.move_line_ids = {}
2351
2352- def _get_initial_balance(self, cr):
2353- """
2354- Returns the initial balances by partner and account TYPE
2355- """
2356- ACCOUNT_TYPE_REQUEST = self.account_type and "AND ac.type IN %s" % self.account_type or ""
2357- cr.execute(
2358- "SELECT p.id as partner_id, ac.type as account_type, p.ref as partner_ref, ac.name AS account_name, "
2359- "ac.code AS code, p.name as partner_name, COALESCE(SUM(l.debit), 0.0) as ib_debit, "
2360- "COALESCE(SUM(l.credit), 0.0) as ib_credit, "
2361- "COALESCE(sum(debit-credit), 0.0) as ib_balance "
2362- "FROM account_move_line AS l INNER JOIN account_move am ON am.id = l.move_id "
2363- "INNER JOIN res_partner p ON l.partner_id = p.id "
2364- "INNER JOIN account_account ac ON l.account_id = ac.id "
2365- "INNER JOIN account_account_type at ON ac.user_type = at.id "
2366- "WHERE am.state IN %s"
2367- " " + ACCOUNT_TYPE_REQUEST + " "
2368- " " + self.ACCOUNT_REQUEST + " "
2369- " " + self.RECONCILE_REQUEST + " "
2370- " " + self.INSTANCE_REQUEST + " "
2371- " " + self.PARTNER_REQUEST + " "
2372- " " + self.TAX_REQUEST + " "
2373- " " + self.IB_JOURNAL_REQUEST + " "
2374- " " + self.IB_DATE_TO + " "
2375- "GROUP BY ac.type, p.id, p.ref, p.name, ac.name, ac.code "
2376- "ORDER BY ac.type, p.name ",
2377- (tuple(self.ib_move_state_list),)) # not_a_user_entry
2378- return cr.dictfetchall()
2379-
2380- def _cmp_account_type_partner(self, a, b):
2381- """
2382- Comparison function to sort by account TYPE and then partner name
2383- """
2384- if a['account_type'] > b['account_type']:
2385- return 1
2386- elif a['account_type'] < b['account_type']:
2387- return -1
2388- else:
2389- if a['partner_name'] > b['partner_name']:
2390- return 1
2391- elif a['partner_name'] < b['partner_name']:
2392- return -1
2393- return 0
2394-
2395- def _add_initial_balances(self, cr, full_account):
2396- """
2397- Add the initial balances values to the report lines
2398- """
2399- if self.initial_balance:
2400- initial_balances = self._get_initial_balance(cr)
2401- for ib in initial_balances:
2402- found = False
2403- # update the result lines with the corresponding IB result
2404- for fa in full_account:
2405- if ib['partner_id'] == fa['partner_id'] and ib['account_type'] == fa['account_type']:
2406- # add up the values to the existing ones
2407- fa.update({'ib_debit': fa.get('ib_debit', 0.0) + ib['ib_debit'],
2408- 'ib_credit': fa.get('ib_credit', 0.0) + ib['ib_credit'],
2409- 'ib_balance': fa.get('ib_balance', 0.0) + ib['ib_balance'],
2410- })
2411- found = True
2412- break
2413- # use case: IB lines existing for an "account-partner" association where no "standard value" found:
2414- # put the standard values to zero
2415- if not found:
2416- ib.update({
2417- 'debit': 0,
2418- 'credit': 0,
2419- 'sdebit': 0,
2420- 'scredit': 0,
2421- })
2422- full_account.append(ib)
2423- # sort the elements of the list per account and partner
2424- full_account.sort(self._cmp_account_type_partner)
2425- # use case: "standard values" existing for an "account-partner" association where no IB value found
2426- # OR "IB" tickbox not ticked:
2427- # put the IB values to zero
2428- for fa in full_account:
2429- if 'ib_balance' not in fa.keys():
2430- fa.update({
2431- 'ib_debit': 0,
2432- 'ib_credit': 0,
2433- 'ib_balance': 0,
2434- })
2435-
2436 def _execute_query_partners(self, cr, uid, data):
2437 """
2438- return res, account_type, move_state
2439+ Returns a list of dicts, each containing data for one partner
2440 """
2441 obj_move = self.pool.get('account.move.line')
2442 obj_journal = self.pool.get('account.journal')
2443@@ -149,17 +65,16 @@
2444
2445 result_selection = data['form'].get('result_selection', '')
2446 if (result_selection == 'customer'):
2447- self.account_type = "('receivable')"
2448+ account_type = "('receivable')"
2449 elif (result_selection == 'supplier'):
2450- self.account_type = "('payable')"
2451+ account_type = "('payable')"
2452 else:
2453- self.account_type = "('payable', 'receivable')"
2454+ account_type = "('payable', 'receivable')"
2455
2456 move_state = "('draft','posted')"
2457 if data['form'].get('target_move', 'all') == 'posted':
2458 move_state = "('posted')"
2459
2460- self.initial_balance = data['form'].get('initial_balance', False)
2461 fiscalyear_id = data['form'].get('fiscalyear_id', False)
2462 if fiscalyear_id:
2463 fy = obj_fy.read(cr, uid, [fiscalyear_id], ['date_start'], context=used_context)
2464@@ -169,25 +84,15 @@
2465
2466 where = obj_move._query_get(cr, uid, obj='l', context=used_context) or ''
2467
2468- # if "Initial Balance" and FY are selected, store data for the IB calculation whatever the dates or periods selected
2469- self.IB_DATE_TO = ''
2470- self.IB_JOURNAL_REQUEST = ''
2471- if self.initial_balance and fiscalyear_id:
2472- self.IB_DATE_TO = "AND l.date < '%s'" % fy[0].get('date_start')
2473- # all journals by default
2474- journal_ids = data['form'].get('journal_ids',
2475- obj_journal.search(cr, uid, [], order='NO_ORDER',
2476- context=data.get('context', {})))
2477- if len(journal_ids) == 1:
2478- self.IB_JOURNAL_REQUEST = "AND l.journal_id = %s" % journal_ids[0]
2479- else:
2480- self.IB_JOURNAL_REQUEST = "AND l.journal_id IN %s" % (tuple(journal_ids),)
2481- # state filter
2482- self.ib_move_state_list = data['form'].get('target_move', 'all') == 'posted' and ['posted'] or ['draft', 'posted']
2483 # reconciliation filter
2484- self.RECONCILE_REQUEST = ''
2485- if not data['form'].get('include_reconciled_entries', False):
2486- self.RECONCILE_REQUEST = 'AND l.reconcile_id IS NULL' # include only non-reconciled entries
2487+ reconcile_filter = data['form'].get('reconciled', '')
2488+ if reconcile_filter == 'yes':
2489+ self.RECONCILE_REQUEST = "AND l.reconcile_id IS NOT NULL"
2490+ elif reconcile_filter == 'no':
2491+ self.RECONCILE_REQUEST = "AND l.reconcile_id IS NULL AND ac.reconcile='t'" # reconcilable entries not reconciled
2492+ else: # 'empty'
2493+ self.RECONCILE_REQUEST = ""
2494+
2495 # proprietary instances filter
2496 self.INSTANCE_REQUEST = ''
2497 instance_ids = data['form'].get('instance_ids', False)
2498@@ -213,11 +118,8 @@
2499 if data['form'].get('account_ids', False): # some accounts are specifically selected
2500 self.ACCOUNT_REQUEST = " AND ac.id IN (%s)" % (",".join(map(str, data['form']['account_ids'])))
2501
2502- # inspired from account_report_balance.py report query
2503- # but group only per 'account type'/'partner'
2504 where = where and 'AND %s' % where or ''
2505- query = """SELECT ac.type as account_type,
2506- p.id as partner_id, p.ref as partner_ref, p.name as partner_name,
2507+ query = """SELECT p.id as partner_id, p.ref as partner_ref, p.name as partner_name,
2508 COALESCE(sum(debit),0) AS debit, COALESCE(sum(credit), 0) AS credit,
2509 CASE WHEN sum(debit) > sum(credit) THEN sum(debit) - sum(credit) ELSE 0 END AS sdebit,
2510 CASE WHEN sum(debit) < sum(credit) THEN sum(credit) - sum(debit) ELSE 0 END AS scredit
2511@@ -228,29 +130,34 @@
2512 WHERE ac.type IN %s
2513 AND am.state IN %s
2514 %s %s %s %s %s %s
2515- GROUP BY ac.type,p.id,p.ref,p.name
2516- ORDER BY ac.type,p.name""" % (self.account_type, move_state, # not_a_user_entry
2517- where, self.INSTANCE_REQUEST, self.TAX_REQUEST,
2518- self.PARTNER_REQUEST, self.ACCOUNT_REQUEST,
2519- self.RECONCILE_REQUEST)
2520+ GROUP BY p.id, p.ref, p.name
2521+ ORDER BY p.name;""" % (account_type, move_state, # not_a_user_entry
2522+ where, self.INSTANCE_REQUEST, self.TAX_REQUEST,
2523+ self.PARTNER_REQUEST, self.ACCOUNT_REQUEST,
2524+ self.RECONCILE_REQUEST)
2525 cr.execute(query)
2526 res = cr.dictfetchall()
2527
2528 if data['form'].get('display_partner', '') == 'non-zero_balance':
2529 res2 = [r for r in res if r['sdebit'] > 0 or r['scredit'] > 0]
2530- else:
2531+ else: # with_movements or all
2532 res2 = [r for r in res]
2533- # add the initial balances if requested
2534- self._add_initial_balances(cr, res2)
2535- return res2, self.account_type, move_state
2536+ return res2
2537
2538- def _execute_query_selected_partner_move_line_ids(self, cr, uid, account_type, partner_id, data):
2539+ def _execute_query_selected_partner_move_line_ids(self, cr, uid, partner_id, data):
2540 # if this method is re-called with the same arguments don't recompute the result
2541- if not self.move_line_ids or account_type != self.move_line_ids['account_type'] \
2542- or partner_id != self.move_line_ids['partner_id'] or data != self.move_line_ids['data']:
2543+ if not self.move_line_ids or partner_id != self.move_line_ids['partner_id'] or data != self.move_line_ids['data']:
2544 obj_move = self.pool.get('account.move.line')
2545 where = obj_move._query_get(cr, uid, obj='l', context=data['form'].get('used_context', {})) or ''
2546
2547+ result_selection = data['form'].get('result_selection', '')
2548+ if result_selection == 'customer':
2549+ account_type = "('receivable')"
2550+ elif result_selection == 'supplier':
2551+ account_type = "('payable')"
2552+ else:
2553+ account_type = "('payable', 'receivable')"
2554+
2555 move_state = "('draft','posted')"
2556 if data['form'].get('target_move', 'all') == 'posted':
2557 move_state = "('posted')"
2558@@ -261,16 +168,21 @@
2559 " JOIN account_account_type at ON (ac.user_type = at.id) WHERE "
2560 if partner_id:
2561 query += "l.partner_id = " + str(partner_id) + "" \
2562- " AND ac.type = '" + account_type + "'" \
2563+ " AND ac.type IN " + account_type + "" \
2564 " AND am.state IN " + move_state + ""
2565 else:
2566- query += "ac.type = '" + account_type + "'" \
2567- " AND am.state IN " + move_state + ""
2568+ query += "ac.type IN " + account_type + "" \
2569+ " AND am.state IN " + move_state + ""
2570 # UFTP-312: Filtering regarding tax account (if user asked it)
2571 if data['form'].get('tax', False):
2572 query += " AND at.code != 'tax' "
2573- if not data['form'].get('include_reconciled_entries', False):
2574- query += ' AND l.reconcile_id IS NULL' # include only non-reconciled entries
2575+
2576+ reconcile_filter = data['form'].get('reconciled', '')
2577+ if reconcile_filter == 'yes':
2578+ query += " AND l.reconcile_id IS NOT NULL"
2579+ elif reconcile_filter == 'no':
2580+ query += " AND l.reconcile_id IS NULL AND ac.reconcile='t'" # reconcilable entries not reconciled
2581+
2582 if data['form'].get('instance_ids', False):
2583 query += " AND l.instance_id in(%s)" % (",".join(map(str, data['form']['instance_ids'])))
2584 if data['form'].get('account_ids', False): # some accounts are specifically selected
2585@@ -287,7 +199,6 @@
2586 self.move_line_ids['res'] = res2
2587 else:
2588 self.move_line_ids['res'] = False
2589- self.move_line_ids['account_type'] = account_type
2590 self.move_line_ids['partner_id'] = partner_id
2591 self.move_line_ids['data'] = data
2592 return self.move_line_ids['res']
2593@@ -331,25 +242,53 @@
2594
2595 res = self._execute_query_partners(cr, uid, data)
2596
2597- for r in res[0]:
2598- debit = r['debit'] + (self.initial_balance and r['ib_debit'] or 0.0)
2599- credit = r['credit'] + (self.initial_balance and r['ib_credit'] or 0.0)
2600+ p_seen = {} # store every partner handled
2601+ for r in res:
2602+ debit = r['debit']
2603+ credit = r['credit']
2604+ if r['partner_id'] not in p_seen:
2605+ p_seen[r['partner_id']] = {}
2606+ p_seen[r['partner_id']]['name'] = r['partner_name']
2607+ p_seen[r['partner_id']]['partner_ref'] = r['partner_ref']
2608 vals = {
2609 'uid': uid,
2610 'build_ts': data['build_ts'],
2611- 'account_type': r['account_type'].lower(),
2612 'partner_id': r['partner_id'],
2613 'name': r['partner_name'],
2614 'partner_ref': r['partner_ref'],
2615 'debit': debit,
2616 'credit': credit,
2617 'balance': debit - credit,
2618- 'ib_debit': r['ib_debit'] or 0.0,
2619- 'ib_credit': r['ib_credit'] or 0.0,
2620- 'ib_balance': r['ib_balance'] or 0.0,
2621 }
2622 self.create(cr, uid, vals, context=context)
2623
2624+ # if "Display Partners: All partners" has been selected, add the partners without movements
2625+ # ONLY IF NO specific partner has been selected
2626+ if data['form'].get('display_partner', '') == 'all' and not data['form'].get('partner_ids', False):
2627+ # create entries at zero for partners where no result was found
2628+ active_selection = data['form'].get('only_active_partners') and ('t',) or ('t', 'f')
2629+ other_partners_sql = """
2630+ SELECT id, ref, name
2631+ FROM res_partner
2632+ WHERE active IN %s
2633+ AND name != 'To be defined'
2634+ AND id NOT in %s;
2635+ """
2636+ cr.execute(other_partners_sql, (active_selection, tuple(p_seen.keys()),))
2637+ other_partners = cr.dictfetchall()
2638+ for partner in other_partners:
2639+ vals = {
2640+ 'uid': uid,
2641+ 'build_ts': data['build_ts'],
2642+ 'partner_id': partner['id'],
2643+ 'name': partner['name'],
2644+ 'partner_ref': partner['ref'] or '',
2645+ 'debit': 0.0,
2646+ 'credit': 0.0,
2647+ 'balance': 0.0,
2648+ }
2649+ self.create(cr, uid, vals, context=context)
2650+
2651 def open_journal_items(self, cr, uid, ids, context=None):
2652 # get related partner
2653 res = {}
2654@@ -358,12 +297,11 @@
2655 if ids:
2656 if isinstance(ids, (int, long)):
2657 ids = [ids]
2658- r = self.read(cr, uid, ids, ['account_type', 'partner_id'], context=context)
2659+ r = self.read(cr, uid, ids, ['partner_id'], context=context)
2660 if r and r[0] and r[0]['partner_id']:
2661 if context and 'data' in context and 'form' in context['data']:
2662 move_line_ids = self._execute_query_selected_partner_move_line_ids(
2663 cr, uid,
2664- r[0]['account_type'].lower(),
2665 r[0]['partner_id'][0],
2666 context['data'])
2667 if move_line_ids:
2668@@ -391,27 +329,23 @@
2669 raise osv.except_osv(_('Warning !'), _('No Journal Items to show.'))
2670 return res
2671
2672- def get_partner_data(self, cr, uid, account_types, data, context=None):
2673- """ browse with account_type filter 'payable' or 'receivable'"""
2674+ def get_partner_data(self, cr, uid, data, context=None):
2675+ """
2676+ Gets the "account_partner_balance_trees" which have just been created
2677+ """
2678 domain = [
2679 ('uid', '=', uid),
2680 ('build_ts', '=', data['build_ts']),
2681 ]
2682- if account_types:
2683- domain += [('account_type', 'in', account_types)]
2684- # get the ids in the order in which the entries have been created (to keep the sorting criteria used)
2685- ids = self.search(cr, uid, domain, context=context, order='id')
2686+ ids = self.search(cr, uid, domain, context=context, order='name, id')
2687 if ids:
2688 if isinstance(ids, (int, long)):
2689 ids = [ids]
2690 return self.browse(cr, uid, ids, context=context)
2691 return []
2692
2693- def get_partner_account_move_lines_data(self, cr, uid, account_type, partner_id, data, context=None):
2694- ids = self._execute_query_selected_partner_move_line_ids(cr, uid,
2695- account_type,
2696- partner_id,
2697- data)
2698+ def get_partner_account_move_lines_data(self, cr, uid, partner_id, data, context=None):
2699+ ids = self._execute_query_selected_partner_move_line_ids(cr, uid, partner_id, data)
2700 if ids:
2701 if isinstance(ids, (int, long)):
2702 ids = [ids]
2703@@ -425,15 +359,15 @@
2704 return res
2705 return []
2706
2707- def get_lines_per_currency(self, cr, uid, account_type, partner_id, data, account_code):
2708+ def get_lines_per_currency(self, cr, uid, partner_id, data, account_code):
2709 """
2710 Returns a list of dicts, each containing the subtotal per currency for the given partner and account
2711 """
2712 res = []
2713- if account_type and partner_id and data and account_code:
2714+ if partner_id and data and account_code:
2715 # the subtotal lines for the selected partner must be limited to the ids corresponding to
2716 # the criteria selected in the wizard
2717- ids = self._execute_query_selected_partner_move_line_ids(cr, uid, account_type, partner_id, data)
2718+ ids = self._execute_query_selected_partner_move_line_ids(cr, uid, partner_id, data)
2719 if ids:
2720 sql = """SELECT c.name as currency_booking,
2721 SUM(aml.debit_currency) as debit_booking, SUM(aml.credit_currency) as credit_booking,
2722@@ -450,27 +384,24 @@
2723 res = cr.dictfetchall()
2724 return res
2725
2726- def get_partners_total_debit_credit_balance_by_account_type(self, cr, uid, account_type, data):
2727+ def get_partners_total_debit_credit_balance(self, cr, uid, data):
2728 """Compute all partners total debit/credit from self data
2729- for given account_types (tuple) payable/receivable or both
2730 return total_debit, total_credit (tuple)
2731 """
2732 # recalculate the result only if the criteria have changed
2733- if not self.total_debit_credit_balance or account_type != self.total_debit_credit_balance['account_type'] \
2734- or data != self.total_debit_credit_balance['data']:
2735- query = """SELECT
2736- sum(debit) AS debit, sum(credit) AS credit, sum(balance) as balance
2737- FROM account_partner_balance_tree
2738- WHERE account_type IN ('%s')
2739- AND uid = %%s
2740- AND build_ts=%%s
2741- """ % account_type # not_a_user_entry
2742+ if not self.total_debit_credit_balance or data != self.total_debit_credit_balance['data']:
2743+ query = """SELECT sum(debit) AS debit, sum(credit) AS credit, sum(balance) as balance
2744+ FROM account_partner_balance_tree
2745+ WHERE uid = %s
2746+ AND build_ts = %s;
2747+ """
2748 cr.execute(query, (uid, data['build_ts']))
2749 res = cr.dictfetchall()
2750- self.total_debit_credit_balance['account_type'] = account_type
2751 self.total_debit_credit_balance['data'] = data
2752 self.total_debit_credit_balance['res'] = res[0]['debit'], res[0]['credit'], res[0]['balance']
2753 return self.total_debit_credit_balance['res']
2754+
2755+
2756 account_partner_balance_tree()
2757
2758
2759@@ -483,10 +414,10 @@
2760 _description = 'Print Account Partner Balance View'
2761
2762 _columns = {
2763- 'display_partner': fields.selection([('non-zero_balance',
2764- 'With balance is not equal to 0'),
2765- ('all', 'All Partners')]
2766- ,'Display Partners'),
2767+ 'display_partner': fields.selection([('all', 'All Partners'),
2768+ ('with_movements', 'With movements'),
2769+ ('non-zero_balance', 'With balance is not equal to 0')],
2770+ string='Display Partners', required=True),
2771 'instance_ids': fields.many2many('msf.instance', 'account_report_general_ledger_instance_rel', 'instance_id', 'argl_id', 'Proprietary Instances'),
2772 'tax': fields.boolean('Exclude tax', help="Exclude tax accounts from process"),
2773 'partner_ids': fields.many2many('res.partner', 'account_partner_balance_partner_rel', 'wizard_id', 'partner_id',
2774@@ -494,8 +425,11 @@
2775 'only_active_partners': fields.boolean('Only active partners', help='Display the report for active partners only'),
2776 'account_ids': fields.many2many('account.account', 'account_partner_balance_account_rel', 'wizard_id', 'account_id',
2777 string='Accounts', help='Display the report for specific accounts only'),
2778- 'include_reconciled_entries': fields.boolean('Include Reconciled Entries', help='Take reconciled entries into account'),
2779- 'initial_balance': fields.boolean('Include initial balances'),
2780+ 'reconciled': fields.selection([
2781+ ('empty', ''),
2782+ ('yes', 'Yes'),
2783+ ('no', 'No'),
2784+ ], string='Reconciled'),
2785 }
2786
2787 def _get_journals(self, cr, uid, context=None):
2788@@ -504,18 +438,17 @@
2789 return self.pool.get('account.journal').search(cr, uid, domain, context=context)
2790
2791 _defaults = {
2792- 'display_partner': 'non-zero_balance',
2793+ 'display_partner': 'with_movements',
2794 'result_selection': 'customer_supplier',
2795 'account_domain': "[('type', 'in', ['payable', 'receivable'])]",
2796 'journal_ids': _get_journals,
2797 'tax': False,
2798 'only_active_partners': False,
2799- 'include_reconciled_entries': False,
2800+ 'reconciled': 'empty',
2801 'fiscalyear_id': False,
2802 }
2803
2804 def _get_data(self, cr, uid, ids, context=None):
2805- """return data, account_type (tuple)"""
2806 if context is None:
2807 context = {}
2808
2809@@ -526,8 +459,8 @@
2810 data['build_ts'] = datetime.datetime.now().strftime(self.pool.get('date.tools').get_db_datetime_format(cr, uid, context=context))
2811 data['form'] = self.read(cr, uid, ids, ['date_from', 'date_to', 'fiscalyear_id', 'journal_ids', 'period_from',
2812 'period_to', 'filter', 'chart_account_id', 'target_move', 'display_partner',
2813- 'instance_ids', 'tax', 'partner_ids', 'initial_balance',
2814- 'only_active_partners', 'account_ids', 'include_reconciled_entries'])[0]
2815+ 'instance_ids', 'tax', 'partner_ids',
2816+ 'only_active_partners', 'account_ids', 'reconciled'])[0]
2817 if data['form']['journal_ids']:
2818 default_journals = self._get_journals(cr, uid, context=context)
2819 if default_journals:
2820@@ -538,26 +471,18 @@
2821 data['form']['used_context'] = used_context
2822
2823 data = self.pre_print_report(cr, uid, ids, data, context=context)
2824-
2825- result_selection = data['form'].get('result_selection', '')
2826- if (result_selection == 'customer'):
2827- account_type = 'Receivable'
2828- elif (result_selection == 'supplier'):
2829- account_type = 'Payable'
2830- else:
2831- account_type = 'Receivable and Payable'
2832- return data, account_type
2833+ return data
2834
2835 def show(self, cr, buid, ids, context=None):
2836 uid = hasattr(buid, 'realUid') and buid.realUid or buid
2837- data, account_type = self._get_data(cr, uid, ids, context=context)
2838+ data = self._get_data(cr, uid, ids, context=context)
2839 self.pool.get('account.partner.balance.tree').build_data(cr,
2840 uid, data,
2841 context=context)
2842 self._check_dates_fy_consistency(cr, uid, data, context)
2843 return {
2844 'type': 'ir.actions.act_window',
2845- 'name': 'Partner Balance ' + account_type,
2846+ 'name': _('Partner Balance'),
2847 'res_model': 'account.partner.balance.tree',
2848 'view_type': 'form',
2849 'view_mode': 'tree,form',
2850@@ -574,7 +499,7 @@
2851 if context is None:
2852 context = {}
2853 uid = hasattr(buid, 'realUid') and buid.realUid or buid
2854- data, account_type = self._get_data(cr, uid, ids, context=context)
2855+ data = self._get_data(cr, uid, ids, context=context)
2856 self._check_dates_fy_consistency(cr, uid, data, context)
2857 self.pool.get('account.partner.balance.tree').build_data(cr, uid, data, context=context)
2858 return {
2859@@ -587,7 +512,7 @@
2860 if context is None:
2861 context = {}
2862 uid = hasattr(buid, 'realUid') and buid.realUid or buid
2863- data, account_type = self._get_data(cr, uid, ids, context=context)
2864+ data = self._get_data(cr, uid, ids, context=context)
2865 self._check_dates_fy_consistency(cr, uid, data, context)
2866 self.pool.get('account.partner.balance.tree').build_data(cr,
2867 uid, data,
2868
2869=== modified file 'bin/addons/finance/wizard/account_report_partner_balance_tree_view.xml'
2870--- bin/addons/finance/wizard/account_report_partner_balance_tree_view.xml 2017-10-04 05:23:42 +0000
2871+++ bin/addons/finance/wizard/account_report_partner_balance_tree_view.xml 2018-08-17 15:39:40 +0000
2872@@ -8,15 +8,7 @@
2873 <field name="type">search</field>
2874 <field name="arch" type="xml">
2875 <search string="Partner Balance Search">
2876- <field name="account_type"/>
2877 <field name="partner_id" string="Partner" />
2878- <newline />
2879- <group expand="0" string="Group By...">
2880- <filter name="groupby_payable_receivable" string="Payable/Receivable"
2881- icon="terp-personal" domain="[]"
2882- context="{'group_by':'account_type'}"
2883- />
2884- </group>
2885 </search>
2886 </field>
2887 </record>
2888@@ -36,7 +28,6 @@
2889 type="object"
2890 icon="terp-gtk-go-back-rtl"
2891 />
2892- <field name="account_type"/>
2893 <field name="name"/>
2894 <field name="debit" sum="Debit" />
2895 <field name="credit" sum="Credit" />
2896@@ -96,11 +87,9 @@
2897 <xpath expr="//field[@name='target_move']" position="after">
2898 <field name="result_selection" on_change="onchange_result_selection_or_tax(result_selection, tax)"/>
2899 <field name="display_partner"/>
2900- <field name="include_reconciled_entries"/>
2901- <field name="initial_balance" attrs="{'readonly': [('fiscalyear_id', '=', False)]}"/>
2902+ <field name="reconciled"/>
2903+ <field name="tax" on_change="onchange_result_selection_or_tax(result_selection, tax)"/>
2904 <field name="only_active_partners"/>
2905- <field name="tax" on_change="onchange_result_selection_or_tax(result_selection, tax)"/>
2906- <newline />
2907 <field name="instance_ids" domain="[('instance_to_display_ids','=',True)]">
2908 <tree noteditable="1" editable="top" string="Proprietary Instances">
2909 <field name="code" />
2910@@ -171,7 +160,7 @@
2911 <field name="view_type">form</field>
2912 <field name="view_mode">form</field>
2913 <field name="view_id" ref="wizard_account_report_partner_balance_tree_view"/>
2914- <field name="context">{'record_id':active_id,'search_default_groupby_payable_receivable':'1'}</field>
2915+ <field name="context">{'record_id': active_id}</field>
2916 <field name="target">new</field>
2917 </record>
2918
2919
2920=== modified file 'bin/addons/msf_profile/data/patches.xml'
2921--- bin/addons/msf_profile/data/patches.xml 2018-08-01 16:12:31 +0000
2922+++ bin/addons/msf_profile/data/patches.xml 2018-08-17 15:39:40 +0000
2923@@ -1,11 +1,28 @@
2924 <?xml version="1.0" encoding="utf-8" ?>
2925 <openerp>
2926 <data>
2927+<<<<<<< TREE
2928 <!-- UF10.0 -->
2929 <record id="us_3427_update_third_parties_in_gl_selector" model="patch.scripts">
2930 <field name="method">us_3427_update_third_parties_in_gl_selector</field>
2931 </record>
2932
2933+=======
2934+
2935+ <!-- UF10.0 -->
2936+ <record id="us_3873_update_reconcile_filter_in_partner_report_templates" model="patch.scripts">
2937+ <field name="method">us_3873_update_reconcile_filter_in_partner_report_templates</field>
2938+ </record>
2939+
2940+ <record id="us_3873_update_display_partner_in_partner_balance_templates" model="patch.scripts">
2941+ <field name="method">us_3873_update_display_partner_in_partner_balance_templates</field>
2942+ </record>
2943+
2944+ <record id="us_3873_remove_initial_balance_in_partner_balance_templates" model="patch.scripts">
2945+ <field name="method">us_3873_remove_initial_balance_in_partner_balance_templates</field>
2946+ </record>
2947+
2948+>>>>>>> MERGE-SOURCE
2949 <!-- UF 9.1 -->
2950 <record id="change_xml_payment_method" model="patch.scripts">
2951 <field name="method">change_xml_payment_method</field>
2952
2953=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
2954--- bin/addons/msf_profile/i18n/fr_MF.po 2018-08-16 15:06:23 +0000
2955+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-08-17 15:39:40 +0000
2956@@ -361,6 +361,7 @@
2957 #. modules: account, finance
2958 #: report:account.partner.balance:0
2959 #: view:account.partner.balance:0
2960+#: code:addons/finance/wizard/account_report_partner_balance_tree.py:490
2961 #: model:ir.actions.act_window,name:account.action_account_partner_balance
2962 #: model:ir.actions.report.xml,name:account.account_3rdparty_account_balance
2963 #: model:ir.actions.report.xml,name:finance.account_partner_balance_tree_xls
2964@@ -1339,6 +1340,9 @@
2965 #. modules: account, finance
2966 #: selection:account.partner.balance,display_partner:0
2967 #: selection:wizard.account.partner.balance.tree,display_partner:0
2968+#: selection:account.partner.ledger,display_partner:0
2969+#: code:addons/account/report/account_partner_ledger.py:371
2970+#: code:addons/finance/report/account_partner_balance_tree.py:135
2971 msgid "All Partners"
2972 msgstr "Tous les Partenaires"
2973
2974@@ -7629,9 +7633,15 @@
2975 msgid "Monthly review consumption line to delete"
2976 msgstr "Monthly review consumption line to delete"
2977
2978-#. module: finance
2979+#. modules: finance, account
2980 #: report:addons/finance/report/account_partner_balance_tree_xls.mako:315
2981 #: field:wizard.account.partner.balance.tree,display_partner:0
2982+#: field:account.partner.ledger,display_partner:0
2983+#: field:account.partner.balance,display_partner:0
2984+#: report:account.partner.balance:0
2985+#: report:account.third_party_ledger:0
2986+#: report:account.third_party_ledger_other:0
2987+#: report:addons/account/report/account_partner_ledger.mako:280
2988 msgid "Display Partners"
2989 msgstr "Afficher les Partenaires"
2990
2991@@ -8210,7 +8220,7 @@
2992 msgid "Open Logs"
2993 msgstr "Ouvrir les Journaux de bord"
2994
2995-#. modules: account, res_currency_functional, analytic_override, account_mcdb, transport_mgmt
2996+#. modules: account, res_currency_functional, analytic_override, account_mcdb, transport_mgmt, finance
2997 #: selection:account.journal.column,field:0
2998 #: report:addons/account_mcdb/report/report_account_analytic_line_free_xls.mako:78
2999 #: report:combined.journals.report.pdf:0
3000@@ -8220,6 +8230,11 @@
3001 #: code:addons/account_mcdb/report/account_mcdb_export.py:184
3002 #: report:addons/account_mcdb/report/combined_journals_report.mako:259
3003 #: report:addons/account_mcdb/report/report_account_analytic_line_xls.mako:62
3004+#: report:account.partner.balance:0
3005+#: report:account.third_party_ledger:0
3006+#: report:account.third_party_ledger_other:0
3007+#: report:addons/account/report/account_partner_ledger.mako:246
3008+#: report:addons/finance/report/account_partner_balance_tree_xls.mako:316
3009 #: field:account.analytic.line,functional_currency_id:0
3010 #: field:account.bank.statement.line,functional_currency_id:0
3011 #: field:account.move.line,functional_currency_id:0
3012@@ -13833,8 +13848,11 @@
3013 #: code:addons/account/report/account_balance_sheet.py:298
3014 #: code:addons/account/report/account_general_ledger.py:539
3015 #: code:addons/account/report/account_profit_loss.py:205
3016+#: code:addons/account/report/account_partner_ledger.py:372
3017+#: code:addons/finance/report/account_partner_balance_tree.py:136
3018 #: report:addons/finance/report/account_partner_balance_tree_xls.mako:294
3019 #: selection:wizard.account.partner.balance.tree,display_partner:0
3020+#: selection:account.partner.ledger,display_partner:0
3021 #, python-format
3022 msgid "With balance is not equal to 0"
3023 msgstr "Avec un solde qui n'est pas égal à 0"
3024@@ -16862,7 +16880,7 @@
3025 msgid "%s update%s"
3026 msgstr "%s update%s"
3027
3028-#. modules: msf_budget, sales_followup, account, product_attributes, register_accounting, unifield_setup, object_query, order_types, mission_stock, msf_accrual, procurement_report, msf_partner, res_currency_tables, salr, sourcing,, tender_flow, msf_doc_import
3029+#. modules: msf_budget, sales_followup, account, product_attributes, register_accounting, unifield_setup, object_query, order_types, mission_stock, msf_accrual, procurement_report, msf_partner, res_currency_tables, salr, sourcing, tender_flow, msf_doc_import, finance
3030 #: view:account.state.open:0
3031 #: selection:mission.stock.wizard,split_stock:0
3032 #: selection:mission.stock.wizard,with_valuation:0
3033@@ -16891,6 +16909,10 @@
3034 #: selection:account.balance.report,reconciled:0
3035 #: selection:account.report.general.ledger,reconciled:0
3036 #: code:addons/account/report/account_general_ledger.py:516
3037+#: selection:account.partner.ledger,reconciled:0
3038+#: selection:wizard.account.partner.balance.tree,reconciled:0
3039+#: code:addons/account/report/account_partner_ledger.py:360
3040+#: code:addons/finance/report/account_partner_balance_tree.py:123
3041 #: selection:mission.stock.wizard,display_only_in_stock:0
3042 #: view:monthly.budget.wizard:0
3043 #: selection:wizard.export.po.validated,need_ad:0
3044@@ -17884,11 +17906,6 @@
3045 msgid "Contributors"
3046 msgstr "Contributeurs"
3047
3048-#. module: account
3049-#: help:account.partner.ledger,reconcil:0
3050-msgid "Consider reconciled entries"
3051-msgstr "Tenir compte des écritures lettrées"
3052-
3053 #. module: base
3054 #: selection:res.config.users,context_tz:0
3055 #: selection:res.users,context_tz:0
3056@@ -18276,11 +18293,6 @@
3057 msgid "line"
3058 msgstr "ligne"
3059
3060-#. module: account
3061-#: field:account.partner.balance,display_partner:0
3062-msgid "Display Partners"
3063-msgstr "Afficher Partenaires"
3064-
3065 #. modules: product_nomenclature, product_asset, stock_schedule, product_attributes, product_expiry, return_claim, msf_doc_import, supplier_catalogue, unifield_setup, product_list, stock, product, service_purchasing, consumption_calculation, purchase_override, specific_rules, kit, sync_so, product_manufacturer, account_override, msf_outgoing, transport_mgmt, msf_audittrail, purchase_msf
3066 #: constraint:product.product:0
3067 #: constraint:product.product:0
3068@@ -21808,11 +21820,6 @@
3069 msgid "There is no lines to create! Please choose another period."
3070 msgstr "Il n'y pas de ligne à créer! Veuillez choisir une autre période."
3071
3072-#. module: finance
3073-#: help:wizard.account.partner.balance.tree,include_reconciled_entries:0
3074-msgid "Take reconciled entries into account"
3075-msgstr "Prendre en compte les écritures lettrées"
3076-
3077 #. module: msf_config_locations
3078 #: code:addons/msf_config_locations/stock_configuration.py:542
3079 #, python-format
3080@@ -25233,7 +25240,7 @@
3081 msgid "Europe/Bucharest"
3082 msgstr "Europe/Bucharest"
3083
3084-#. modules: msf_budget, account, account_payment, product_attributes, register_accounting, unifield_setup, object_query, order_types, mission_stock, msf_accrual, procurement_report, stock, msf_partner, salr, sourcing, tender_flow, msf_doc_import
3085+#. modules: msf_budget, account, account_payment, product_attributes, register_accounting, unifield_setup, object_query, order_types, mission_stock, msf_accrual, procurement_report, stock, msf_partner, salr, sourcing, tender_flow, msf_doc_import, finance
3086 #: view:account.state.open:0
3087 #: view:account.payment.make.payment:0
3088 #: selection:mission.stock.wizard,split_stock:0
3089@@ -25257,6 +25264,10 @@
3090 #: selection:account.balance.report,reconciled:0
3091 #: selection:account.report.general.ledger,reconciled:0
3092 #: code:addons/account/report/account_general_ledger.py:515
3093+#: selection:account.partner.ledger,reconciled:0
3094+#: selection:wizard.account.partner.balance.tree,reconciled:0
3095+#: code:addons/account/report/account_partner_ledger.py:359
3096+#: code:addons/finance/report/account_partner_balance_tree.py:122
3097 #: selection:mission.stock.wizard,display_only_in_stock:0
3098 #: code:addons/msf_budget/report/report_budget_criteria.py:63
3099 #: selection:wizard.export.po.validated,need_ad:0
3100@@ -27822,6 +27833,9 @@
3101 #: report:account.partner.balance:0
3102 #: report:addons/finance/report/account_partner_balance_tree_xls.mako:316
3103 #: report:account.general.ledger_landscape_tb:0
3104+#: report:account.third_party_ledger:0
3105+#: report:account.third_party_ledger_other:0
3106+#: report:addons/account/report/account_partner_ledger.mako:244
3107 msgid "Filter By"
3108 msgstr "Filtrer par"
3109
3110@@ -33935,7 +33949,7 @@
3111 msgid "Shipment Lead Time"
3112 msgstr "Délai d'Expédition"
3113
3114-#. module: account
3115+#. modules: account, finance
3116 #: selection:account.balance.report,display_account:0
3117 #: selection:account.bs.report,display_account:0
3118 #: selection:account.common.account.report,display_account:0
3119@@ -33944,6 +33958,10 @@
3120 #: code:addons/account/report/account_profit_loss.py:203
3121 #: code:addons/account/report/account_balance_sheet.py:296
3122 #: code:addons/account/report/account_general_ledger.py:537
3123+#: code:addons/account/report/account_partner_ledger.py:370
3124+#: code:addons/finance/report/account_partner_balance_tree.py:134
3125+#: selection:account.partner.ledger,display_partner:0
3126+#: selection:wizard.account.partner.balance.tree,display_partner:0
3127 #, python-format
3128 msgid "With movements"
3129 msgstr "Avec écritures"
3130@@ -37200,13 +37218,11 @@
3131 #: view:account.account:0
3132 #: selection:account.aged.trial.balance,result_selection:0
3133 #: selection:account.common.partner.report,result_selection:0
3134-#: report:account.partner.balance:0
3135 #: selection:account.partner.balance,result_selection:0
3136 #: selection:account.partner.ledger,result_selection:0
3137 #: code:addons/account/report/account_partner_ledger.py:294
3138 #: model:ir.actions.act_window,name:account.action_aged_receivable
3139 #: view:account.account:0
3140-#: report:addons/finance/report/account_partner_balance_tree_xls.mako:284
3141 #: selection:wizard.account.partner.balance.tree,result_selection:0
3142 #: code:addons/finance/report/account_partner_balance_tree.py:90
3143 #, python-format
3144@@ -38120,6 +38136,9 @@
3145 #: report:addons/sale/report/fo_allocation_report.mako:219
3146 #: report:sale.order.allocation.report:0
3147 #: field:sale.order.line,price_subtotal:0
3148+#: report:account.third_party_ledger:0
3149+#: report:account.third_party_ledger_other:0
3150+#: report:addons/account/report/account_partner_ledger.mako:364
3151 msgid "Subtotal"
3152 msgstr "Sous-total"
3153
3154@@ -45195,7 +45214,7 @@
3155 msgid "Create Invoices"
3156 msgstr "Créer Factures"
3157
3158-#. module: account
3159+#. modules: account, finance
3160 #: field:account.aged.trial.balance,result_selection:0
3161 #: field:account.common.partner.report,result_selection:0
3162 #: report:account.partner.balance:0
3163@@ -45204,6 +45223,7 @@
3164 #: report:account.third_party_ledger:0
3165 #: report:account.third_party_ledger_other:0
3166 #: report:addons/account/report/account_partner_ledger.mako:211
3167+#: report:addons/finance/report/account_partner_balance_tree_xls.mako:339
3168 msgid "Partner's"
3169 msgstr "Du Partenaire"
3170
3171@@ -49646,7 +49666,7 @@
3172 #: selection:wizard.account.partner.balance.tree,result_selection:0
3173 #, python-format
3174 msgid "Receivable and Payable Accounts"
3175-msgstr "Comptes Clients & Fournisseurs"
3176+msgstr "Comptes Clients et Fournisseurs"
3177
3178 #. module: base
3179 #: code:addons/base/res/res_currency.py:106
3180@@ -58279,10 +58299,7 @@
3181 #: field:account.move,journal_id:0
3182 #: field:account.move.bank.reconcile,journal_id:0
3183 #: view:account.move.line:0
3184-#: report:account.third_party_ledger:0
3185-#: report:account.third_party_ledger_other:0
3186 #: code:addons/account/account_move_line.py:870
3187-#: report:addons/account/report/account_partner_ledger.mako:210
3188 #: view:analytic.entries.report:0
3189 #: field:analytic.entries.report,journal_id:0
3190 #: model:ir.actions.report.xml,name:account.account_journal
3191@@ -60147,11 +60164,6 @@
3192 msgid "Search Values"
3193 msgstr "Valeurs Recherche"
3194
3195-#. module: finance
3196-#: view:account.partner.balance.tree:0
3197-msgid "Payable/Receivable"
3198-msgstr "Payable/Receivable"
3199-
3200 #. module: account
3201 #: selection:report.account.receivable,type:0
3202 msgid "Equity"
3203@@ -64212,12 +64224,19 @@
3204 msgid "Cheque Number"
3205 msgstr "Chèque - Numéro"
3206
3207-#. modules: account, register_accounting, account_mcdb
3208+#. modules: account, register_accounting, account_mcdb, finance
3209 #: view:account.entries.report:0
3210 #: selection:account.mcdb,reconciled:0
3211 #: field:wizard.account.invoice,reconciled:0
3212 #: field:account.balance.report,reconciled:0
3213 #: field:account.report.general.ledger,reconciled:0
3214+#: field:account.partner.ledger,reconciled:0
3215+#: field:wizard.account.partner.balance.tree,reconciled:0
3216+#: report:account.partner.balance:0
3217+#: report:account.third_party_ledger:0
3218+#: report:account.third_party_ledger_other:0
3219+#: report:addons/account/report/account_partner_ledger.mako:279
3220+#: report:addons/finance/report/account_partner_balance_tree_xls.mako:341
3221 msgid "Reconciled"
3222 msgstr "Lettrée"
3223
3224@@ -69532,7 +69551,6 @@
3225 msgstr "Joindre un certificat de donation"
3226
3227 #. modules: res_currency_functional, msf_accrual, finance, register_accounting
3228-#: report:addons/finance/report/account_partner_balance_tree_xls.mako:318
3229 #: field:cash.request.liquidity,functional_currency_id:0
3230 #: field:cash.request.liquidity.bank,functional_currency_id:0
3231 #: field:cash.request.liquidity.cash,functional_currency_id:0
3232@@ -69892,6 +69910,9 @@
3233 #: report:addons/finance/report/account_partner_balance_tree_xls.mako:314
3234 #: report:account.general.ledger_landscape_tb:0
3235 #: field:wizard.account.partner.balance.tree,journal_ids:0
3236+#: report:account.third_party_ledger:0
3237+#: report:account.third_party_ledger_other:0
3238+#: report:addons/account/report/account_partner_ledger.mako:241
3239 msgid "Journals"
3240 msgstr "Journaux"
3241
3242@@ -72556,9 +72577,8 @@
3243 msgid "Send Last Backup to remote"
3244 msgstr "Envoyer la dernière sauvegarde à distance"
3245
3246-#. modules: account, finance, account_override
3247+#. modules: account, account_override
3248 #: field:account.report.general.ledger,initial_balance:0
3249-#: field:wizard.account.partner.balance.tree,initial_balance:0
3250 #: field:account.balance.report,initial_balance:0
3251 #: field:account.chart,initial_balance:0
3252 msgid "Include initial balances"
3253@@ -77379,9 +77399,6 @@
3254 #. module: account
3255 #: report:account.general.ledger:0
3256 #: report:account.journal.period.print:0
3257-#: report:account.third_party_ledger:0
3258-#: report:account.third_party_ledger_other:0
3259-#: report:addons/account/report/account_partner_ledger.mako:213
3260 msgid "Filters By"
3261 msgstr "Filtrés par"
3262
3263@@ -78136,6 +78153,7 @@
3264 #: code:addons/account/report/account_balance_sheet.py:325
3265 #: code:addons/account/report/account_general_ledger.py:458
3266 #: report:addons/account/report/account_partner_ledger.mako:213
3267+#: report:addons/finance/report/account_partner_balance_tree_xls.mako:291
3268 #: code:addons/account/report/account_profit_loss.py:232
3269 #: code:addons/account/report/common_report_header.py:169
3270 #: code:addons/finance/report/account_partner_balance_tree.py:135
3271@@ -85383,6 +85401,8 @@
3272 #: code:addons/account_override/wizard/account_chart.py:305
3273 #: code:addons/account_period_closing_level/account_year_end_closing.py:214
3274 #: code:addons/analytic_distribution/wizard/account_analytic_chart.py:215
3275+#: code:addons/account/report/account_partner_ledger.py:358
3276+#: code:addons/finance/report/account_partner_balance_tree.py:121
3277 #, python-format
3278 msgid "All"
3279 msgstr "Tous(tes)"
3280@@ -85551,13 +85571,11 @@
3281 #: view:account.account.template:0
3282 #: selection:account.aged.trial.balance,result_selection:0
3283 #: selection:account.common.partner.report,result_selection:0
3284-#: report:account.partner.balance:0
3285 #: selection:account.partner.balance,result_selection:0
3286 #: selection:account.partner.ledger,result_selection:0
3287 #: code:addons/account/report/account_partner_ledger.py:296
3288 #: view:account.account:0
3289 #: code:addons/finance/report/account_partner_balance_tree.py:92
3290-#: report:addons/finance/report/account_partner_balance_tree_xls.mako:282
3291 #: selection:wizard.account.partner.balance.tree,result_selection:0
3292 #, python-format
3293 msgid "Payable Accounts"
3294@@ -88503,12 +88521,6 @@
3295 msgid "Current company"
3296 msgstr "Société actuelle"
3297
3298-#. modules: account, finance
3299-#: field:account.partner.ledger,reconcil:0
3300-#: field:wizard.account.partner.balance.tree,include_reconciled_entries:0
3301-msgid "Include Reconciled Entries"
3302-msgstr "Inclure les Ecritures Lettrées"
3303-
3304 #. modules: base, base_setup, unifield_setup
3305 #: field:res.partner.address,state_id:0
3306 #: field:base.setup.company,state_id:0
3307@@ -92185,12 +92197,17 @@
3308 msgid "Base price for computing the customer price. Sometimes called the catalog price."
3309 msgstr "Prix de base pour le calcul du prix client. Parfois appelé prix catalogue."
3310
3311-#. modules: account, account_mcdb
3312+#. modules: account, account_mcdb, finance
3313 #: field:account.mcdb,analytic_axis:0
3314 #: code:addons/account_mcdb/account_mcdb.py:1109
3315 #: report:account.general.ledger:0
3316 #: report:account.general.ledger_landscape:0
3317 #: report:account.general.ledger_landscape_tb:0
3318+#: report:account.partner.balance:0
3319+#: report:account.third_party_ledger:0
3320+#: report:account.third_party_ledger_other:0
3321+#: report:addons/account/report/account_partner_ledger.mako:245
3322+#: report:addons/finance/report/account_partner_balance_tree_xls.mako:315
3323 #, python-format
3324 msgid "Display"
3325 msgstr "Afficher"
3326@@ -101442,6 +101459,7 @@
3327 #, python-format
3328 msgid "The Location \"%s\" on line level is not the same as the Location \"%s\" on header level."
3329 msgstr "La Zone \"%s\" au niveau de la ligne n'est pas la même que la Zone \"%s\" au niveau de l'entête."
3330+<<<<<<< TREE
3331
3332 #. module: account_override
3333 #: code:addons/account_override/account.py:1138
3334@@ -101649,3 +101667,12 @@
3335 #: report:addons/msf_supply_doc_export/report/report_purchase_order_xls.mako:84
3336 msgid "Dangerous Good Type"
3337 msgstr "Type de marchandise Dangereuse"
3338+=======
3339+
3340+#. module: account
3341+#: report:account.third_party_ledger:0
3342+#: report:account.third_party_ledger_other:0
3343+#: report:addons/account/report/account_partner_ledger.mako:310
3344+msgid "Reconcile Number"
3345+msgstr "Numéro de lettrage"
3346+>>>>>>> MERGE-SOURCE
3347
3348=== modified file 'bin/addons/msf_profile/msf_profile.py'
3349--- bin/addons/msf_profile/msf_profile.py 2018-08-16 09:59:11 +0000
3350+++ bin/addons/msf_profile/msf_profile.py 2018-08-17 15:39:40 +0000
3351@@ -51,6 +51,7 @@
3352 'model': lambda *a: 'patch.scripts',
3353 }
3354
3355+<<<<<<< TREE
3356 # UF10.0
3357 def us_3427_update_third_parties_in_gl_selector(self, cr, uid, *a, **b):
3358 """
3359@@ -89,6 +90,69 @@
3360 }
3361 selector_obj.write(cr, uid, selector.id, vals)
3362
3363+=======
3364+ # UF10.0
3365+ def us_3873_update_reconcile_filter_in_partner_report_templates(self, cr, uid, *a, **b):
3366+ """
3367+ Updates the Wizard Templates for the "Partner Ledger" and "Partner Balance" following the change on reconcile filter:
3368+ - "Include Reconciled Entries" ticked ==> becomes "Reconciled: Empty"
3369+ - "Include Reconciled Entries" unticked ==> becomes "Reconciled: No"
3370+ (Note: templates aren't synched for now)
3371+ """
3372+ template_obj = self.pool.get('wizard.template')
3373+ template_ids = template_obj.search(cr, uid, [('wizard_name', 'in',
3374+ ['account.partner.ledger', 'wizard.account.partner.balance.tree'])])
3375+ for template in template_obj.browse(cr, uid, template_ids, fields_to_fetch=['wizard_name', 'values']):
3376+ old_field = template.wizard_name == 'account.partner.ledger' and 'reconcil' or 'include_reconciled_entries'
3377+ new_field = 'reconciled'
3378+ try:
3379+ values_dict = eval(template.values)
3380+ if old_field in values_dict:
3381+ if not values_dict[old_field]:
3382+ reconciled = 'no'
3383+ else:
3384+ reconciled = 'empty'
3385+ values_dict[new_field] = reconciled
3386+ del values_dict[old_field]
3387+ template_obj.write(cr, uid, template.id, {'values': values_dict})
3388+ except:
3389+ pass
3390+
3391+ def us_3873_update_display_partner_in_partner_balance_templates(self, cr, uid, *a, **b):
3392+ """
3393+ Updates the Wizard Templates for the "Partner Balance" report following the fact that the display_partner field
3394+ is now required: an empty display_partner becomes "With movements" (= will give the same results as before US-3873 dev)
3395+ (Note: templates aren't synched for now)
3396+ """
3397+ template_obj = self.pool.get('wizard.template')
3398+ template_ids = template_obj.search(cr, uid, [('wizard_name', '=', 'wizard.account.partner.balance.tree')])
3399+ for template in template_obj.browse(cr, uid, template_ids, fields_to_fetch=['values']):
3400+ try:
3401+ values_dict = eval(template.values)
3402+ if 'display_partner' in values_dict:
3403+ if not values_dict['display_partner']:
3404+ values_dict['display_partner'] = 'with_movements'
3405+ template_obj.write(cr, uid, template.id, {'values': values_dict})
3406+ except:
3407+ pass
3408+
3409+ def us_3873_remove_initial_balance_in_partner_balance_templates(self, cr, uid, *a, **b):
3410+ """
3411+ Removes the initial_balance from the Wizard Templates for the "Partner Balance" report
3412+ (Note: templates aren't synched for now)
3413+ """
3414+ template_obj = self.pool.get('wizard.template')
3415+ template_ids = template_obj.search(cr, uid, [('wizard_name', '=', 'wizard.account.partner.balance.tree')])
3416+ for template in template_obj.browse(cr, uid, template_ids, fields_to_fetch=['values']):
3417+ try:
3418+ values_dict = eval(template.values)
3419+ if 'initial_balance' in values_dict:
3420+ del values_dict['initial_balance']
3421+ template_obj.write(cr, uid, template.id, {'values': values_dict})
3422+ except:
3423+ pass
3424+
3425+>>>>>>> MERGE-SOURCE
3426 # UF9.1
3427 def change_xml_payment_method(self, cr, uid, *a, **b):
3428 user_obj = self.pool.get('res.users')

Subscribers

People subscribed via source and target branches