Merge lp:~julie-w/unifield-server/US-7156 into lp:unifield-server
- US-7156
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5731 |
Proposed branch: | lp:~julie-w/unifield-server/US-7156 |
Merge into: | lp:unifield-server |
Diff against target: |
309 lines (+66/-34) 6 files modified
bin/addons/account/report/account_general_ledger.py (+12/-14) bin/addons/account/report/account_general_ledger_xls.mako (+42/-9) bin/addons/account/wizard/account_report_general_ledger.py (+4/-1) bin/addons/account/wizard/account_report_general_ledger_view.xml (+1/-2) bin/addons/finance/account_drill.py (+1/-1) bin/addons/msf_profile/i18n/fr_MF.po (+6/-7) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-7156 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+385465@code.launchpad.net |
Commit message
Description of the change
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_general_ledger.py' |
2 | --- bin/addons/account/report/account_general_ledger.py 2020-02-03 14:46:06 +0000 |
3 | +++ bin/addons/account/report/account_general_ledger.py 2020-06-10 07:55:32 +0000 |
4 | @@ -225,7 +225,6 @@ |
5 | 'get_start_period': self.get_start_period, |
6 | 'get_end_period': self.get_end_period, |
7 | 'get_filter': self._get_filter, |
8 | - 'get_sortby': self._get_sortby, |
9 | 'get_start_date':self._get_start_date, |
10 | 'get_end_date':self._get_end_date, |
11 | 'get_target_move': self._get_target_move, |
12 | @@ -337,10 +336,14 @@ |
13 | del counterpart_res''' |
14 | # Then select all account_move_line of this account |
15 | |
16 | - if self.sortby == 'sort_journal_partner': |
17 | - sql_sort='j.code, p.name, l.move_id' |
18 | - else: |
19 | - sql_sort='l.date, l.move_id' |
20 | + if self.sortby == 'sort_third_party': |
21 | + sql_sort = 'l.partner_txt NULLS first, l.move_id' |
22 | + elif self.sortby == 'sort_currency': |
23 | + sql_sort = 'c.name, l.move_id' |
24 | + elif self.sortby == 'sort_reconcile': |
25 | + sql_sort = 'l.reconcile_txt NULLS first, l.move_id' |
26 | + else: # sort_date by default |
27 | + sql_sort = 'l.date, l.move_id' |
28 | sql = """ |
29 | SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id, |
30 | l.amount_currency,l.ref AS lref, l.name AS lname, |
31 | @@ -352,7 +355,7 @@ |
32 | c.symbol AS currency_code, |
33 | i.id AS invoice_id, i.type AS invoice_type, |
34 | i.number AS invoice_number, |
35 | - p.name AS partner_name, c.name as currency_name, l.partner_txt as third_party |
36 | + p.name AS partner_name, c.name as currency_name, l.partner_txt as third_party, l.reconcile_txt |
37 | FROM account_move_line l |
38 | JOIN account_move m on (l.move_id=m.id) |
39 | LEFT JOIN res_currency c on (l.currency_id=c.id) |
40 | @@ -370,6 +373,8 @@ |
41 | if self.init_balance: |
42 | # US-822: move lines for period 0 IB journal |
43 | sql_sort = 'l.move_id' |
44 | + if self.sortby == 'sort_currency': # also sort by currency in case the related option is selected |
45 | + sql_sort = 'c.name, l.move_id' |
46 | sql = """ |
47 | SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id, |
48 | l.amount_currency,l.ref AS lref, l.name AS lname, |
49 | @@ -381,7 +386,7 @@ |
50 | per.code as period_code, c.symbol AS currency_code, |
51 | '' AS invoice_id, '' invoice_type, |
52 | '' AS invoice_number, |
53 | - '' AS partner_name, c.name as currency_name |
54 | + '' AS partner_name, c.name as currency_name, l.reconcile_txt |
55 | FROM account_move_line l |
56 | JOIN account_move m on (l.move_id=m.id) |
57 | LEFT JOIN res_currency c on (l.currency_id=c.id) |
58 | @@ -416,13 +421,6 @@ |
59 | return self.pool.get('account.account').browse(self.cr, self.uid, data['form']['id'], context=self.context).company_id.name |
60 | return super(general_ledger ,self)._get_account(data) |
61 | |
62 | - def _get_sortby(self, data): |
63 | - if self.sortby == 'sort_date': |
64 | - return 'Date' |
65 | - elif self.sortby == 'sort_journal_partner': |
66 | - return 'Journal & Partner' |
67 | - return 'Date' |
68 | - |
69 | def _get_output_currency_code(self, data): |
70 | return self.output_currency_code or self.currency_name |
71 | |
72 | |
73 | === modified file 'bin/addons/account/report/account_general_ledger_xls.mako' |
74 | --- bin/addons/account/report/account_general_ledger_xls.mako 2019-07-31 15:26:10 +0000 |
75 | +++ bin/addons/account/report/account_general_ledger_xls.mako 2020-06-10 07:55:32 +0000 |
76 | @@ -132,6 +132,16 @@ |
77 | <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" /> |
78 | </Borders> |
79 | </Style> |
80 | +<Style ss:ID="ssAccountLineRight"> |
81 | +<Alignment ss:Bottom="Top" ss:WrapText="1" ss:Vertical="Center" ss:Horizontal="Right"/> |
82 | +<Font ss:Size="8"/> |
83 | +<Borders> |
84 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1" /> |
85 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1" /> |
86 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1" /> |
87 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1" /> |
88 | +</Borders> |
89 | +</Style> |
90 | <Style ss:ID="ssAccountLineColored1"> |
91 | <Alignment ss:Bottom="Top" ss:WrapText="1"/> |
92 | <Font ss:Size="8"/> |
93 | @@ -201,10 +211,7 @@ |
94 | <Column ss:AutoFitWidth="1" ss:Width="55" /> |
95 | <Column ss:AutoFitWidth="1" ss:Width="100" ss:Span="1" /> |
96 | <Column ss:AutoFitWidth="1" ss:Width="55" /> |
97 | -<Column ss:Width="90" /> |
98 | -<Column ss:Width="90" /> |
99 | -<Column ss:Width="90" /> |
100 | -<Column ss:Width="90" /> |
101 | +<Column ss:Width="90" ss:Span="4" /> |
102 | <Row> |
103 | <Cell ss:StyleID="ssH"><Data ss:Type="String">${header_company_or_chart_of_account}</Data></Cell> |
104 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Fiscal Year</Data></Cell> |
105 | @@ -213,7 +220,12 @@ |
106 | <Cell ss:StyleID="ssH"><Data ss:Type="String">${_('Open Items at')}</Data></Cell> |
107 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Filter By ${(get_filter(data)!='No Filter' and get_filter(data) or '')|x}</Data></Cell> |
108 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Target Moves</Data></Cell> |
109 | -<Cell ss:StyleID="ssH" ss:MergeAcross="1"><Data ss:Type="String">Proprietary Instances</Data></Cell> |
110 | +% if get_show_move_lines(): |
111 | + <Cell ss:StyleID="ssH" ss:MergeAcross="2"> |
112 | +% else: |
113 | + <Cell ss:StyleID="ssH" ss:MergeAcross="1"> |
114 | +% endif |
115 | +<Data ss:Type="String">Proprietary Instances</Data></Cell> |
116 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Currency</Data></Cell> |
117 | </Row> |
118 | % for a in objects: |
119 | @@ -239,8 +251,12 @@ |
120 | <Cell ss:StyleID="ssHeader"> |
121 | <Data ss:Type="String">${(get_target_move(data) or '')|x}</Data> |
122 | </Cell> |
123 | -<Cell ss:StyleID="ssHeader" ss:MergeAcross="1"> |
124 | - <Data ss:Type="String">${(get_prop_instances() or '')|x}</Data> |
125 | +% if get_show_move_lines(): |
126 | + <Cell ss:StyleID="ssHeader" ss:MergeAcross="2"> |
127 | +% else: |
128 | + <Cell ss:StyleID="ssHeader" ss:MergeAcross="1"> |
129 | +% endif |
130 | +<Data ss:Type="String">${(get_prop_instances() or '')|x}</Data> |
131 | </Cell> |
132 | <Cell ss:StyleID="ssHeader"> |
133 | <Data ss:Type="String">${get_output_currency_code(data)}</Data> |
134 | @@ -269,6 +285,9 @@ |
135 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Credit</Data></Cell> |
136 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Booking Balance</Data></Cell> |
137 | <Cell ss:StyleID="ssH"><Data ss:Type="String">Balance ${get_output_currency_code(data)}</Data></Cell> |
138 | +% if get_show_move_lines(): |
139 | + <Cell ss:StyleID="ssH"><Data ss:Type="String">${_('Reconcile Number')}</Data></Cell> |
140 | +% endif |
141 | <Cell><Data ss:Type="String"></Data></Cell> |
142 | % if not get_show_move_lines(): |
143 | <Cell><Data ss:Type="String"></Data></Cell> |
144 | @@ -305,6 +324,9 @@ |
145 | <Cell ss:StyleID="ssNumber${ac_style_suffix}"> |
146 | <Data ss:Type="Number">${o.data['*']['debit'] - o.data['*']['credit']}</Data> |
147 | </Cell> |
148 | +% if get_show_move_lines(): |
149 | + <Cell ss:StyleID="ssBorder${ac_style_suffix}"><Data ss:Type="String"></Data></Cell> |
150 | +% endif |
151 | </Row> |
152 | % endif |
153 | |
154 | @@ -333,6 +355,9 @@ |
155 | <Cell ss:StyleID="ssNumber${ccy_sub_total_style_suffix}"> |
156 | <Data ss:Type="Number">${o.data[ccy]['debit'] - o.data[ccy]['credit']}</Data> |
157 | </Cell> |
158 | + % if get_show_move_lines(): |
159 | + <Cell ss:StyleID="ssAccountLine${ccy_sub_total_style_suffix}"><Data ss:Type="String"></Data></Cell> |
160 | + % endif |
161 | </Row> |
162 | % endfor |
163 | % endif |
164 | @@ -360,13 +385,18 @@ |
165 | <Cell ss:StyleID="ssNumber${ccy_sub_total_style_suffix}"> |
166 | <Data ss:Type="Number">${get_line_balance(line, booking=False)}</Data> |
167 | </Cell> |
168 | +% if get_show_move_lines(): |
169 | + <Cell ss:StyleID="ssAccountLine${ccy_sub_total_style_suffix}"> |
170 | + <Data ss:Type="String">${(line.get('reconcile_txt') or '')|x}</Data> |
171 | + </Cell> |
172 | +% endif |
173 | </Row> |
174 | % endfor |
175 | |
176 | % for line in lines(o, initial_balance_mode=False): |
177 | <Row> |
178 | -<Cell ss:StyleID="ssAccountLine"> |
179 | - <Data ss:Type="String"></Data> |
180 | +<Cell ss:StyleID="ssAccountLineRight"> |
181 | + <Data ss:Type="String">${(o.code or '')|x}</Data> |
182 | </Cell> |
183 | <Cell ss:StyleID="ssAccountLine"> |
184 | <Data ss:Type="String">${(line['move'] or '' or '')|x}</Data> |
185 | @@ -395,6 +425,9 @@ |
186 | <Cell ss:StyleID="ssAccountLineNumber"> |
187 | <Data ss:Type="Number">${get_line_balance(line, booking=False)}</Data> |
188 | </Cell> |
189 | +<Cell ss:StyleID="ssAccountLine"> |
190 | + <Data ss:Type="String">${(line.get('reconcile_txt') or '')|x}</Data> |
191 | +</Cell> |
192 | </Row> |
193 | % endfor |
194 | |
195 | |
196 | === modified file 'bin/addons/account/wizard/account_report_general_ledger.py' |
197 | --- bin/addons/account/wizard/account_report_general_ledger.py 2017-08-18 09:55:08 +0000 |
198 | +++ bin/addons/account/wizard/account_report_general_ledger.py 2020-06-10 07:55:32 +0000 |
199 | @@ -41,7 +41,10 @@ |
200 | help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'), |
201 | 'is_initial_balance_available': fields.function(_get_fake, method=True, type='boolean', string="Is initial balance filter available ?"), |
202 | 'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"), |
203 | - 'sortby': fields.selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], 'Sort By', required=True), |
204 | + 'sortby': fields.selection([('sort_date', 'Posting Date'), |
205 | + ('sort_third_party', 'Third Party'), |
206 | + ('sort_currency', 'Currency'), |
207 | + ('sort_reconcile', 'Reconcile Number')], 'Sort by', required=True), |
208 | 'output_currency': fields.many2one('res.currency', 'Output Currency', required=True), |
209 | 'instance_ids': fields.many2many('msf.instance', 'account_report_general_ledger_instance_rel', 'instance_id', 'argl_id', 'Proprietary Instances'), |
210 | #'export_format': fields.selection([('xls', 'Excel'), ('csv', 'CSV'), ('pdf', 'PDF')], string="Export format", required=True), |
211 | |
212 | === modified file 'bin/addons/account/wizard/account_report_general_ledger_view.xml' |
213 | --- bin/addons/account/wizard/account_report_general_ledger_view.xml 2017-08-10 14:19:58 +0000 |
214 | +++ bin/addons/account/wizard/account_report_general_ledger_view.xml 2020-06-10 07:55:32 +0000 |
215 | @@ -16,7 +16,6 @@ |
216 | <xpath expr="//field[@name='target_move']" position="after"> |
217 | <field name="is_initial_balance_available" invisible="1"/> |
218 | <field name="display_account"/> |
219 | - <field name="sortby" invisible="1" /> |
220 | <field name="initial_balance" attrs="{'readonly':[('is_initial_balance_available', '=', False)]}" /> |
221 | <field name="export_format"/> |
222 | <newline/> |
223 | @@ -24,7 +23,7 @@ |
224 | <field name="amount_currency" invisible="1" /> |
225 | <newline/> |
226 | <field name="account_type" /> |
227 | - <newline/> |
228 | + <field name="sortby" /> |
229 | <field name="reconciled" /> |
230 | <field name="reconcile_date" /> |
231 | <field name="open_items"/> |
232 | |
233 | === modified file 'bin/addons/finance/account_drill.py' |
234 | --- bin/addons/finance/account_drill.py 2017-07-06 10:27:39 +0000 |
235 | +++ bin/addons/finance/account_drill.py 2020-06-10 07:55:32 +0000 |
236 | @@ -54,7 +54,7 @@ |
237 | def get_currencies(self): |
238 | if not self.data: |
239 | return [] |
240 | - return [ c for c in self.data.keys() if c != '*' ] |
241 | + return sorted([ c for c in self.data.keys() if c != '*' ]) |
242 | |
243 | def output(self): |
244 | """ |
245 | |
246 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
247 | --- bin/addons/msf_profile/i18n/fr_MF.po 2020-06-02 14:41:41 +0000 |
248 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2020-06-10 07:55:32 +0000 |
249 | @@ -11816,11 +11816,6 @@ |
250 | msgid "Group By" |
251 | msgstr "Grouper par" |
252 | |
253 | -#. module: account |
254 | -#: selection:account.report.general.ledger,sortby:0 |
255 | -msgid "Journal & Partner" |
256 | -msgstr "Journal et Partenaire" |
257 | - |
258 | #. module: account_mcdb |
259 | #: selection:account.mcdb,currency_choice:0 |
260 | msgid "Functional" |
261 | @@ -12112,7 +12107,7 @@ |
262 | |
263 | #. module: account |
264 | #: field:account.report.general.ledger,sortby:0 |
265 | -msgid "Sort By" |
266 | +msgid "Sort by" |
267 | msgstr "Trier par" |
268 | |
269 | #. module: product |
270 | @@ -37163,7 +37158,6 @@ |
271 | #: selection:account.pl.report,filter:0 |
272 | #: selection:account.print.journal,filter:0 |
273 | #: selection:account.print.journal,sort_selection:0 |
274 | -#: selection:account.report.general.ledger,sortby:0 |
275 | #: field:account.subscription.generate,date:0 |
276 | #: field:account.subscription.line,date:0 |
277 | #: report:account.tax.code.entries:0 |
278 | @@ -65008,6 +65002,7 @@ |
279 | #: selection:integrity.finance.wizard,filter:0 |
280 | #: code:addons/account_override/res_company.py:40 |
281 | #: report:addons/account/report/export_invoice.mako:108 |
282 | +#: selection:account.report.general.ledger,sortby:0 |
283 | #, python-format |
284 | msgid "Posting Date" |
285 | msgstr "Date de Comptabilisation" |
286 | @@ -78028,6 +78023,7 @@ |
287 | #: report:account.general.ledger_landscape:0 |
288 | #: report:account.general.ledger_landscape_tb:0 |
289 | #: report:addons/account/report/account_general_ledger_xls.mako:247 |
290 | +#: selection:account.report.general.ledger,sortby:0 |
291 | #, python-format |
292 | msgid "Third Party" |
293 | msgstr "Tiers" |
294 | @@ -92901,6 +92897,7 @@ |
295 | #: report:addons/stock/report/stock_delivery_report_xls.mako:221 |
296 | #: report:addons/account/report/export_invoice.mako:96 |
297 | #: report:msf.purchase.quotation:0 |
298 | +#: selection:account.report.general.ledger,sortby:0 |
299 | #, python-format |
300 | msgid "Currency" |
301 | msgstr "Devise" |
302 | @@ -100630,6 +100627,8 @@ |
303 | #: report:account.third_party_ledger:0 |
304 | #: report:account.third_party_ledger_other:0 |
305 | #: report:addons/account/report/account_partner_ledger.mako:310 |
306 | +#: selection:account.report.general.ledger,sortby:0 |
307 | +#: report:addons/account/report/account_general_ledger_xls.mako:289 |
308 | msgid "Reconcile Number" |
309 | msgstr "Numéro de lettrage" |
310 |