Merge lp:~julie-w/unifield-server/US-8012 into lp:unifield-server
- US-8012
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5919 |
Proposed branch: | lp:~julie-w/unifield-server/US-8012 |
Merge into: | lp:unifield-server |
Diff against target: |
1889 lines (+1360/-43) (has conflicts) 15 files modified
bin/addons/account/invoice.py (+24/-1) bin/addons/account_override/account_invoice_sync.py (+2/-1) bin/addons/account_override/invoice.py (+31/-1) bin/addons/finance/__openerp__.py (+1/-0) bin/addons/finance/invoice.py (+2/-0) bin/addons/finance/report/__init__.py (+1/-0) bin/addons/finance/report/fo_follow_up_finance.py (+197/-0) bin/addons/finance/report/fo_follow_up_finance_xls.mako (+565/-0) bin/addons/finance/wizard/__init__.py (+1/-0) bin/addons/finance/wizard/fo_follow_up_finance_wizard.py (+122/-0) bin/addons/finance/wizard/fo_follow_up_finance_wizard_view.xml (+77/-0) bin/addons/msf_profile/i18n/fr_MF.po (+315/-23) bin/addons/purchase/purchase_order.py (+1/-0) bin/addons/purchase/purchase_order_line.py (+1/-1) bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py (+20/-16) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-8012 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+397035@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/invoice.py' |
2 | --- bin/addons/account/invoice.py 2020-04-29 09:22:58 +0000 |
3 | +++ bin/addons/account/invoice.py 2021-02-01 16:08:13 +0000 |
4 | @@ -459,6 +459,10 @@ |
5 | ctx.update({'type': vals['type']}) |
6 | if '_terp_view_name' in ctx: |
7 | del ctx['_terp_view_name'] |
8 | + # if we click on the res.log... |
9 | + ctx.update({'from_inv_form': True, # ...we are sent to the invoice form... |
10 | + 'from_split': False, # ...and won't be in a split process. |
11 | + }) |
12 | message = _("Invoice '%s' is waiting for validation.") % name |
13 | self.log(cr, uid, inv_id, message, context=ctx) |
14 | return res |
15 | @@ -1341,6 +1345,9 @@ |
16 | if 'invoice_line_tax_id' in line: |
17 | line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] |
18 | |
19 | + if 'purchase_order_line_ids' in line: |
20 | + line['purchase_order_line_ids'] = [(6, 0, line.get('purchase_order_line_ids', []))] |
21 | + |
22 | if 'analytic_distribution_id' in line: |
23 | if line.get('analytic_distribution_id', False) and line.get('analytic_distribution_id')[0]: |
24 | distrib_id = line.get('analytic_distribution_id')[0] |
25 | @@ -2132,7 +2139,10 @@ |
26 | |
27 | def get(self, cr, uid, key, key2, models, meta=False, context=None, res_id_req=False, without_user=True, key2_req=True, view_id=False): |
28 | """ |
29 | - Hides the Report "Invoice Excel Export" in the menu of other invoices than IVO/IVI |
30 | + Hides the reports: |
31 | + - "Invoice Excel Export" in the menu of other invoices than IVO/IVI |
32 | + - "FO Follow-up Finance" in the menu of other invoices than IVO/STV |
33 | + - "STV/IVO lines follow-up" in the menu of other invoices than IVO/STV (+ renames it depending on the inv. type) |
34 | """ |
35 | if context is None: |
36 | context = {} |
37 | @@ -2140,9 +2150,22 @@ |
38 | model_names = [x[0] for x in models] |
39 | if key == 'action' and key2 == 'client_print_multi' and 'account.invoice' in model_names: |
40 | new_act = [] |
41 | + context_ivo = context.get('type', False) == 'out_invoice' and context.get('journal_type', False) == 'intermission' and \ |
42 | + context.get('is_intermission', False) and context.get('intermission_type', False) == 'out' |
43 | + context_stv = context.get('type', False) == 'out_invoice' and context.get('journal_type', False) == 'sale' and \ |
44 | + not context.get('is_debit_note', False) |
45 | for v in values: |
46 | + # renaming |
47 | + if len(v) > 2 and v[1] == 'invoice_lines_follow_up' and v[2].get('name'): |
48 | + if context_ivo: |
49 | + v[2]['name'] = _('IVO lines follow-up') |
50 | + elif context_stv: |
51 | + v[2]['name'] = _('STV lines follow-up') |
52 | + # display |
53 | if not context.get('is_intermission') and len(v) > 2 and v[2].get('report_name', '') == 'invoice.excel.export': |
54 | continue |
55 | + elif not context_ivo and not context_stv and len(v) > 1 and v[1] in ('fo_follow_up_finance', 'invoice_lines_follow_up'): |
56 | + continue |
57 | else: |
58 | new_act.append(v) |
59 | values = new_act |
60 | |
61 | === modified file 'bin/addons/account_override/account_invoice_sync.py' |
62 | --- bin/addons/account_override/account_invoice_sync.py 2020-05-06 12:24:37 +0000 |
63 | +++ bin/addons/account_override/account_invoice_sync.py 2021-02-01 16:08:13 +0000 |
64 | @@ -150,7 +150,8 @@ |
65 | 'product_id': product_id, |
66 | 'uos_id': uom_id, |
67 | } |
68 | - if from_supply and inv_linked_po and inv_line.get('sale_order_line_id', {}).get('sync_local_id'): |
69 | + fo_line_dict = inv_line.get('sale_order_line_id') or {} |
70 | + if from_supply and inv_linked_po and fo_line_dict.get('sync_local_id'): |
71 | # fill in the AD at line level if applicable |
72 | # search the matching between PO line and invoice line |
73 | po_line_ids = pol_obj.search(cr, uid, [('order_id', '=', inv_linked_po.id), ('sync_linked_sol', '=', inv_line['sale_order_line_id']['sync_local_id'])], context=context) |
74 | |
75 | === modified file 'bin/addons/account_override/invoice.py' |
76 | --- bin/addons/account_override/invoice.py 2020-09-10 15:03:42 +0000 |
77 | +++ bin/addons/account_override/invoice.py 2021-02-01 16:08:13 +0000 |
78 | @@ -1419,13 +1419,18 @@ |
79 | # get current merge vals for account or create new |
80 | if l.account_id.id in by_account_vals: |
81 | vals = by_account_vals[l.account_id.id] |
82 | + if l.order_line_id: |
83 | + vals.setdefault('purchase_order_line_ids', []).append(l.order_line_id.id) |
84 | else: |
85 | # new account to merge |
86 | vals = vals_template.copy() |
87 | vals.update({ |
88 | '_index_': index, |
89 | 'account_id': l.account_id.id, |
90 | + 'purchase_order_line_ids': [], |
91 | }) |
92 | + if l.order_line_id: |
93 | + vals['purchase_order_line_ids'].append(l.order_line_id.id) |
94 | index += 1 |
95 | |
96 | ''' |
97 | @@ -1506,6 +1511,8 @@ |
98 | vals['invoice_line_tax_id'] = vals['invoice_line_tax_id'] \ |
99 | and [(6, 0, vals['invoice_line_tax_id'])] or False |
100 | |
101 | + vals['purchase_order_line_ids'] = vals['purchase_order_line_ids'] and [(6, 0, vals['purchase_order_line_ids'])] or False |
102 | + |
103 | # create merge line |
104 | vals.update({'merged_line': True}) |
105 | if not self.pool.get('account.invoice.line').create(cr, uid, |
106 | @@ -1662,6 +1669,26 @@ |
107 | 'res_id': [wiz_id], |
108 | } |
109 | |
110 | + def get_invoice_lines_follow_up(self, cr, uid, ids, context=None): |
111 | + """ |
112 | + Prints the FO Follow-Up Finance report related to the IVO or STV selected |
113 | + """ |
114 | + if context is None: |
115 | + context = {} |
116 | + follow_up_wizard = self.pool.get('fo.follow.up.finance.wizard') |
117 | + inv_ids = context.get('active_ids') |
118 | + if not inv_ids: |
119 | + raise osv.except_osv(_('Error'), |
120 | + _('Please select at least one record!')) |
121 | + if isinstance(inv_ids, (int, long)): |
122 | + inv_ids = [inv_ids] |
123 | + context.update({ |
124 | + 'selected_inv_ids': inv_ids, |
125 | + 'is_intermission': self.browse(cr, uid, inv_ids[0], fields_to_fetch=['is_intermission']).is_intermission, |
126 | + }) |
127 | + wiz_id = follow_up_wizard.create(cr, uid, {}, context=context) |
128 | + return follow_up_wizard.print_excel(cr, uid, [wiz_id], context=context) |
129 | + |
130 | |
131 | account_invoice() |
132 | |
133 | @@ -1916,6 +1943,8 @@ |
134 | and without link to PO/FO lines when the duplication is manual |
135 | Reset the merged_line tag. |
136 | """ |
137 | + if context is None: |
138 | + context = {} |
139 | if default is None: |
140 | default = {} |
141 | default.update({'move_lines': False, |
142 | @@ -1924,11 +1953,12 @@ |
143 | }) |
144 | # Manual duplication should generate a "manual document not created through the supply workflow" |
145 | # so we don't keep the link to PO/FO at line level |
146 | - if context.get('from_button', False): |
147 | + if context.get('from_button') and not context.get('from_split'): |
148 | default.update({ |
149 | 'order_line_id': False, |
150 | 'sale_order_line_id': False, |
151 | 'sale_order_lines': False, |
152 | + 'purchase_order_line_ids': [], |
153 | }) |
154 | return super(account_invoice_line, self).copy_data(cr, uid, inv_id, default, context) |
155 | |
156 | |
157 | === modified file 'bin/addons/finance/__openerp__.py' |
158 | --- bin/addons/finance/__openerp__.py 2019-10-10 15:06:49 +0000 |
159 | +++ bin/addons/finance/__openerp__.py 2021-02-01 16:08:13 +0000 |
160 | @@ -39,6 +39,7 @@ |
161 | 'account_analytic_line_view.xml', |
162 | 'account_sequence.xml', |
163 | 'wizard/account_report_partner_balance_tree_view.xml', # uf-1715 |
164 | + 'wizard/fo_follow_up_finance_wizard_view.xml', |
165 | 'cash_request_data.xml', |
166 | 'cash_request_view.xml', |
167 | ], |
168 | |
169 | === modified file 'bin/addons/finance/invoice.py' |
170 | --- bin/addons/finance/invoice.py 2017-10-20 09:43:54 +0000 |
171 | +++ bin/addons/finance/invoice.py 2021-02-01 16:08:13 +0000 |
172 | @@ -83,6 +83,8 @@ |
173 | _columns = { |
174 | 'order_line_id': fields.many2one('purchase.order.line', string="Purchase Order Line", readonly=True, |
175 | help="Purchase Order Line from which this invoice line has been generated (when coming from a purchase order)."), |
176 | + 'purchase_order_line_ids': fields.many2many('purchase.order.line', 'inv_line_po_line_rel', 'inv_line_id', 'po_line_id', |
177 | + string="Purchase Order Lines", help="Used in case of merged invoice lines"), |
178 | } |
179 | |
180 | account_invoice_line() |
181 | |
182 | === modified file 'bin/addons/finance/report/__init__.py' |
183 | --- bin/addons/finance/report/__init__.py 2017-12-08 14:20:22 +0000 |
184 | +++ bin/addons/finance/report/__init__.py 2021-02-01 16:08:13 +0000 |
185 | @@ -1,3 +1,4 @@ |
186 | import account_partner_balance_tree |
187 | import account_report_name |
188 | import cash_request_parser |
189 | +import fo_follow_up_finance |
190 | |
191 | === added file 'bin/addons/finance/report/fo_follow_up_finance.py' |
192 | --- bin/addons/finance/report/fo_follow_up_finance.py 1970-01-01 00:00:00 +0000 |
193 | +++ bin/addons/finance/report/fo_follow_up_finance.py 2021-02-01 16:08:13 +0000 |
194 | @@ -0,0 +1,197 @@ |
195 | +# -*- coding: utf-8 -*- |
196 | +############################################################################## |
197 | +# |
198 | +# OpenERP, Open Source Management Solution |
199 | +# Copyright (C) 2020 TeMPO Consulting, MSF. All Rights Reserved |
200 | +# |
201 | +# This program is free software: you can redistribute it and/or modify |
202 | +# it under the terms of the GNU Affero General Public License as |
203 | +# published by the Free Software Foundation, either version 3 of the |
204 | +# License, or (at your option) any later version. |
205 | +# |
206 | +# This program is distributed in the hope that it will be useful, |
207 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
208 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
209 | +# GNU Affero General Public License for more details. |
210 | +# |
211 | +# You should have received a copy of the GNU Affero General Public License |
212 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
213 | +# |
214 | +############################################################################## |
215 | + |
216 | +from report import report_sxw |
217 | +from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport |
218 | +from base import currency_date |
219 | +from datetime import datetime |
220 | + |
221 | + |
222 | +class fo_follow_up_finance(report_sxw.rml_parse): |
223 | + |
224 | + def __init__(self, cr, uid, name, context=None): |
225 | + super(fo_follow_up_finance, self).__init__(cr, uid, name, context=context) |
226 | + self.localcontext.update({ |
227 | + 'getLang': self._get_lang, |
228 | + 'getReportLines': self._get_report_lines, |
229 | + }) |
230 | + |
231 | + def _get_lang(self): |
232 | + return self.localcontext.get('lang', 'en_MF') |
233 | + |
234 | + def _get_line_fctal_amount(self, line_subtotal, booking_curr_id, doc_date, posting_date, key_state): |
235 | + """ |
236 | + Returns the line subtotal in functional currency based on the data in parameter. |
237 | + The state in param. must be the "key" such as "draft" and not the value such as "Draft" or "Brouillon". |
238 | + """ |
239 | + line_subtotal_fctal = 0.0 |
240 | + user_obj = self.pool.get('res.users') |
241 | + curr_obj = self.pool.get('res.currency') |
242 | + fctal_curr_id = user_obj.browse(self.cr, self.uid, self.uid, fields_to_fetch=['company_id']).company_id.currency_id.id |
243 | + today = datetime.today().strftime('%Y-%m-%d') |
244 | + if booking_curr_id and line_subtotal: |
245 | + if booking_curr_id == fctal_curr_id: |
246 | + line_subtotal_fctal = line_subtotal |
247 | + else: |
248 | + if key_state and key_state == 'draft': |
249 | + # for draft invoices use today's date |
250 | + curr_date = today |
251 | + else: |
252 | + curr_date = currency_date.get_date(self, self.cr, doc_date or today, posting_date or today) |
253 | + line_subtotal_fctal = curr_obj.compute(self.cr, self.uid, booking_curr_id, fctal_curr_id, line_subtotal, |
254 | + round=True, context={'currency_date': curr_date}) |
255 | + return line_subtotal_fctal |
256 | + |
257 | + def _process_report_lines(self, lines): |
258 | + """ |
259 | + Formats the raw data retrieved by the SQL request in _get_report_lines |
260 | + """ |
261 | + picking_obj = self.pool.get('stock.picking') |
262 | + shipment_obj = self.pool.get('shipment') |
263 | + processed = {} # store the transport files processed (perf) |
264 | + for l in lines: |
265 | + # e.g. extract 21/se_HQ1/HT101/PO00011 from se_HQ1C1.21/se_HQ1/HT101/PO00011 |
266 | + l['customer_reference'] = l['customer_reference'] and l['customer_reference'].split('.')[-1] or '' |
267 | + key_si_state = l['si_state'] |
268 | + l['si_line_subtotal_fctal'] = self._get_line_fctal_amount(l['si_line_subtotal'], l['si_currency_id'], |
269 | + l['si_doc_date'], l['si_posting_date'], key_si_state) |
270 | + l['si_state'] = key_si_state and self.getSelValue('account.invoice', 'state', key_si_state) or '' |
271 | + l['fo_status'] = l['fo_status'] and self.getSelValue('sale.order', 'state', l['fo_status']) or '' |
272 | + l['fo_line_status'] = l['fo_line_status'] and self.getSelValue('sale.order.line', 'state', l['fo_line_status']) or '' |
273 | + l['is_delivered'] = False |
274 | + if l['transport_file']: |
275 | + if ':' in l['transport_file']: |
276 | + # e.g. extract "SHIP/00004-01" from "se_HQ1C1.21/se_HQ1/HT101/PO00011 : SHIP/00004-01" |
277 | + l['transport_file'] = l['transport_file'].split(':')[-1].strip() |
278 | + if l['transport_file'] in processed: |
279 | + l['is_delivered'] = processed[l['transport_file']] |
280 | + else: |
281 | + if l['pick_id'] and picking_obj.browse(self.cr, self.uid, l['pick_id'], fields_to_fetch=['state']).state == 'delivered': |
282 | + l['is_delivered'] = True |
283 | + elif l.get('transport_file', '').startswith('SHIP') and \ |
284 | + shipment_obj.search_exist(self.cr, self.uid, [('name', '=', l['transport_file']), ('state', '=', 'delivered')]): |
285 | + l['is_delivered'] = True |
286 | + processed[l['transport_file']] = l['is_delivered'] |
287 | + key_out_inv_state = l['out_inv_state'] |
288 | + l['out_inv_line_subtotal_fctal'] = self._get_line_fctal_amount(l['out_inv_line_subtotal'], l['out_inv_currency_id'], |
289 | + l['out_inv_doc_date'], l['out_inv_posting_date'], key_out_inv_state) |
290 | + l['out_inv_state'] = key_out_inv_state and self.getSelValue('account.invoice', 'state', key_out_inv_state) or '' |
291 | + return lines |
292 | + |
293 | + def _get_report_lines(self, report): |
294 | + """ |
295 | + Returns all report lines as a list of dict |
296 | + """ |
297 | + lines = [] |
298 | + if report.order_ids: |
299 | + bg_obj = self.pool.get('memory.background.report') |
300 | + bg_id = self.localcontext.get('background_id') |
301 | + # first: retrieve raw data |
302 | + sql_req = """ |
303 | + select |
304 | + so.name AS fo_number, cust.name as customer_name, coalesce(so.client_order_ref, '') as customer_reference, |
305 | + coalesce(po.name, '') as po_number, coalesce(sup.name, '') as supplier_name, in_iv.id as si, |
306 | + coalesce(in_iv.number, '') as si_number, coalesce(cast(in_ivl.line_number as varchar), '') as si_line_number, |
307 | + coalesce(in_ivl.name, '') as si_line_description, coalesce(in_ivl.price_unit, 0) as si_line_unit_price, |
308 | + coalesce(in_ivl.quantity, 0) as si_line_quantity, coalesce(in_ivl_acc.code, '') as si_line_account_code, |
309 | + coalesce(in_ivl.price_subtotal, 0) as si_line_subtotal, coalesce(in_iv_curr.name, '') as si_currency, |
310 | + in_iv_curr.id as si_currency_id, in_iv.document_date as si_doc_date, in_iv.date_invoice as si_posting_date, |
311 | + coalesce(in_iv.state, '') as si_state, |
312 | + CASE WHEN (in_aml.corrected or in_aml.last_cor_was_only_analytic) = TRUE THEN 'X' ELSE '' END AS reverse_aji_si, |
313 | + so.state as fo_status, sol.state as fo_line_status, sol.line_number as fo_line_number, |
314 | + coalesce(prod.default_code, '') as product_code, coalesce(prod_t.name, '') as product_description, |
315 | + coalesce(sol.product_uom_qty, 0) as qty_ordered, prod_u.name as uom_ordered, |
316 | + coalesce((select sum(product_qty) from |
317 | + stock_move m1, stock_picking p1 |
318 | + where |
319 | + p1.id = m1.picking_id and |
320 | + m1.state = 'done' and |
321 | + p1.type = 'out' and |
322 | + (p1.subtype='standard' or |
323 | + p1.subtype='picking' and p1.dpo_out='t' or |
324 | + p1.subtype='packing' and m1.pick_shipment_id is not null and m1.not_shipped='f') and |
325 | + m1.sale_line_id = sol.id |
326 | + group by m1.sale_line_id), 0) as qty_delivered, |
327 | + CASE WHEN coalesce(out_picking.name, out_iv.name) IS NOT NULL |
328 | + THEN coalesce(out_picking.name, out_iv.name) ELSE '' END AS transport_file, |
329 | + coalesce(out_picking.id, 0) as pick_id, |
330 | + out_iv.id as out_inv, coalesce(out_iv.number, '') as out_inv_number, |
331 | + coalesce(cast(out_ivl.line_number as varchar), '') as out_inv_line_number, |
332 | + coalesce(out_ivl.name, '') as out_inv_line_description, coalesce(out_ivl.price_unit, 0) as out_inv_line_unit_price, |
333 | + coalesce(out_ivl.quantity, 0) as out_inv_line_quantity, coalesce(out_ivl_acc.code, '') as out_inv_line_account_code, |
334 | + coalesce(out_ivl.price_subtotal, 0) as out_inv_line_subtotal, coalesce(out_iv_curr.name, '') as out_inv_currency, |
335 | + out_iv_curr.id as out_inv_currency_id, out_iv.document_date as out_inv_doc_date, |
336 | + out_iv.date_invoice as out_inv_posting_date, |
337 | + coalesce(out_iv.state, '') as out_inv_state, |
338 | + CASE WHEN (out_aml.corrected or out_aml.last_cor_was_only_analytic) = TRUE THEN 'X' ELSE '' END AS reverse_aji_out_inv |
339 | + from sale_order_line sol |
340 | + inner join sale_order so on so.id = sol.order_id |
341 | + left join purchase_order_line pol on pol.linked_sol_id = sol.id |
342 | + left join purchase_order po on po.id = pol.order_id |
343 | + -- avoid duplicates due to merge lines and/or refunds |
344 | + left join ( |
345 | + select in_ivl_tmp.*, coalesce(in_ivl_tmp.order_line_id, invl_pol_rel.po_line_id) as pol_id |
346 | + from account_invoice_line in_ivl_tmp |
347 | + inner join account_invoice in_iv_tmp on in_iv_tmp.id = in_ivl_tmp.invoice_id |
348 | + left join inv_line_po_line_rel invl_pol_rel on invl_pol_rel.inv_line_id = in_ivl_tmp.id |
349 | + where |
350 | + (invl_pol_rel.inv_line_id is NULL or invl_pol_rel.inv_line_id = in_ivl_tmp.id and in_ivl_tmp.order_line_id is null) |
351 | + and in_iv_tmp.refunded_invoice_id is NULL |
352 | + -- main_purchase_id is used to retrieve invoices generated via DPO before they had the tag from_supply |
353 | + and (coalesce(in_iv_tmp.from_supply, 't')='t' or in_iv_tmp.main_purchase_id is not null) |
354 | + ) as in_ivl ON in_ivl.pol_id = pol.id |
355 | + left join account_invoice in_iv on in_iv.id = in_ivl.invoice_id |
356 | + left join account_move in_am on in_am.id = in_iv.move_id |
357 | + left join account_move_line in_aml on in_aml.invoice_line_id = in_ivl.id and in_aml.move_id = in_am.id |
358 | + left join account_invoice_line out_ivl on out_ivl.sale_order_line_id = sol.id |
359 | + left join account_invoice out_iv on out_iv.id = out_ivl.invoice_id |
360 | + left join stock_picking out_picking on out_picking.id = out_iv.picking_id |
361 | + left join account_move out_am on out_am.id = out_iv.move_id |
362 | + left join account_move_line out_aml on out_aml.invoice_line_id = out_ivl.id and out_aml.move_id = out_am.id |
363 | + left join res_partner cust on cust.id = so.partner_id |
364 | + left join res_partner sup on sup.id = po.partner_id |
365 | + left join account_account in_ivl_acc on in_ivl_acc.id = in_ivl.account_id |
366 | + left join account_account out_ivl_acc on out_ivl_acc.id = out_ivl.account_id |
367 | + left join res_currency in_iv_curr on in_iv_curr.id = in_iv.currency_id |
368 | + left join res_currency out_iv_curr on out_iv_curr.id = out_iv.currency_id |
369 | + left join product_product prod on prod.id = sol.product_id |
370 | + left join product_template prod_t on prod_t.id = prod.product_tmpl_id |
371 | + left join product_uom prod_u on prod_u.id = sol.product_uom |
372 | + where |
373 | + out_iv.refunded_invoice_id is NULL and |
374 | + -- from_supply is used to exclude IVO/STV generated via refund before refunded_invoice_id was used |
375 | + coalesce(out_iv.from_supply, 't')='t' and |
376 | + sol.state not in ('cancel', 'cancel_r') and |
377 | + so.id in %s |
378 | + order by fo_number DESC, fo_line_number, si_number, si_line_number, out_inv_number, out_inv_line_number; |
379 | + """ |
380 | + self.cr.execute(sql_req, (tuple(report.order_ids),)) |
381 | + lines = self.cr.dictfetchall() |
382 | + if bg_id: |
383 | + bg_obj.update_percent(self.cr, self.uid, bg_id, 0.50) |
384 | + # second: process data if needed |
385 | + lines = self._process_report_lines(lines) |
386 | + return lines |
387 | + |
388 | + |
389 | +SpreadsheetReport('report.fo.follow.up.finance', 'fo.follow.up.finance.wizard', |
390 | + 'addons/finance/report/fo_follow_up_finance_xls.mako', parser=fo_follow_up_finance) |
391 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
392 | |
393 | === added file 'bin/addons/finance/report/fo_follow_up_finance_xls.mako' |
394 | --- bin/addons/finance/report/fo_follow_up_finance_xls.mako 1970-01-01 00:00:00 +0000 |
395 | +++ bin/addons/finance/report/fo_follow_up_finance_xls.mako 2021-02-01 16:08:13 +0000 |
396 | @@ -0,0 +1,565 @@ |
397 | +<?xml version="1.0"?> |
398 | +<?mso-application progid="Excel.Sheet"?> |
399 | +<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" |
400 | + xmlns:o="urn:schemas-microsoft-com:office:office" |
401 | + xmlns:x="urn:schemas-microsoft-com:office:excel" |
402 | + xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" |
403 | + xmlns:html="http://www.w3.org/TR/REC-html40"> |
404 | + <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> |
405 | + <Author>Unifield</Author> |
406 | + <LastAuthor>MSFUser</LastAuthor> |
407 | + <Company>Medecins Sans Frontieres</Company> |
408 | + </DocumentProperties> |
409 | + <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> |
410 | + <WindowHeight>11640</WindowHeight> |
411 | + <WindowWidth>15480</WindowWidth> |
412 | + <WindowTopX>120</WindowTopX> |
413 | + <WindowTopY>75</WindowTopY> |
414 | + <ProtectStructure>False</ProtectStructure> |
415 | + <ProtectWindows>False</ProtectWindows> |
416 | + </ExcelWorkbook> |
417 | + <Styles> |
418 | + <Style ss:ID="ssCell"> |
419 | + <Alignment ss:Vertical="Top" ss:WrapText="1"/> |
420 | + <Font ss:Bold="1" /> |
421 | + </Style> |
422 | + <Style ss:ID="ssCellBlue"> |
423 | + <Alignment ss:Vertical="Top" ss:WrapText="1"/> |
424 | + <Font ss:Color="#0000FF" /> |
425 | + </Style> |
426 | + |
427 | + <!-- File header --> |
428 | + <Style ss:ID="big_header"> |
429 | + <Font x:Family="Swiss" ss:Size="14" ss:Bold="1"/> |
430 | + </Style> |
431 | + <Style ss:ID="file_header"> |
432 | + <Font ss:Size="9" /> |
433 | + <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/> |
434 | + </Style> |
435 | + |
436 | + <!-- Line big header without background color --> |
437 | + <Style ss:ID="line_big_header"> |
438 | + <Alignment ss:Vertical="Center" ss:Horizontal="Center" ss:WrapText="1"/> |
439 | + <Borders> |
440 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
441 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
442 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
443 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
444 | + </Borders> |
445 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#FF0000" ss:Bold="1"/> |
446 | + <Interior/> |
447 | + </Style> |
448 | + |
449 | + <!-- Line big header with background color --> |
450 | + <Style ss:ID="line_big_header_with_bg"> |
451 | + <Alignment ss:Vertical="Center" ss:Horizontal="Center" ss:WrapText="1"/> |
452 | + <Borders> |
453 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
454 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
455 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
456 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
457 | + </Borders> |
458 | + <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#FF0000" ss:Bold="1"/> |
459 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
460 | + </Style> |
461 | + |
462 | + <!-- Line header without background color --> |
463 | + <Style ss:ID="line_header"> |
464 | + <Alignment ss:Vertical="Center" ss:Horizontal="Center" ss:WrapText="1"/> |
465 | + <Borders> |
466 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
467 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
468 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
469 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
470 | + </Borders> |
471 | + <Font x:Family="Swiss" ss:Size="7" ss:Bold="1"/> |
472 | + <Interior/> |
473 | + </Style> |
474 | + |
475 | + <!-- Line header with background color --> |
476 | + <Style ss:ID="line_header_with_bg"> |
477 | + <Alignment ss:Vertical="Center" ss:Horizontal="Center" ss:WrapText="1"/> |
478 | + <Borders> |
479 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
480 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
481 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
482 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
483 | + </Borders> |
484 | + <Font x:Family="Swiss" ss:Size="7" ss:Bold="1"/> |
485 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
486 | + </Style> |
487 | + |
488 | + <!-- Lines --> |
489 | + <Style ss:ID="line_left"> |
490 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
491 | + <Borders> |
492 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
493 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
494 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
495 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
496 | + </Borders> |
497 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
498 | + </Style> |
499 | + <Style ss:ID="line_left_with_bg"> |
500 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
501 | + <Borders> |
502 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
503 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
504 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
505 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
506 | + </Borders> |
507 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
508 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
509 | + </Style> |
510 | + <Style ss:ID="line_left_green_with_bg"> |
511 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
512 | + <Borders> |
513 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
514 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
515 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
516 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
517 | + </Borders> |
518 | + <Font ss:Size="8" ss:Color="#1A721A"/> |
519 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
520 | + </Style> |
521 | + <Style ss:ID="line_right"> |
522 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
523 | + <Borders> |
524 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
525 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
526 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
527 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
528 | + </Borders> |
529 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
530 | + <NumberFormat ss:Format="#,##0.00"/> |
531 | + </Style> |
532 | + <Style ss:ID="line_right_with_bg"> |
533 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
534 | + <Borders> |
535 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
536 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
537 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
538 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
539 | + </Borders> |
540 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
541 | + <NumberFormat ss:Format="#,##0.00"/> |
542 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
543 | + </Style> |
544 | + <Style ss:ID="line_center"> |
545 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
546 | + <Borders> |
547 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
548 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
549 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
550 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
551 | + </Borders> |
552 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
553 | + <NumberFormat ss:Format="#,##0.00"/> |
554 | + </Style> |
555 | + <Style ss:ID="line_center_with_bg"> |
556 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
557 | + <Borders> |
558 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
559 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
560 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
561 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
562 | + </Borders> |
563 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
564 | + <NumberFormat ss:Format="#,##0.00"/> |
565 | + <Interior ss:Color="#ffcc99" ss:Pattern="Solid"/> |
566 | + </Style> |
567 | + <Style ss:ID="line_left_date"> |
568 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
569 | + <NumberFormat ss:Format="[ENG][$-409]d\-mmm\-yyyy;@" /> |
570 | + <Borders> |
571 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
572 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
573 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
574 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
575 | + </Borders> |
576 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
577 | + </Style> |
578 | + <Style ss:ID="line_left_date_fr"> |
579 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
580 | + <NumberFormat ss:Format="Short Date" /> |
581 | + <Borders> |
582 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
583 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
584 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
585 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
586 | + </Borders> |
587 | + <Font ss:Size="8" ss:Color="#0000FF"/> |
588 | + </Style> |
589 | + |
590 | + <Style ss:ID="short_date"> |
591 | + <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1" /> |
592 | + <NumberFormat ss:Format="[ENG][$-409]d\-mmm\-yyyy;@" /> |
593 | + <Font ss:Size="8" ss:Color="#0000FF" /> |
594 | + </Style> |
595 | + <Style ss:ID="short_date_fr"> |
596 | + <Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1" /> |
597 | + <NumberFormat ss:Format="Short Date" /> |
598 | + <Font ss:Size="8" ss:Color="#0000FF" /> |
599 | + </Style> |
600 | + |
601 | + <Style ss:ID="line_left_grey"> |
602 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
603 | + <Borders> |
604 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
605 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
606 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
607 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
608 | + </Borders> |
609 | + <Font ss:Size="8" ss:Color="#747474"/> |
610 | + </Style> |
611 | + <Style ss:ID="line_right_grey"> |
612 | + <Alignment ss:Horizontal="Right" ss:Vertical="Bottom"/> |
613 | + <Borders> |
614 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
615 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
616 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
617 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
618 | + </Borders> |
619 | + <Font ss:Size="8" ss:Color="#747474"/> |
620 | + <NumberFormat ss:Format="#,##0.00"/> |
621 | + </Style> |
622 | + <Style ss:ID="line_center_grey"> |
623 | + <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> |
624 | + <Borders> |
625 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
626 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
627 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
628 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
629 | + </Borders> |
630 | + <Font ss:Size="8" ss:Color="#747474"/> |
631 | + <NumberFormat ss:Format="#,##0.00"/> |
632 | + </Style> |
633 | + <Style ss:ID="line_left_date_grey"> |
634 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
635 | + <NumberFormat ss:Format="[ENG][$-409]d\-mmm\-yyyy;@" /> |
636 | + <Borders> |
637 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
638 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
639 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
640 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
641 | + </Borders> |
642 | + <Font ss:Size="8" ss:Color="#747474"/> |
643 | + </Style> |
644 | + <Style ss:ID="line_left_date_grey_fr"> |
645 | + <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> |
646 | + <NumberFormat ss:Format="Short Date" /> |
647 | + <Borders> |
648 | + <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> |
649 | + <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> |
650 | + <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> |
651 | + <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> |
652 | + </Borders> |
653 | + <Font ss:Size="8" ss:Color="#747474"/> |
654 | + </Style> |
655 | +</Styles> |
656 | + |
657 | +<ss:Worksheet ss:Name="${_('FO Follow Up')|x}"> |
658 | +% for o in objects: |
659 | + <Table x:FullColumns="1" x:FullRows="1"> |
660 | + |
661 | + ## FO number |
662 | + <Column ss:AutoFitWidth="1" ss:Width="170.0" /> |
663 | + ## Customer name |
664 | + <Column ss:AutoFitWidth="1" ss:Width="170.0" /> |
665 | + ## Customer ref |
666 | + <Column ss:AutoFitWidth="1" ss:Width="170.0" /> |
667 | + ## PO number |
668 | + <Column ss:AutoFitWidth="1" ss:Width="170.0" /> |
669 | + ## Supplier name |
670 | + <Column ss:AutoFitWidth="1" ss:Width="170.0" /> |
671 | + ## Supplier invoice number |
672 | + <Column ss:AutoFitWidth="1" ss:Width="150.0" /> |
673 | + ## SI line number |
674 | + <Column ss:AutoFitWidth="1" ss:Width="45.00" /> |
675 | + ## SI line description |
676 | + <Column ss:AutoFitWidth="1" ss:Width="300.00" /> |
677 | + ## SI line unit price |
678 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
679 | + ## SI line quantity |
680 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
681 | + ## SI line expense account code |
682 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
683 | + ## SI line sub total |
684 | + <Column ss:AutoFitWidth="1" ss:Width="98.25" /> |
685 | + ## SI currency |
686 | + <Column ss:AutoFitWidth="1" ss:Width="54.75" /> |
687 | + ## SI line sub total functional currency |
688 | + <Column ss:AutoFitWidth="1" ss:Width="98.25" /> |
689 | + ## SI status |
690 | + <Column ss:AutoFitWidth="1" ss:Width="60.75" /> |
691 | + ## Reverse corresponding AJI? (SI) |
692 | + <Column ss:AutoFitWidth="1" ss:Width="70.00" /> |
693 | + ## FO status |
694 | + <Column ss:AutoFitWidth="1" ss:Width="60.75" /> |
695 | + ## FO line status |
696 | + <Column ss:AutoFitWidth="1" ss:Width="60.75" /> |
697 | + ## FO line number |
698 | + <Column ss:AutoFitWidth="1" ss:Width="40.00" /> |
699 | + ## Product code |
700 | + <Column ss:AutoFitWidth="1" ss:Width="107.25" /> |
701 | + ## Product description |
702 | + <Column ss:AutoFitWidth="1" ss:Width="239.25" /> |
703 | + ## Qty ordered |
704 | + <Column ss:AutoFitWidth="1" ss:Width="54.75" /> |
705 | + ## UoM ordered |
706 | + <Column ss:AutoFitWidth="1" ss:Width="54.75" /> |
707 | + ## Qty delivered |
708 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
709 | + ## Transport file |
710 | + <Column ss:AutoFitWidth="1" ss:Width="130.0" /> |
711 | + ## STV/IVO number |
712 | + <Column ss:AutoFitWidth="1" ss:Width="150.0" /> |
713 | + ## STV/IVO line number |
714 | + <Column ss:AutoFitWidth="1" ss:Width="40.00" /> |
715 | + ## STV/IVO line description |
716 | + <Column ss:AutoFitWidth="1" ss:Width="300.00" /> |
717 | + ## STV/IVO line unit price |
718 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
719 | + ## STV/IVO line quantity |
720 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
721 | + ## STV/IVO line expense account code |
722 | + <Column ss:AutoFitWidth="1" ss:Width="68.25" /> |
723 | + ## STV/IVO line sub total |
724 | + <Column ss:AutoFitWidth="1" ss:Width="98.25" /> |
725 | + ## STV/IVO currency |
726 | + <Column ss:AutoFitWidth="1" ss:Width="54.75" /> |
727 | + ## STV/IVO line sub total functional currency |
728 | + <Column ss:AutoFitWidth="1" ss:Width="98.25" /> |
729 | + ## STV/IVO status |
730 | + <Column ss:AutoFitWidth="1" ss:Width="60.75" /> |
731 | + ## Reverse corresponding AJI? (STV/IVO) |
732 | + <Column ss:AutoFitWidth="1" ss:Width="70.00" /> |
733 | + |
734 | + <Row ss:Height="18"> |
735 | + <Cell ss:StyleID="big_header"><Data ss:Type="String">${_('FIELD ORDER FOLLOW-UP FINANCE')|x}</Data><NamedCell ss:Name="Print_Area"/></Cell> |
736 | + </Row> |
737 | + |
738 | + <Row ss:Height="10"></Row> |
739 | + |
740 | + ## WORKSHEET HEADER |
741 | + <Row> |
742 | + <Cell ss:StyleID="file_header" ss:MergeAcross="1"><Data ss:Type="String">${_('Instance information')|x}</Data></Cell> |
743 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
744 | + <Cell ss:StyleID="file_header" ss:MergeAcross="3"><Data ss:Type="String">${_('Request parameters')|x}</Data></Cell> |
745 | + </Row> |
746 | + <Row> |
747 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Name:')|x}</Data></Cell> |
748 | + <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${o.company_id.instance_id.instance or '-'|x}</Data></Cell> |
749 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
750 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Partners:')|x}</Data></Cell> |
751 | + <Cell ss:StyleID="ssCellBlue" ss:MergeAcross="2"><Data ss:Type="String">${', '.join([p.name for p in o.partner_ids]) or '-'|x}</Data></Cell> |
752 | + </Row> |
753 | + <Row> |
754 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Address:')|x}</Data></Cell> |
755 | + <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${o.company_id.partner_id.name or '-'|x}</Data></Cell> |
756 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
757 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Date start:')|x}</Data></Cell> |
758 | + % if isDate(o.start_date): |
759 | + % if getLang() == 'fr_MF': |
760 | + <Cell ss:StyleID="short_date_fr" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.start_date|n}T00:00:00.000</Data></Cell> |
761 | + % else: |
762 | + <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.start_date|n}T00:00:00.000</Data></Cell> |
763 | + % endif |
764 | + % else: |
765 | + <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> |
766 | + % endif |
767 | + </Row> |
768 | + <Row> |
769 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
770 | + <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${o.company_id.partner_id.address[0].street or ''|x}</Data></Cell> |
771 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
772 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Date end:')|x}</Data></Cell> |
773 | + % if isDate(o.end_date): |
774 | + % if getLang() == 'fr_MF': |
775 | + <Cell ss:StyleID="short_date_fr" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.end_date|n}T00:00:00.000</Data></Cell> |
776 | + % else: |
777 | + <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.end_date|n}T00:00:00.000</Data></Cell> |
778 | + % endif |
779 | + % else: |
780 | + <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> |
781 | + % endif |
782 | + </Row> |
783 | + <Row> |
784 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
785 | + <Cell ss:StyleID="ssCellBlue"><Data ss:Type="String">${o.company_id.partner_id.address[0].zip|x} ${o.company_id.partner_id.address[0].city|x}</Data></Cell> |
786 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String"></Data></Cell> |
787 | + <Cell ss:StyleID="ssCell"><Data ss:Type="String">${_('Date of the request:')|x}</Data></Cell> |
788 | + % if o.report_date and isDateTime(o.report_date): |
789 | + % if getLang() == 'fr_MF': |
790 | + <Cell ss:StyleID="short_date_fr" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.report_date[0:10]|n}T${o.report_date[11:19]|n}.000</Data></Cell> |
791 | + % else: |
792 | + <Cell ss:StyleID="short_date" ss:MergeAcross="2"><Data ss:Type="DateTime">${o.report_date[0:10]|n}T${o.report_date[11:19]|n}.000</Data></Cell> |
793 | + % endif |
794 | + % else: |
795 | + <Cell ss:StyleID="ssCell" ss:MergeAcross="2"><Data ss:Type="String"></Data></Cell> |
796 | + % endif |
797 | + </Row> |
798 | + |
799 | + <Row></Row> |
800 | + |
801 | + <% is_intermission = context and context.get('is_intermission') %> |
802 | + <Row> |
803 | + <Cell ss:StyleID="line_big_header" ss:MergeAcross="2"><Data ss:Type="String">${_('ORDER INFORMATION')|x}</Data></Cell> |
804 | + <Cell ss:StyleID="line_big_header_with_bg" ss:MergeAcross="12"><Data ss:Type="String">${_('DETAILS SUPPLIER INVOICES')|x}</Data></Cell> |
805 | + <Cell ss:StyleID="line_big_header" ss:MergeAcross="7"><Data ss:Type="String">${_('DETAILS FIELD ORDERS')|x}</Data></Cell> |
806 | + <Cell ss:StyleID="line_big_header_with_bg" ss:MergeAcross="11"><Data ss:Type="String">${is_intermission and _('DETAILS INTERMISSION VOUCHERS OUT') or _('DETAILS STOCK TRANSFER VOUCHERS')|x}</Data></Cell> |
807 | + </Row> |
808 | + |
809 | + <% |
810 | + header_list = [ |
811 | + ('no_bg', _('FO number')), |
812 | + ('no_bg', _('Customer name')), |
813 | + ('no_bg', _('Customer ref')), |
814 | + ('bg', _('PO number')), |
815 | + ('bg', _('Supplier name')), |
816 | + ('bg', _('Supplier invoice number')), |
817 | + ('bg', _('SI line number')), |
818 | + ('bg', _('SI line description')), |
819 | + ('bg', _('SI line unit price')), |
820 | + ('bg', _('SI line quantity')), |
821 | + ('bg', _('SI line expense account code')), |
822 | + ('bg', _('SI line sub total')), |
823 | + ('bg', _('SI currency')), |
824 | + ('bg', _('SI line sub total functional currency')), |
825 | + ('bg', _('SI status')), |
826 | + ('bg', _('Reverse corresponding AJI? (SI)')), |
827 | + ('no_bg', _('FO status')), |
828 | + ('no_bg', _('FO line status')), |
829 | + ('no_bg', _('FO line number')), |
830 | + ('no_bg', _('Product code')), |
831 | + ('no_bg', _('Product description')), |
832 | + ('no_bg', _('Qty ordered')), |
833 | + ('no_bg', _('UoM ordered')), |
834 | + ('no_bg', _('Qty delivered')), |
835 | + ('bg', _('Transport file')), |
836 | + ('bg', is_intermission and _('IVO number') or _('STV number')), |
837 | + ('bg', is_intermission and _('IVO line number') or _('STV line number')), |
838 | + ('bg', is_intermission and _('IVO line description') or _('STV line description')), |
839 | + ('bg', is_intermission and _('IVO line unit price') or _('STV line unit price')), |
840 | + ('bg', is_intermission and _('IVO line quantity') or _('STV line quantity')), |
841 | + ('bg', is_intermission and _('IVO line expense account code') or _('STV line expense account code')), |
842 | + ('bg', is_intermission and _('IVO line sub total') or _('STV line sub total')), |
843 | + ('bg', is_intermission and _('IVO currency') or _('STV currency')), |
844 | + ('bg', is_intermission and _('IVO line sub total functional currency') or _('STV line sub total functional currency')), |
845 | + ('bg', is_intermission and _('IVO status') or _('STV status')), |
846 | + ('bg', is_intermission and _('Reverse corresponding AJI? (IVO)') or _('Reverse corresponding AJI? (STV)')), |
847 | + ] |
848 | + %> |
849 | + <Row> |
850 | + % for h in header_list: |
851 | + % if h[0] == 'bg': |
852 | + <Cell ss:StyleID="line_header_with_bg"> |
853 | + % else: |
854 | + <Cell ss:StyleID="line_header"> |
855 | + % endif |
856 | + <Data ss:Type="String">${h[1]|x}</Data></Cell> |
857 | + % endfor |
858 | + </Row> |
859 | + |
860 | + % for line in getReportLines(o): |
861 | + <Row ss:Height="11.25"> |
862 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['fo_number']|x}</Data></Cell> |
863 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['customer_name']|x}</Data></Cell> |
864 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['customer_reference']|x}</Data></Cell> |
865 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['po_number']|x}</Data></Cell> |
866 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['supplier_name']|x}</Data></Cell> |
867 | + % if line['si']: |
868 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_number']|x}</Data></Cell> |
869 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_line_number']|x}</Data></Cell> |
870 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_line_description']|x}</Data></Cell> |
871 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['si_line_unit_price']|x}</Data></Cell> |
872 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['si_line_quantity']|x}</Data></Cell> |
873 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_line_account_code']|x}</Data></Cell> |
874 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['si_line_subtotal']|x}</Data></Cell> |
875 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_currency']|x}</Data></Cell> |
876 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['si_line_subtotal_fctal']|x}</Data></Cell> |
877 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['si_state']|x}</Data></Cell> |
878 | + <Cell ss:StyleID="line_center_with_bg"><Data ss:Type="String">${line['reverse_aji_si']|x}</Data></Cell> |
879 | + % else: |
880 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
881 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
882 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
883 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
884 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
885 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
886 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
887 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
888 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
889 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
890 | + <Cell ss:StyleID="line_center_with_bg"><Data ss:Type="String"></Data></Cell> |
891 | + % endif |
892 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['fo_status']|x}</Data></Cell> |
893 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['fo_line_status']|x}</Data></Cell> |
894 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['fo_line_number']|x}</Data></Cell> |
895 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['product_code']|x}</Data></Cell> |
896 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['product_description']|x}</Data></Cell> |
897 | + <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line['qty_ordered']|x}</Data></Cell> |
898 | + <Cell ss:StyleID="line_left"><Data ss:Type="String">${line['uom_ordered']|x}</Data></Cell> |
899 | + <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line['qty_delivered']|x}</Data></Cell> |
900 | + % if line['is_delivered']: |
901 | + <Cell ss:StyleID="line_left_green_with_bg"><Data ss:Type="String">${line['transport_file']|x}</Data></Cell> |
902 | + % else: |
903 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['transport_file']|x}</Data></Cell> |
904 | + % endif |
905 | + % if line['out_inv']: |
906 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_number']|x}</Data></Cell> |
907 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_line_number']|x}</Data></Cell> |
908 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_line_description']|x}</Data></Cell> |
909 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['out_inv_line_unit_price']|x}</Data></Cell> |
910 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['out_inv_line_quantity']|x}</Data></Cell> |
911 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_line_account_code']|x}</Data></Cell> |
912 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['out_inv_line_subtotal']|x}</Data></Cell> |
913 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_currency']|x}</Data></Cell> |
914 | + <Cell ss:StyleID="line_right_with_bg"><Data ss:Type="Number">${line['out_inv_line_subtotal_fctal']|x}</Data></Cell> |
915 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String">${line['out_inv_state']|x}</Data></Cell> |
916 | + <Cell ss:StyleID="line_center_with_bg"><Data ss:Type="String">${line['reverse_aji_out_inv']|x}</Data></Cell> |
917 | + % else: |
918 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
919 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
920 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
921 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
922 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
923 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
924 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
925 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
926 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
927 | + <Cell ss:StyleID="line_left_with_bg"><Data ss:Type="String"></Data></Cell> |
928 | + <Cell ss:StyleID="line_center_with_bg"><Data ss:Type="String"></Data></Cell> |
929 | + % endif |
930 | + </Row> |
931 | + % endfor |
932 | + |
933 | + </Table> |
934 | +% endfor |
935 | + |
936 | +<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> |
937 | + <PageSetup> |
938 | + <Layout x:Orientation="Landscape"/> |
939 | + <Footer x:Data="Page &P of &N"/> |
940 | + </PageSetup> |
941 | + <Selected/> |
942 | + <FreezePanes/> |
943 | + <FrozenNoSplit/> |
944 | + <SplitHorizontal>10</SplitHorizontal> |
945 | + <TopRowBottomPane>10</TopRowBottomPane> |
946 | + <SplitVertical>1</SplitVertical> |
947 | + <LeftColumnRightPane>1</LeftColumnRightPane> |
948 | + <ActivePane>0</ActivePane> |
949 | + <Panes> |
950 | + <Pane> |
951 | + <Number>3</Number> |
952 | + <ActiveRow>17</ActiveRow> |
953 | + </Pane> |
954 | + </Panes> |
955 | + <ProtectObjects>False</ProtectObjects> |
956 | + <ProtectScenarios>False</ProtectScenarios> |
957 | +</WorksheetOptions> |
958 | +<AutoFilter x:Range="R10C1:R10C36" xmlns="urn:schemas-microsoft-com:office:excel"> |
959 | +</AutoFilter> |
960 | +</ss:Worksheet> |
961 | +</Workbook> |
962 | |
963 | === modified file 'bin/addons/finance/wizard/__init__.py' |
964 | --- bin/addons/finance/wizard/__init__.py 2014-03-14 15:47:48 +0000 |
965 | +++ bin/addons/finance/wizard/__init__.py 2021-02-01 16:08:13 +0000 |
966 | @@ -1,1 +1,2 @@ |
967 | import account_report_partner_balance_tree # uf-1715 |
968 | +import fo_follow_up_finance_wizard |
969 | |
970 | === added file 'bin/addons/finance/wizard/fo_follow_up_finance_wizard.py' |
971 | --- bin/addons/finance/wizard/fo_follow_up_finance_wizard.py 1970-01-01 00:00:00 +0000 |
972 | +++ bin/addons/finance/wizard/fo_follow_up_finance_wizard.py 2021-02-01 16:08:13 +0000 |
973 | @@ -0,0 +1,122 @@ |
974 | +# -*- coding: utf-8 -*- |
975 | +############################################################################## |
976 | +# |
977 | +# OpenERP, Open Source Management Solution |
978 | +# Copyright (C) 2020 TeMPO Consulting, MSF |
979 | +# |
980 | +# This program is free software: you can redistribute it and/or modify |
981 | +# it under the terms of the GNU Affero General Public License as |
982 | +# published by the Free Software Foundation, either version 3 of the |
983 | +# License, or (at your option) any later version. |
984 | +# |
985 | +# This program is distributed in the hope that it will be useful, |
986 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
987 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
988 | +# GNU Affero General Public License for more details. |
989 | +# |
990 | +# You should have received a copy of the GNU Affero General Public License |
991 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
992 | +# |
993 | +############################################################################## |
994 | + |
995 | +from osv import osv |
996 | +from osv import fields |
997 | +from tools.translate import _ |
998 | + |
999 | +import time |
1000 | + |
1001 | + |
1002 | +class fo_follow_up_finance_wizard(osv.osv_memory): |
1003 | + _name = 'fo.follow.up.finance.wizard' |
1004 | + _rec_name = 'report_date' |
1005 | + _order = 'report_date desc' |
1006 | + |
1007 | + _columns = { |
1008 | + 'start_date': fields.date(string='Start date'), |
1009 | + 'end_date': fields.date(string='End date'), |
1010 | + 'partner_ids': fields.many2many('res.partner', 'fo_follow_up_wizard_partner_rel', 'wizard_id', 'partner_id', 'Partners'), |
1011 | + 'order_id': fields.many2one('sale.order', string='Order Ref.'), |
1012 | + 'order_ids': fields.text(string='Orders', readonly=True), # don't use many2many to avoid memory usage issue |
1013 | + 'report_date': fields.datetime(string='Date of the export', readonly=True), |
1014 | + 'company_id': fields.many2one('res.company', string='Company', readonly=True), |
1015 | + } |
1016 | + |
1017 | + _defaults = { |
1018 | + 'report_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
1019 | + 'company_id': lambda self, cr, uid, ids, c={}: self.pool.get('res.users').browse(cr, uid, uid).company_id.id, |
1020 | + } |
1021 | + |
1022 | + def get_values(self, cr, uid, ids, context=None): |
1023 | + """ |
1024 | + Retrieves the data according to the values in the wizard |
1025 | + """ |
1026 | + fo_obj = self.pool.get('sale.order') |
1027 | + if context is None: |
1028 | + context = {} |
1029 | + if isinstance(ids, (int, long)): |
1030 | + ids = [ids] |
1031 | + for wizard in self.browse(cr, uid, ids, context=context): |
1032 | + fo_ids = [] |
1033 | + if context.get('selected_inv_ids'): |
1034 | + sql_req = """ |
1035 | + SELECT DISTINCT(fo.id) |
1036 | + FROM sale_order fo |
1037 | + INNER JOIN sale_order_line fol ON fol.order_id = fo.id |
1038 | + INNER JOIN account_invoice_line inv_l ON inv_l.sale_order_line_id = fol.id |
1039 | + WHERE inv_l.invoice_id IN %s; |
1040 | + """ |
1041 | + cr.execute(sql_req, (tuple(context['selected_inv_ids']),)) |
1042 | + fo_ids = [x[0] for x in cr.fetchall()] |
1043 | + else: |
1044 | + fo_domain = [] |
1045 | + context_ivo = context.get('type', False) == 'out_invoice' and context.get('journal_type', False) == 'intermission' and \ |
1046 | + context.get('is_intermission', False) and context.get('intermission_type', False) == 'out' |
1047 | + context_stv = context.get('type', False) == 'out_invoice' and context.get('journal_type', False) == 'sale' and \ |
1048 | + not context.get('is_debit_note', False) |
1049 | + if context_ivo: |
1050 | + fo_domain.append(('partner_type', '=', 'intermission')) |
1051 | + elif context_stv: |
1052 | + fo_domain.append(('partner_type', '=', 'section')) |
1053 | + if wizard.start_date: |
1054 | + fo_domain.append(('date_order', '>=', wizard.start_date)) |
1055 | + if wizard.end_date: |
1056 | + fo_domain.append(('date_order', '<=', wizard.end_date)) |
1057 | + if wizard.partner_ids: |
1058 | + fo_domain.append(('partner_id', 'in', [p.id for p in wizard.partner_ids])) |
1059 | + if wizard.order_id: |
1060 | + fo_domain.append(('id', '=', wizard.order_id.id)) |
1061 | + fo_ids = fo_obj.search(cr, uid, fo_domain, context=context) |
1062 | + if not fo_ids: |
1063 | + raise osv.except_osv( |
1064 | + _('Error'), |
1065 | + _('No field orders found.'), |
1066 | + ) |
1067 | + self.pool.get('sale.followup.multi.wizard')._check_max_line_number(cr, fo_ids) |
1068 | + self.write(cr, uid, [wizard.id], {'order_ids': fo_ids}, context=context) |
1069 | + return True |
1070 | + |
1071 | + def print_excel(self, cr, uid, ids, context=None): |
1072 | + """ |
1073 | + Prints the report in Excel format. |
1074 | + """ |
1075 | + if context is None: |
1076 | + context = {} |
1077 | + if isinstance(ids, (int, long)): |
1078 | + ids = [ids] |
1079 | + self.get_values(cr, uid, ids, context=context) |
1080 | + background_id = self.pool.get('memory.background.report').create(cr, uid, { |
1081 | + 'file_name': 'FO Follow-up Finance', |
1082 | + 'report_name': 'fo.follow.up.finance', |
1083 | + }, context=context) |
1084 | + context['background_id'] = background_id |
1085 | + context['background_time'] = 3 |
1086 | + data = {'ids': ids, 'context': context} |
1087 | + return { |
1088 | + 'type': 'ir.actions.report.xml', |
1089 | + 'report_name': 'fo.follow.up.finance', |
1090 | + 'datas': data, |
1091 | + 'context': context, |
1092 | + } |
1093 | + |
1094 | + |
1095 | +fo_follow_up_finance_wizard() |
1096 | |
1097 | === added file 'bin/addons/finance/wizard/fo_follow_up_finance_wizard_view.xml' |
1098 | --- bin/addons/finance/wizard/fo_follow_up_finance_wizard_view.xml 1970-01-01 00:00:00 +0000 |
1099 | +++ bin/addons/finance/wizard/fo_follow_up_finance_wizard_view.xml 2021-02-01 16:08:13 +0000 |
1100 | @@ -0,0 +1,77 @@ |
1101 | +<?xml version="1.0" encoding="utf-8"?> |
1102 | +<openerp> |
1103 | + <data> |
1104 | + |
1105 | + <!-- FO Follow-Up finance / Wizard --> |
1106 | + <record id="fo_follow_up_finance_wizard_form_view" model="ir.ui.view"> |
1107 | + <field name="name">fo.follow.up.finance.wizard.form.view</field> |
1108 | + <field name="model">fo.follow.up.finance.wizard</field> |
1109 | + <field name="type">form</field> |
1110 | + <field name="arch" type="xml"> |
1111 | + <form string="FO Follow-up Finance"> |
1112 | + <separator colspan="4" string="Request parameters" /> |
1113 | + <field name="start_date" /> |
1114 | + <field name="end_date" /> |
1115 | + <field name="partner_ids" domain="[('customer', '=', True), |
1116 | + ('partner_type', '=', context.get('is_intermission') and 'intermission' or 'section')]"> |
1117 | + <tree> |
1118 | + <field name="name"/> |
1119 | + <field name="ref"/> |
1120 | + <field name="partner_type"/> |
1121 | + </tree> |
1122 | + </field> |
1123 | + <field name="order_id" domain="[('partner_type', '=', context.get('is_intermission') and 'intermission' or 'section')]"/> |
1124 | + <button name="print_excel" string="Excel report" icon="gtk-print" type="object" colspan="4" /> |
1125 | + </form> |
1126 | + </field> |
1127 | + </record> |
1128 | + |
1129 | + <!-- FO Follow-Up finance / Entry Menu --> |
1130 | + <record id="action_fo_follow_up_finance_wizard_menu" model="ir.actions.act_window"> |
1131 | + <field name="name">FO Follow-up Finance</field> |
1132 | + <field name="res_model">fo.follow.up.finance.wizard</field> |
1133 | + <field name="view_type">form</field> |
1134 | + <field name="view_mode">form</field> |
1135 | + <field name="target">new</field> |
1136 | + <field name="empty_ids">1</field> |
1137 | + </record> |
1138 | + <record model="ir.values" id="action_fo_follow_up_finance_wizard_values"> |
1139 | + <field name="object" eval="1" /> |
1140 | + <field name="name">fo_follow_up_finance</field> |
1141 | + <field name="key2">client_print_multi</field> |
1142 | + <field name="value" eval="'ir.actions.act_window,' +str(ref('action_fo_follow_up_finance_wizard_menu'))" /> |
1143 | + <field name="key">action</field> |
1144 | + <field name="model">account.invoice</field> |
1145 | + <field name="sequence" eval="98"/> |
1146 | + </record> |
1147 | + |
1148 | + <!-- Invoice lines follow-up --> |
1149 | + <record id="action_invoice_lines_follow_up" model="ir.actions.server"> |
1150 | + <field name="name">Invoice lines follow-up</field> |
1151 | + <field name="model_id" ref="model_account_invoice"/> |
1152 | + <field name="state">code</field> |
1153 | + <field name="code">action = obj.get_invoice_lines_follow_up(context=context)</field> |
1154 | + </record> |
1155 | + <record id="ir_invoice_lines_follow_up" model="ir.values"> |
1156 | + <field name="key2">client_print_multi</field> |
1157 | + <field name="model">account.invoice</field> |
1158 | + <field name="name">invoice_lines_follow_up</field> |
1159 | + <field eval="'ir.actions.server,%d'%action_invoice_lines_follow_up" name="value"/> |
1160 | + <field eval="True" name="object"/> |
1161 | + <field name="sequence" eval="99"/> |
1162 | + </record> |
1163 | + |
1164 | + <!-- FO Follow-Up finance / Report --> |
1165 | + <report id="fo_follow_up_finance" |
1166 | + string="FO Follow-up Finance" |
1167 | + model="account.invoice" |
1168 | + name="fo.follow.up.finance" |
1169 | + target_filename="Follow Up_%(year)s%(month)s%(day)s" |
1170 | + file="finance/report/fo_follow_up_finance_xls.mako" |
1171 | + report_type="webkit" |
1172 | + header="False" |
1173 | + auto="False" |
1174 | + menu="False"/> |
1175 | + |
1176 | + </data> |
1177 | +</openerp> |
1178 | |
1179 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
1180 | --- bin/addons/msf_profile/i18n/fr_MF.po 2021-01-28 10:07:03 +0000 |
1181 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2021-02-01 16:08:13 +0000 |
1182 | @@ -231,7 +231,7 @@ |
1183 | msgid "Card lines" |
1184 | msgstr "Card lines" |
1185 | |
1186 | -#. modules: msf_supply_doc_export, sales_followup |
1187 | +#. modules: msf_supply_doc_export, sales_followup, finance |
1188 | #: code:addons/msf_supply_doc_export/msf_supply_doc_export.py:897 |
1189 | #: report:po.follow.up_rml:0 |
1190 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:289 |
1191 | @@ -239,6 +239,7 @@ |
1192 | #: report:ir.follow.up.location.report_pdf:0 |
1193 | #: report:sales.follow.up.multi.report_pdf:0 |
1194 | #: code:addons/msf_supply_doc_export/msf_supply_doc_export.py:886 |
1195 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:354 |
1196 | msgid "Qty ordered" |
1197 | msgstr "Qté commandée" |
1198 | |
1199 | @@ -2180,13 +2181,14 @@ |
1200 | msgid "PURCHASE ORDER Track Changes report" |
1201 | msgstr "BON DE COMMANDE RAPPORT DE SUIVI DES CHANGEMENTS" |
1202 | |
1203 | -#. modules: sales_followup, purchase_followup |
1204 | +#. modules: sales_followup, purchase_followup, finance |
1205 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:195 |
1206 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:246 |
1207 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:187 |
1208 | #: report:ir.follow.up.location.report_pdf:0 |
1209 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:247 |
1210 | #: report:sales.follow.up.multi.report_pdf:0 |
1211 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:301 |
1212 | msgid "Date end:" |
1213 | msgstr "Date de fin:" |
1214 | |
1215 | @@ -13044,11 +13046,12 @@ |
1216 | msgid "Select the lines to be split; the wizard will create a new invoice and adjust the original one." |
1217 | msgstr "Sélectionner les lignes à fractionner, l'assistant créera une nouvelle facture et ajustera l'originale" |
1218 | |
1219 | -#. module: sales_followup |
1220 | +#. modules: sales_followup, finance |
1221 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:289 |
1222 | #: report:sales.follow.up.multi.report_pdf:0 |
1223 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:291 |
1224 | #: report:ir.follow.up.location.report_pdf:0 |
1225 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:356 |
1226 | msgid "Qty delivered" |
1227 | msgstr "Qté livrée" |
1228 | |
1229 | @@ -20320,11 +20323,12 @@ |
1230 | msgid "You receive heat sensitive products, please refer to the appropriate procedure." |
1231 | msgstr "Vous recevez des produits sensibles à la chaleur, merci de vous référer à la procédure appropriée." |
1232 | |
1233 | -#. modules: purchase, sourcing, sale, product_attributes |
1234 | +#. modules: purchase, sourcing, sale, product_attributes, finance |
1235 | #: field:purchase.order.line,name:0 |
1236 | #: field:sale.order.line,name:0 |
1237 | #: field:sale.order.line,product_name:0 |
1238 | #: report:addons/product_attributes/report/standard_price_track_changes.mako:77 |
1239 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:353 |
1240 | msgid "Product description" |
1241 | msgstr "Description produit" |
1242 | |
1243 | @@ -26535,7 +26539,7 @@ |
1244 | msgid "Applicable Code (if type=code)" |
1245 | msgstr "Code Applicable (si type=code)" |
1246 | |
1247 | -#. modules: sales_followup, sale, purchase_followup, stock, msf_supply_doc_export |
1248 | +#. modules: sales_followup, sale, purchase_followup, stock, msf_supply_doc_export, finance |
1249 | #: view:po.follow.up:0 |
1250 | #: view:po.track.changes.wizard:0 |
1251 | #: view:sale.loan.stock.moves:0 |
1252 | @@ -26547,6 +26551,7 @@ |
1253 | #: view:products.situation.report:0 |
1254 | #: view:supplier.performance.wizard:0 |
1255 | #: view:stock.delivery.wizard:0 |
1256 | +#: view:fo.follow.up.finance.wizard:0 |
1257 | msgid "Excel report" |
1258 | msgstr "Rapport Excel" |
1259 | |
1260 | @@ -29411,6 +29416,7 @@ |
1261 | #. modules: finance, stock_override |
1262 | #: report:cash.request.export:0 |
1263 | #: report:destruction.location:0 |
1264 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:276 |
1265 | msgid "Name:" |
1266 | msgstr "Nom :" |
1267 | |
1268 | @@ -32358,6 +32364,7 @@ |
1269 | #: field:tender,company_id:0 |
1270 | #: field:ir.followup.location.wizard,company_id:0 |
1271 | #: field:stock.reception.wizard,company_id:0 |
1272 | +#: field:fo.follow.up.finance.wizard,company_id:0 |
1273 | msgid "Company" |
1274 | msgstr "Société" |
1275 | |
1276 | @@ -34341,7 +34348,7 @@ |
1277 | msgid "Shipment Date:" |
1278 | msgstr "Shipment Date:" |
1279 | |
1280 | -#. modules: sales_followup, sync_client, sale, mission_stock, msf_doc_import, purchase_followup, account_override, stock |
1281 | +#. modules: sales_followup, sync_client, sale, mission_stock, msf_doc_import, purchase_followup, account_override, stock, finance |
1282 | #: field:msr_in_progress,start_date:0 |
1283 | #: field:abstract.wizard.import,start_date:0 |
1284 | #: field:wizard.import.batch,start_date:0 |
1285 | @@ -34354,6 +34361,7 @@ |
1286 | #: field:ir.track.changes.wizard,start_date:0 |
1287 | #: field:integrity.finance.wizard,date_from:0 |
1288 | #: report:addons/stock/report/stock_expired_damaged_report_xls.mako:178 |
1289 | +#: field:fo.follow.up.finance.wizard,start_date:0 |
1290 | msgid "Start date" |
1291 | msgstr "Date de début" |
1292 | |
1293 | @@ -36554,6 +36562,7 @@ |
1294 | #: field:product.template,seller_ids:0 |
1295 | #: model:ir.ui.menu,name:useability_dashboard_and_menu.menu_partner |
1296 | #: model:ir.actions.act_window,name:msf_partner.partner_normal_action |
1297 | +#: field:fo.follow.up.finance.wizard,partner_ids:0 |
1298 | msgid "Partners" |
1299 | msgstr "Partenaires" |
1300 | |
1301 | @@ -39180,13 +39189,14 @@ |
1302 | msgid "Start configuration of internal partner..." |
1303 | msgstr "Start configuration of internal partner..." |
1304 | |
1305 | -#. modules: sales_followup, purchase_followup |
1306 | +#. modules: sales_followup, purchase_followup, finance |
1307 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:213 |
1308 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:257 |
1309 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:205 |
1310 | #: report:ir.follow.up.location.report_pdf:0 |
1311 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:258 |
1312 | #: report:sales.follow.up.multi.report_pdf:0 |
1313 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:316 |
1314 | msgid "Date of the request:" |
1315 | msgstr "Date de la requête:" |
1316 | |
1317 | @@ -43559,7 +43569,7 @@ |
1318 | msgid "Reordering Mode" |
1319 | msgstr "Mode de Réapprovisionnement" |
1320 | |
1321 | -#. modules: msf_doc_import, sale, sales_followups, account_override, stock, stock_schedule,sales_followup,purchase_followup |
1322 | +#. modules: msf_doc_import, sale, account_override, stock, stock_schedule, sales_followup, purchase_followup, finance |
1323 | #: field:abstract.wizard.import,end_date:0 |
1324 | #: field:wizard.import.batch,end_date:0 |
1325 | #: field:sale.donation.stock.moves,end_date:0 |
1326 | @@ -43574,6 +43584,7 @@ |
1327 | #: field:po.track.changes.wizard,end_date:0 |
1328 | #: field:sale.loan.stock.moves,end_date:0 |
1329 | #: field:ir.track.changes.wizard,end_date:0 |
1330 | +#: field:fo.follow.up.finance.wizard,end_date:0 |
1331 | msgid "End date" |
1332 | msgstr "Date de fin" |
1333 | |
1334 | @@ -47400,13 +47411,14 @@ |
1335 | msgid "TVA :" |
1336 | msgstr "TVA :" |
1337 | |
1338 | -#. modules: sourcing, sale, product_attributes, procurement_cycle |
1339 | +#. modules: sourcing, sale, product_attributes, procurement_cycle, finance |
1340 | #: field:sale.report,product_code:0 |
1341 | #: field:sale.order.line,product_code:0 |
1342 | #: report:addons/product_attributes/report/standard_price_track_changes.mako:69 |
1343 | #: report:addons/procurement_cycle/report/replenishment_order_calc.mako:408 |
1344 | #: report:addons/procurement_cycle/report/replenishment_product_list.mako:124 |
1345 | #: report:addons/procurement_cycle/report/replenishment_segment.mako:368 |
1346 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:352 |
1347 | msgid "Product code" |
1348 | msgstr "Code Produit" |
1349 | |
1350 | @@ -47966,9 +47978,10 @@ |
1351 | msgid "SÃO TOMÉ AND PRÍNCIPE DOBRA" |
1352 | msgstr "SÃO TOMÉ AND PRÍNCIPE DOBRA" |
1353 | |
1354 | -#. module: sales_followup |
1355 | +#. modules: sales_followup, finance |
1356 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:294 |
1357 | #: report:sales.follow.up.multi.report_pdf:0 |
1358 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:357 |
1359 | msgid "Transport file" |
1360 | msgstr "Fichier Transport" |
1361 | |
1362 | @@ -47999,7 +48012,7 @@ |
1363 | msgid "Original Qty for Partial process - only for sync and partial processed line" |
1364 | msgstr "Original Qty for Partial process - only for sync and partial processed line" |
1365 | |
1366 | -#. modules: sales_followup, purchase_followup, sale, stock, msf_supply_doc_export |
1367 | +#. modules: sales_followup, purchase_followup, sale, stock, msf_supply_doc_export, finance |
1368 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:178 |
1369 | #: view:po.track.changes.wizard:0 |
1370 | #: view:sale.donation.stock.moves:0 |
1371 | @@ -48014,6 +48027,8 @@ |
1372 | #: view:stock.expired.damaged.report:0 |
1373 | #: view:supplier.performance.wizard:0 |
1374 | #: view:stock.delivery.wizard:0 |
1375 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:273 |
1376 | +#: view:fo.follow.up.finance.wizard:0 |
1377 | msgid "Request parameters" |
1378 | msgstr "Paramètres de la requête" |
1379 | |
1380 | @@ -52960,11 +52975,12 @@ |
1381 | msgid "In months. Define the time while the stock is not negative but should be replenished. Time used to compute the quantity of products to order according to the monthly consumption." |
1382 | msgstr "En mois. Défini le temps durant lequel le stock n'est pas négatif, mais doit être réapprovisionné. Temps utilisé pour calculer la quantité de produits à commander en fonction de la consommation mensuelle." |
1383 | |
1384 | -#. module: sales_followup |
1385 | +#. modules: sales_followup, finance |
1386 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:235 |
1387 | #: report:ir.follow.up.location.report_pdf:0 |
1388 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:236 |
1389 | #: report:sales.follow.up.multi.report_pdf:0 |
1390 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:286 |
1391 | msgid "Date start:" |
1392 | msgstr "Date de début:" |
1393 | |
1394 | @@ -56546,9 +56562,10 @@ |
1395 | msgid "Item" |
1396 | msgstr "Art." |
1397 | |
1398 | -#. module: sales_followup |
1399 | +#. modules: sales_followup, finance |
1400 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:284 |
1401 | #: report:addons/sales_followup/report/sale_follow_up_report_xls.mako:124 |
1402 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:186 |
1403 | msgid "FO Follow Up" |
1404 | msgstr "Suivi CdT" |
1405 | |
1406 | @@ -67356,13 +67373,14 @@ |
1407 | msgid "Create and manage the companies that will be managed by OpenERP from here. Shops or subsidiaries can be created and maintained from here." |
1408 | msgstr "Créer et gérer les sociétés qui seront gérées par OpenERP à partir d'ici. Les magasins ou sous-divisions pourront être créés ou maintenus à partir d'ici." |
1409 | |
1410 | -#. modules: sales_followup, purchase_followup |
1411 | +#. modules: sales_followup, purchase_followup, finance |
1412 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:192 |
1413 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:232 |
1414 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:184 |
1415 | #: report:ir.follow.up.location.report_pdf:0 |
1416 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:233 |
1417 | #: report:sales.follow.up.multi.report_pdf:0 |
1418 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:283 |
1419 | msgid "Address:" |
1420 | msgstr "Adresse:" |
1421 | |
1422 | @@ -68698,11 +68716,12 @@ |
1423 | msgid "Register line state" |
1424 | msgstr "Register line state" |
1425 | |
1426 | -#. module: sales_followup, sale |
1427 | +#. modules: sales_followup, sale, finance |
1428 | #: field:ir.followup.location.wizard,order_id:0 |
1429 | #: field:ir.track.changes.wizard,order_id:0 |
1430 | #: field:sale.followup.multi.wizard,order_id:0 |
1431 | #: report:addons/sale/report/sale_donation_stock_moves_report_xls.mako:133 |
1432 | +#: field:fo.follow.up.finance.wizard,order_id:0 |
1433 | msgid "Order Ref." |
1434 | msgstr "Réf Commande" |
1435 | |
1436 | @@ -70936,10 +70955,11 @@ |
1437 | msgid "user.access.results.users.line" |
1438 | msgstr "user.access.results.users.line" |
1439 | |
1440 | -#. modules: purchase, product, sales_followup |
1441 | +#. modules: purchase, product, sales_followup, finance |
1442 | #: field:product.product,partner_ref:0 |
1443 | #: view:purchase.order.line:0 |
1444 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:278 |
1445 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:335 |
1446 | msgid "Customer ref" |
1447 | msgstr "Réf. Client" |
1448 | |
1449 | @@ -76758,13 +76778,19 @@ |
1450 | msgid "Display PO" |
1451 | msgstr "Affichage BC" |
1452 | |
1453 | -#. modules: purchase_msf, purchase_override, msf_supply_doc_export |
1454 | +#. modules: purchase_msf, purchase_override, msf_supply_doc_export, finance |
1455 | #: field:purchase.order.line,supplier_name:0 |
1456 | #: field:purchase.order.merged.line,supplier_name:0 |
1457 | #: report:addons/msf_supply_doc_export/report/supplier_performance_report_xls.mako:195 |
1458 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:337 |
1459 | msgid "Supplier name" |
1460 | msgstr "Nom Fournisseur" |
1461 | |
1462 | +#. module: finance |
1463 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:334 |
1464 | +msgid "Customer name" |
1465 | +msgstr "Nom Client" |
1466 | + |
1467 | #. module: account_period_closing_level |
1468 | #: selection:account.period.create,fiscalyear:0 |
1469 | msgid "Next FY" |
1470 | @@ -78701,10 +78727,11 @@ |
1471 | msgid "Mauritania" |
1472 | msgstr "Mauritanie" |
1473 | |
1474 | -#. modules: sales_followup, base |
1475 | +#. modules: sales_followup, base, finance |
1476 | #: model:ir.ui.menu,name:base.menu_base_partner |
1477 | #: field:ir.followup.location.wizard,order_ids:0 |
1478 | #: field:sale.followup.multi.wizard,order_ids:0 |
1479 | +#: field:fo.follow.up.finance.wizard,order_ids:0 |
1480 | msgid "Orders" |
1481 | msgstr "Commandes" |
1482 | |
1483 | @@ -86323,11 +86350,12 @@ |
1484 | msgid "Template file" |
1485 | msgstr "Fichier modèle" |
1486 | |
1487 | -#. modules: sales_followup, purchase_followup |
1488 | +#. modules: sales_followup, purchase_followup, finance |
1489 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:220 |
1490 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:221 |
1491 | #: report:addons/purchase_followup/report/po_track_changes_report_xls.mako:176 |
1492 | #: report:addons/sales_followup/report/ir_track_changes_report_xls.mako:168 |
1493 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:271 |
1494 | msgid "Instance information" |
1495 | msgstr "Informations sur l'instance" |
1496 | |
1497 | @@ -89655,9 +89683,10 @@ |
1498 | msgid "Asia/Kashgar" |
1499 | msgstr "Asia/Kashgar" |
1500 | |
1501 | -#. modules: sales_followup, msf_outgoing, specific_rules |
1502 | +#. modules: sales_followup, msf_outgoing, specific_rules, finance |
1503 | #: report:addons/sales_followup/report/ir_follow_up_location_report_xls.mako:290 |
1504 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:288 |
1505 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:355 |
1506 | msgid "UoM ordered" |
1507 | msgstr "UdM commandée" |
1508 | |
1509 | @@ -98135,10 +98164,11 @@ |
1510 | msgid "Note type" |
1511 | msgstr "Type de note" |
1512 | |
1513 | -#. modules: purchase, analytic_distribution, msf_doc_import |
1514 | +#. modules: purchase, analytic_distribution, msf_doc_import, finance |
1515 | #: field:account.commitment.line,purchase_order_line_ids:0 |
1516 | #: view:purchase.order.line:0 |
1517 | #: field:wizard.import.po,line_ids:0 |
1518 | +#: field:account.invoice.line,purchase_order_line_ids:0 |
1519 | msgid "Purchase Order Lines" |
1520 | msgstr "Lignes Bon de Commande" |
1521 | |
1522 | @@ -108669,13 +108699,15 @@ |
1523 | msgid "Ship #" |
1524 | msgstr "Numéro d'Expé." |
1525 | |
1526 | -#. module: account |
1527 | +#. modules: account, finance |
1528 | #: report:addons/account/report/invoice_excel_export.mako:81 |
1529 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:333 |
1530 | msgid "FO number" |
1531 | msgstr "Numéro de la CdT" |
1532 | |
1533 | -#. module: account |
1534 | +#. modules: account, finance |
1535 | #: report:addons/account/report/invoice_excel_export.mako:82 |
1536 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:336 |
1537 | msgid "PO number" |
1538 | msgstr "Numéro du BC" |
1539 | |
1540 | @@ -111248,6 +111280,7 @@ |
1541 | #, python-format |
1542 | msgid "PO %s created by duplication: Order Type changed from DPO to Regular" |
1543 | msgstr "BdC %s créé par duplication: Type de Commande modifié de BC Direct à Normal" |
1544 | +<<<<<<< TREE |
1545 | |
1546 | #. module: kit |
1547 | #: view:kit.creation:0 |
1548 | @@ -111263,3 +111296,262 @@ |
1549 | #: view:kit.creation:0 |
1550 | msgid "Remove Availability" |
1551 | msgstr "Enlever la Disponibilité" |
1552 | +======= |
1553 | + |
1554 | +#. module: account |
1555 | +#: code:addons/account/invoice.py:2157 |
1556 | +#, python-format |
1557 | +msgid "IVO lines follow-up" |
1558 | +msgstr "Suivi Lignes Bons Interm. OUT" |
1559 | + |
1560 | +#. module: account |
1561 | +#: code:addons/account/invoice.py:2159 |
1562 | +#, python-format |
1563 | +msgid "STV lines follow-up" |
1564 | +msgstr "Suivi Lignes Bons Clients" |
1565 | + |
1566 | +#. module: account_override |
1567 | +#: code:addons/account_override/invoice.py:1682 |
1568 | +#, python-format |
1569 | +msgid "Please select at least one record!" |
1570 | +msgstr "Veuillez sélectionner au moins un enregistrement !" |
1571 | + |
1572 | +#. module: finance |
1573 | +#: code:addons/finance/wizard/fo_follow_up_finance_wizard.py:81 |
1574 | +#, python-format |
1575 | +msgid "No field orders found." |
1576 | +msgstr "Pas de commandes de terrain trouvées." |
1577 | + |
1578 | +#. modules: register_accounting, finance |
1579 | +#: help:account.invoice.line,purchase_order_line_ids:0 |
1580 | +#: help:wizard.account.invoice.line,purchase_order_line_ids:0 |
1581 | +msgid "Used in case of merged invoice lines" |
1582 | +msgstr "Utilisé en cas de lignes de facture fusionnées" |
1583 | + |
1584 | +#. module: finance |
1585 | +#: view:fo.follow.up.finance.wizard:0 |
1586 | +#: model:ir.actions.act_window,name:finance.action_fo_follow_up_finance_wizard_menu |
1587 | +#: model:ir.actions.report.xml,name:finance.fo_follow_up_finance |
1588 | +msgid "FO Follow-up Finance" |
1589 | +msgstr "Suivi Commande Terrain Finance" |
1590 | + |
1591 | +#. module: finance |
1592 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:264 |
1593 | +msgid "FIELD ORDER FOLLOW-UP FINANCE" |
1594 | +msgstr "SUIVI COMMANDE TERRAIN FINANCE" |
1595 | + |
1596 | +#. module: finance |
1597 | +#: field:fo.follow.up.finance.wizard,report_date:0 |
1598 | +msgid "Date of the export" |
1599 | +msgstr "Date de l'export" |
1600 | + |
1601 | +#. module: finance |
1602 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:349 |
1603 | +msgid "FO status" |
1604 | +msgstr "Statut CdT" |
1605 | + |
1606 | +#. module: finance |
1607 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:350 |
1608 | +msgid "FO line status" |
1609 | +msgstr "Statut ligne CdT" |
1610 | + |
1611 | +#. module: finance |
1612 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:367 |
1613 | +msgid "STV status" |
1614 | +msgstr "Statut Bon Client" |
1615 | + |
1616 | +#. module: finance |
1617 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:367 |
1618 | +msgid "IVO status" |
1619 | +msgstr "Statut Bon Interm. OUT" |
1620 | + |
1621 | +#. module: finance |
1622 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:347 |
1623 | +msgid "SI status" |
1624 | +msgstr "Statut Fact. Fourniss." |
1625 | + |
1626 | +#. module: finance |
1627 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:368 |
1628 | +msgid "Reverse corresponding AJI? (STV)" |
1629 | +msgstr "Ligne Analytique Correspondante Contrepassée ? (Bon Client)" |
1630 | + |
1631 | +#. module: finance |
1632 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:368 |
1633 | +msgid "Reverse corresponding AJI? (IVO)" |
1634 | +msgstr "Ligne Analytique Correspondante Contrepassée ? (Bon Interm. OUT)" |
1635 | + |
1636 | +#. module: finance |
1637 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:348 |
1638 | +msgid "Reverse corresponding AJI? (SI)" |
1639 | +msgstr "Ligne Analytique Correspondante Contrepassée ? (Fact. Fourniss.)" |
1640 | + |
1641 | +#. module: finance |
1642 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:364 |
1643 | +msgid "STV line sub total" |
1644 | +msgstr "Sous-total ligne Bon Client" |
1645 | + |
1646 | +#. module: finance |
1647 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:364 |
1648 | +msgid "IVO line sub total" |
1649 | +msgstr "Sous-total ligne Bon Interm. OUT" |
1650 | + |
1651 | +#. module: finance |
1652 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:344 |
1653 | +msgid "SI line sub total" |
1654 | +msgstr "Sous-total ligne Fact. Fourniss." |
1655 | + |
1656 | +#. module: finance |
1657 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:366 |
1658 | +msgid "STV line sub total functional currency" |
1659 | +msgstr "Sous-total ligne Bon Client en devise fonctionnelle" |
1660 | + |
1661 | +#. module: finance |
1662 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:366 |
1663 | +msgid "IVO line sub total functional currency" |
1664 | +msgstr "Sous-total ligne Bon Interm. OUT en devise fonctionnelle" |
1665 | + |
1666 | +#. module: finance |
1667 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:346 |
1668 | +msgid "SI line sub total functional currency" |
1669 | +msgstr "Sous-total ligne Fact. Fourniss. en devise fonctionnelle" |
1670 | + |
1671 | +#. module: finance |
1672 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:358 |
1673 | +msgid "STV number" |
1674 | +msgstr "Num. Bon Client" |
1675 | + |
1676 | +#. module: finance |
1677 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:358 |
1678 | +msgid "IVO number" |
1679 | +msgstr "Num. Bon Interm. OUT" |
1680 | + |
1681 | +#. module: finance |
1682 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:338 |
1683 | +msgid "Supplier invoice number" |
1684 | +msgstr "Num. Facture Fournisseur" |
1685 | + |
1686 | +#. module: finance |
1687 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:351 |
1688 | +msgid "FO line number" |
1689 | +msgstr "Num. ligne CdT" |
1690 | + |
1691 | +#. module: finance |
1692 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:359 |
1693 | +msgid "STV line number" |
1694 | +msgstr "Num. ligne Bon Client" |
1695 | + |
1696 | +#. module: finance |
1697 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:359 |
1698 | +msgid "IVO line number" |
1699 | +msgstr "Num. ligne Bon Interm. OUT" |
1700 | + |
1701 | +#. module: finance |
1702 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:339 |
1703 | +msgid "SI line number" |
1704 | +msgstr "Num. ligne Fact. Fourniss." |
1705 | + |
1706 | +#. module: finance |
1707 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:360 |
1708 | +msgid "STV line description" |
1709 | +msgstr "Description ligne Bon Client" |
1710 | + |
1711 | +#. module: finance |
1712 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:360 |
1713 | +msgid "IVO line description" |
1714 | +msgstr "Description ligne Bon Interm. OUT" |
1715 | + |
1716 | +#. module: finance |
1717 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:340 |
1718 | +msgid "SI line description" |
1719 | +msgstr "Description ligne Fact. Fournisseur" |
1720 | + |
1721 | +#. module: finance |
1722 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:362 |
1723 | +msgid "STV line quantity" |
1724 | +msgstr "Quantité ligne Bon Client" |
1725 | + |
1726 | +#. module: finance |
1727 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:362 |
1728 | +msgid "IVO line quantity" |
1729 | +msgstr "Quantité ligne Bon Interm. OUT" |
1730 | + |
1731 | +#. module: finance |
1732 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:342 |
1733 | +msgid "SI line quantity" |
1734 | +msgstr "Quantité ligne Fact. Fourniss." |
1735 | + |
1736 | +#. module: finance |
1737 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:361 |
1738 | +msgid "STV line unit price" |
1739 | +msgstr "Prix Unitaire ligne Bon Client" |
1740 | + |
1741 | +#. module: finance |
1742 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:361 |
1743 | +msgid "IVO line unit price" |
1744 | +msgstr "Prix Unitaire ligne Bon Interm. OUT" |
1745 | + |
1746 | +#. module: finance |
1747 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:341 |
1748 | +msgid "SI line unit price" |
1749 | +msgstr "Prix Unitaire ligne Fact. Fourniss." |
1750 | + |
1751 | +#. module: finance |
1752 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:363 |
1753 | +msgid "STV line expense account code" |
1754 | +msgstr "Code Compte de Charge ligne Bon Client" |
1755 | + |
1756 | +#. module: finance |
1757 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:363 |
1758 | +msgid "IVO line expense account code" |
1759 | +msgstr "Code Compte de Charge ligne Bon Interm. OUT" |
1760 | + |
1761 | +#. module: finance |
1762 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:343 |
1763 | +msgid "SI line expense account code" |
1764 | +msgstr "Code Compte de Charge ligne Fact. Fourniss." |
1765 | + |
1766 | +#. module: finance |
1767 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:365 |
1768 | +msgid "STV currency" |
1769 | +msgstr "Devise Bon Client" |
1770 | + |
1771 | +#. module: finance |
1772 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:365 |
1773 | +msgid "IVO currency" |
1774 | +msgstr "Devise Bon Interm. OUT" |
1775 | + |
1776 | +#. module: finance |
1777 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:345 |
1778 | +msgid "SI currency" |
1779 | +msgstr "Devise Fact. Fourniss." |
1780 | + |
1781 | +#. module: finance |
1782 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:279 |
1783 | +msgid "Partners:" |
1784 | +msgstr "Partenaires :" |
1785 | + |
1786 | +#. module: finance |
1787 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:407 |
1788 | +msgid "ORDER INFORMATION" |
1789 | +msgstr "INFORMATION COMMANDE" |
1790 | + |
1791 | +#. module: finance |
1792 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:408 |
1793 | +msgid "DETAILS SUPPLIER INVOICES" |
1794 | +msgstr "DÉTAILS FACTURES FOURNISSEUR" |
1795 | + |
1796 | +#. module: finance |
1797 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:409 |
1798 | +msgid "DETAILS FIELD ORDERS" |
1799 | +msgstr "DÉTAILS COMMANDES DE TERRAIN" |
1800 | + |
1801 | +#. module: finance |
1802 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:410 |
1803 | +msgid "DETAILS STOCK TRANSFER VOUCHERS" |
1804 | +msgstr "DÉTAILS BONS CLIENT" |
1805 | + |
1806 | +#. module: finance |
1807 | +#: report:addons/finance/report/fo_follow_up_finance_xls.mako:410 |
1808 | +msgid "DETAILS INTERMISSION VOUCHERS OUT" |
1809 | +msgstr "DÉTAILS BONS INTERMISSION OUT" |
1810 | +>>>>>>> MERGE-SOURCE |
1811 | |
1812 | === modified file 'bin/addons/product_attributes/product_attributes.py' |
1813 | === modified file 'bin/addons/purchase/purchase_order.py' |
1814 | --- bin/addons/purchase/purchase_order.py 2021-01-06 15:21:47 +0000 |
1815 | +++ bin/addons/purchase/purchase_order.py 2021-02-01 16:08:13 +0000 |
1816 | @@ -1535,6 +1535,7 @@ |
1817 | 'company_id': o.company_id.id, |
1818 | 'main_purchase_id': o.id, |
1819 | 'purchase_ids': [(4, o.id)], |
1820 | + 'from_supply': True, |
1821 | } |
1822 | |
1823 | if o.analytic_distribution_id: |
1824 | |
1825 | === modified file 'bin/addons/purchase/purchase_order_line.py' |
1826 | --- bin/addons/purchase/purchase_order_line.py 2020-12-14 16:49:10 +0000 |
1827 | +++ bin/addons/purchase/purchase_order_line.py 2021-02-01 16:08:13 +0000 |
1828 | @@ -1270,7 +1270,7 @@ |
1829 | self.pool.get('product.product')._get_restriction_error(cr, uid, [pol.product_id.id], |
1830 | {'partner_id': pol.order_id.partner_id.id}, context=context) |
1831 | |
1832 | - default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': [], 'commitment_line_ids': []}) |
1833 | + default.update({'state': 'draft', 'move_ids': [], 'invoiced': 0, 'invoice_lines': [], 'commitment_line_ids': [], }) |
1834 | |
1835 | for field in ['origin', 'move_dest_id', 'original_product', 'original_qty', 'original_price', 'original_uom', 'original_currency_id', 'modification_comment', 'sync_linked_sol', 'created_by_vi_import', 'external_ref']: |
1836 | if field not in default: |
1837 | |
1838 | === modified file 'bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py' |
1839 | --- bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py 2019-07-26 15:38:38 +0000 |
1840 | +++ bin/addons/sales_followup/wizard/sale_followup_multi_wizard.py 2021-02-01 16:08:13 +0000 |
1841 | @@ -138,6 +138,25 @@ |
1842 | |
1843 | return state_domain |
1844 | |
1845 | + def _check_max_line_number(self, cr, fo_ids): |
1846 | + """ |
1847 | + Blocks report generation with an error message in case there are too many FO lines to handle. |
1848 | + """ |
1849 | + cr.execute("""SELECT COUNT(id) FROM sale_order_line WHERE order_id IN %s""", (tuple(fo_ids),)) |
1850 | + nb_lines = 0 |
1851 | + for x in cr.fetchall(): |
1852 | + nb_lines = x[0] |
1853 | + # Parameter to define the maximum number of lines. For a custom number: |
1854 | + # "INSERT INTO ir_config_parameter (key, value) VALUES ('FO_FOLLOWUP_MAX_LINE', 'chosen_number');" |
1855 | + # Or update the existing one |
1856 | + config_line = self.pool.get('ir.config_parameter').get_param(cr, 1, 'FO_FOLLOWUP_MAX_LINE') |
1857 | + if config_line: |
1858 | + max_line = int(config_line) |
1859 | + else: |
1860 | + max_line = 5000 |
1861 | + if nb_lines > max_line: |
1862 | + raise osv.except_osv(_('Error'), _('The requested report is too heavy to generate: requested %d lines, maximum allowed %d. ' |
1863 | + 'Please apply further filters so that report can be generated.') % (nb_lines, max_line)) |
1864 | |
1865 | def get_values(self, cr, uid, ids, context=None): |
1866 | ''' |
1867 | @@ -178,22 +197,7 @@ |
1868 | _('No data found with these parameters'), |
1869 | ) |
1870 | |
1871 | - cr.execute("""SELECT COUNT(id) FROM sale_order_line WHERE order_id IN %s""", (tuple(fo_ids),)) |
1872 | - nb_lines = 0 |
1873 | - for x in cr.fetchall(): |
1874 | - nb_lines = x[0] |
1875 | - |
1876 | - # Parameter to define the maximum number of lines. For a custom number: |
1877 | - # "INSERT INTO ir_config_parameter (key, value) VALUES ('FOLLOWUP_MAX_LINE', 'chosen_number');" |
1878 | - # Or update the existing one |
1879 | - config_line = self.pool.get('ir.config_parameter').get_param(cr, 1, 'FO_FOLLOWUP_MAX_LINE') |
1880 | - if config_line: |
1881 | - max_line = int(config_line) |
1882 | - else: |
1883 | - max_line = 5000 |
1884 | - |
1885 | - if nb_lines > max_line: |
1886 | - raise osv.except_osv(_('Error'), _('The requested report is too heavy to generate: requested %d lines, maximum allowed %d. Please apply further filters so that report can be generated.') % (nb_lines, max_line)) |
1887 | + self._check_max_line_number(cr, fo_ids) |
1888 | |
1889 | self.write(cr, uid, [wizard.id], {'order_ids': fo_ids}, context=context) |
1890 |