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

Proposed by jftempo
Status: Merged
Merged at revision: 5079
Proposed branch: lp:~julie-w/unifield-server/US-5004
Merge into: lp:unifield-server
Diff against target: 1327 lines (+350/-296)
25 files modified
bin/addons/account_override/__init__.py (+1/-0)
bin/addons/analytic_distribution_supply/invoice.py (+1/-1)
bin/addons/analytic_distribution_supply/stock.py (+1/-1)
bin/addons/consumption_calculation/expiry_calculation.py (+4/-4)
bin/addons/consumption_calculation/report/expiry_calculation_report.py (+5/-3)
bin/addons/consumption_calculation/report/product_likely_expire_xls.mako (+1/-1)
bin/addons/delivery_mechanism/delivery_mechanism.py (+4/-0)
bin/addons/finance/purchase.py (+15/-0)
bin/addons/msf_doc_import/purchase_order.py (+2/-0)
bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py (+15/-6)
bin/addons/msf_outgoing/wizard/picking_processor.py (+12/-57)
bin/addons/msf_printed_documents/report/report_reception.py (+22/-34)
bin/addons/msf_profile/i18n/fr_MF.po (+32/-1)
bin/addons/msf_tools/automated_import_job.py (+6/-1)
bin/addons/purchase/purchase_order.py (+8/-0)
bin/addons/purchase/purchase_view.xml (+5/-5)
bin/addons/purchase/wizard/purchase_line_cancel.py (+5/-0)
bin/addons/purchase_override/purchase.py (+3/-0)
bin/addons/purchase_override/report/merged_order.rml (+27/-23)
bin/addons/purchase_override/report/purchase_order.rml (+151/-149)
bin/addons/register_accounting/account_bank_statement.py (+1/-1)
bin/addons/register_accounting/report/report_fully_report.py (+11/-2)
bin/addons/res_currency_functional/account_move_compute_currency.py (+7/-3)
bin/addons/spreadsheet_xml/spreadsheet_xml_write.py (+5/-0)
bin/addons/stock/physical_inventory.py (+6/-4)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5004
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+354238@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account_override/__init__.py'
2--- bin/addons/account_override/__init__.py 2018-07-17 14:03:52 +0000
3+++ bin/addons/account_override/__init__.py 2018-09-05 07:53:26 +0000
4@@ -38,6 +38,7 @@
5 # CASH RETURN - ADVANCE LINES
6 'cash_return': [
7 ('type', '!=', 'view'),
8+ ('type_for_register', '!=', 'donation'),
9 '|', '|', '|',
10 ('user_type_code', 'in', ['income', 'expense']),
11 '&', ('type', '=', 'receivable'), ('user_type_code', 'in', ['receivables', 'cash']),
12
13=== modified file 'bin/addons/analytic_distribution_supply/invoice.py'
14--- bin/addons/analytic_distribution_supply/invoice.py 2018-07-13 08:26:08 +0000
15+++ bin/addons/analytic_distribution_supply/invoice.py 2018-09-05 07:53:26 +0000
16@@ -274,7 +274,7 @@
17
18 if auto_cv and from_cancel:
19 # we cancel the last IN from PO and no draft invoice exist
20- if not self.pool.get('purchase.order').search_exist(cr, uid, [('id', 'in', po_ids), ('state', 'not in', ['cancel', 'done'])], context=context):
21+ if not self.pool.get('stock.move').search_exist(cr, uid, [('type', '=', 'in'), ('id', 'not in', from_cancel), ('state', 'not in', ['cancel', 'done']), ('picking_id.purchase_id', 'in', po_ids)], context=context):
22 if not self.pool.get('account.invoice').search_exist(cr, uid, [('purchase_ids', 'in', po_ids), ('state', '=', 'draft')], context=context):
23 self.pool.get('purchase.order')._finish_commitment(cr, uid, po_ids, context=context)
24 return True
25
26=== modified file 'bin/addons/analytic_distribution_supply/stock.py'
27--- bin/addons/analytic_distribution_supply/stock.py 2018-01-10 15:57:41 +0000
28+++ bin/addons/analytic_distribution_supply/stock.py 2018-09-05 07:53:26 +0000
29@@ -87,7 +87,7 @@
30 account_amount[account_id] += round(qty * price_unit, 2)
31
32 if account_amount and po_ids:
33- inv_obj._update_commitments_lines(cr, uid, po_ids.keys(), account_amount, from_cancel=True, context=context)
34+ inv_obj._update_commitments_lines(cr, uid, po_ids.keys(), account_amount, from_cancel=ids, context=context)
35
36 return super(stock_move, self).action_cancel(cr, uid, ids, context=context)
37
38
39=== modified file 'bin/addons/consumption_calculation/expiry_calculation.py'
40--- bin/addons/consumption_calculation/expiry_calculation.py 2018-08-14 14:10:58 +0000
41+++ bin/addons/consumption_calculation/expiry_calculation.py 2018-09-05 07:53:26 +0000
42@@ -705,7 +705,7 @@
43 return res
44
45 _columns = {
46- 'report_id': fields.many2one('product.likely.expire.report', string='Report', required=True, ondelete='cascade'),
47+ 'report_id': fields.many2one('product.likely.expire.report', string='Report', required=True, ondelete='cascade', select=1),
48 'product_id': fields.many2one('product.product', string='Product', required=True),
49 'consumption': fields.float(digits=(16, 2), string='Monthly Consumption', required=True),
50 'in_stock': fields.float(digits=(16, 2), string='In stock'),
51@@ -792,11 +792,11 @@
52 _rec_name = 'line_id'
53
54 _columns = {
55- 'line_id': fields.many2one('product.likely.expire.report.line', string='Line', ondelete='cascade'),
56- 'name': fields.char(size=64, string='Month'),
57+ 'line_id': fields.many2one('product.likely.expire.report.line', string='Line', ondelete='cascade', select=1),
58+ 'name': fields.char(size=64, string='Month', select=1),
59 'available_qty': fields.float(digits=(16,2), string='Available Qty.'),
60 'expired_qty': fields.float(digits=(16,2), string='Expired Qty.'),
61- 'period_start': fields.date(string='Period start', readonly=True),
62+ 'period_start': fields.date(string='Period start', readonly=True, select=1),
63 'line_ids': fields.one2many('product.likely.expire.report.item.line', 'item_id', string='Batchs'),
64 }
65
66
67=== modified file 'bin/addons/consumption_calculation/report/expiry_calculation_report.py'
68--- bin/addons/consumption_calculation/report/expiry_calculation_report.py 2018-07-18 12:56:39 +0000
69+++ bin/addons/consumption_calculation/report/expiry_calculation_report.py 2018-09-05 07:53:26 +0000
70@@ -119,7 +119,7 @@
71 return False
72 return item_obj.browse(self.cr, self.uid, items_ids)
73
74- def _get_month_item_lines_ids(self, report, month_date):
75+ def _get_month_item_lines_ids(self, report, month_date, report_type=''):
76 """get month items('product.likely.expire.report.item')
77 """
78 lines_obj = self.pool.get('product.likely.expire.report.line')
79@@ -143,6 +143,8 @@
80 ('period_start', '>=', dt_from),
81 ('period_start', '<=', dt_to)
82 ]
83+ if report_type == 'xls':
84+ domain.append(('name', '!=', 'expired_qty_col'))
85
86 items_ids = item_obj.search(self.cr, self.uid, domain)
87
88@@ -152,11 +154,11 @@
89 order='expired_date')
90 return item_lines_ids
91
92- def _get_month_item_lines(self, report, month_date):
93+ def _get_month_item_lines(self, report, month_date, report_type=''):
94 """get month items('product.likely.expire.report.item')
95 """
96 item_line_obj = self.pool.get('product.likely.expire.report.item.line')
97- return item_line_obj.browse(self.cr, self.uid, self._get_month_item_lines_ids(report, month_date))
98+ return item_line_obj.browse(self.cr, self.uid, self._get_month_item_lines_ids(report, month_date, report_type=report_type))
99
100 def _get_rml_tables(self, report, month_cols_count):
101 """
102
103=== modified file 'bin/addons/consumption_calculation/report/product_likely_expire_xls.mako'
104--- bin/addons/consumption_calculation/report/product_likely_expire_xls.mako 2018-07-18 12:56:39 +0000
105+++ bin/addons/consumption_calculation/report/product_likely_expire_xls.mako 2018-09-05 07:53:26 +0000
106@@ -194,7 +194,7 @@
107 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Available Qty')}</Data></Cell>
108 <Cell ss:StyleID="header" ><Data ss:Type="String">${_('Expiry Qty')}</Data></Cell>
109 </Row>
110-% for il in getMonthItemLines(o, d):
111+% for il in getMonthItemLines(o, d, 'xls'):
112 <Row>
113 <Cell ss:StyleID="line" ><Data ss:Type="String">${il.item_id.line_id.product_id.default_code or ''|x}</Data></Cell>
114 <Cell ss:StyleID="line" ><Data ss:Type="String">${il.item_id.line_id.product_id.name or ''|x}</Data></Cell>
115
116=== modified file 'bin/addons/delivery_mechanism/delivery_mechanism.py'
117--- bin/addons/delivery_mechanism/delivery_mechanism.py 2018-05-28 07:44:07 +0000
118+++ bin/addons/delivery_mechanism/delivery_mechanism.py 2018-09-05 07:53:26 +0000
119@@ -1013,6 +1013,10 @@
120 line = False
121 for line in move_proc_obj.browse(cr, uid, proc_ids, context=context):
122 values = self._get_values_from_line(cr, uid, move, line, db_data_dict, context=context)
123+ if context.get('do_not_process_incoming') and line.pack_info_id:
124+ # we are processing auto import IN, we must register pack_info data
125+ values['pack_info_id'] = line.pack_info_id.id
126+
127 if not values.get('product_qty', 0.00):
128 continue
129 # Check if we must re-compute the price of the product
130
131=== modified file 'bin/addons/finance/purchase.py'
132--- bin/addons/finance/purchase.py 2016-08-18 08:32:03 +0000
133+++ bin/addons/finance/purchase.py 2018-09-05 07:53:26 +0000
134@@ -63,5 +63,20 @@
135 res.update({'value': v})
136 return res
137
138+ def check_close_cv(self, cr, uid, po_id, context=None):
139+ """
140+ If all lines of the PO in parameter have been invoiced and none of these invoices is still in Draft state,
141+ the Commitment Vouchers linked to the PO will be closed (i.e. line amounts and total set to 0.00 and state set to Done)
142+ """
143+ if context is None:
144+ context = {}
145+ if po_id:
146+ po = self.browse(cr, uid, po_id, fields_to_fetch=['order_type', 'state', 'invoice_ids'], context=context)
147+ po_states = ['done']
148+ if po.order_type == 'direct': # DPO use case: CV and SI are both created at DPO confirmation
149+ po_states = ['confirmed', 'confirmed_p', 'done']
150+ if po.state in po_states and all(x.state != 'draft' for x in po.invoice_ids):
151+ self._finish_commitment(cr, uid, [po.id], context=context)
152+
153 purchase_order()
154 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
155
156=== modified file 'bin/addons/msf_doc_import/purchase_order.py'
157--- bin/addons/msf_doc_import/purchase_order.py 2018-08-14 12:57:02 +0000
158+++ bin/addons/msf_doc_import/purchase_order.py 2018-09-05 07:53:26 +0000
159@@ -260,6 +260,7 @@
160
161 context.update({'auto_import_confirm_pol': True})
162 res = self.auto_import_purchase_order(cr, uid, file_path, context=context)
163+ context['rejected_confirmation'] = 0
164 if context.get('po_id'):
165 po = self.browse(cr, uid, context['po_id'], context=context)
166 nb_pol_confirmed = 0
167@@ -273,6 +274,7 @@
168 cr.commit()
169 nb_pol_confirmed += 1
170 except:
171+ context['rejected_confirmation'] += 1
172 cr.rollback()
173 self.infolog(cr, uid, _('%s :: not able to confirm line #%s') % (po.name, pol.line_number))
174 job_comment = context.get('job_comment', [])
175
176=== modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py'
177--- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-08-21 13:13:08 +0000
178+++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-09-05 07:53:26 +0000
179@@ -1425,13 +1425,14 @@
180 for line in self.browse(cr, uid, ids, context=context):
181 write_vals = {}
182
183- if line.po_line_id.state in ('confirmed', 'done', 'cancel', 'cancel_r'):
184- write_vals['type_change'] = 'error'
185- errors.append(_('PO line has been confirmed or cancelled and consequently is not editable'))
186-
187 # Comment
188 write_vals['imp_comment'] = values[15] and values[15].strip()
189
190+ if line.po_line_id.state in ('confirmed', 'done') or ( line.po_line_id.state in ('cancel', 'cancel_r') and write_vals['imp_comment'] != '[DELETE]'):
191+ write_vals['type_change'] = 'error'
192+ errors.append(_('PO line has been confirmed or cancelled and consequently is not editable'))
193+
194+
195 # External Ref.
196 write_vals['imp_external_ref'] = values[1]
197 pol_ids = None
198@@ -1671,6 +1672,14 @@
199 if line.po_line_id and line.type_change != 'ignore' and not line.change_ok and not line.imp_external_ref and not line.imp_project_ref and not line.imp_origin:
200 continue
201 if line.type_change in ('ignore', 'error'):
202+ if line.type_change == 'error':
203+ job_comment = context.get('job_comment', [])
204+ job_comment.append({
205+ 'res_model': 'purchase.order',
206+ 'res_id': line.simu_id.order_id.id,
207+ 'msg': _('%s: error on line %s %s') % (line.simu_id.order_id.name, line.in_line_number or line.imp_external_ref, line.error_msg),
208+ })
209+ context['job_comment'] = job_comment
210 continue
211
212 if line.type_change == 'del' and line.po_line_id:
213@@ -1764,7 +1773,7 @@
214 job_comment.append({
215 'res_model': 'purchase.order',
216 'res_id': line.simu_id.order_id.id,
217- 'msg': _('Line #%s has been split.') % line.parent_line_id.po_line_id.line_number,
218+ 'msg': _('%s: Line #%s has been split.') % (line.simu_id.order_id.name, line.parent_line_id.po_line_id.line_number),
219 })
220 context['job_comment'] = job_comment
221 elif line.type_change == 'new':
222@@ -1796,7 +1805,7 @@
223 job_comment.append({
224 'res_model': 'purchase.order',
225 'res_id': line.simu_id.order_id.id,
226- 'msg': _('New line #%s created.') % new_line_numb,
227+ 'msg': _('%s: New line #%s created.') % (line.simu_id.order_id.name, new_line_numb),
228 })
229 context['job_comment'] = job_comment
230 elif line.po_line_id:
231
232=== modified file 'bin/addons/msf_outgoing/wizard/picking_processor.py'
233--- bin/addons/msf_outgoing/wizard/picking_processor.py 2018-08-07 09:06:24 +0000
234+++ bin/addons/msf_outgoing/wizard/picking_processor.py 2018-09-05 07:53:26 +0000
235@@ -213,62 +213,18 @@
236 continue
237
238 line_data = line_obj._get_line_data(cr, uid, wizard, move, context=context)
239-
240- if line_obj._name == 'stock.move.in.processor':
241- # search for simulation done for this move, and if has pack info attached
242- sm_in_proc = line_obj.search(cr, uid, [('move_id', '=', move.id)], order='id desc', context=context)
243-
244- link_data = {}
245- if not sm_in_proc:
246- # search stock.incoming.processor for the move.picking_id
247- if move.purchase_line_id.id:
248- stock_move_ids = self.pool.get('stock.move').search(cr, uid, [('purchase_line_id', '=', move.purchase_line_id.id)], context=context)
249- picking_ids = [data['picking_id'][0] for data in self.pool.get('stock.move').read(cr, uid, stock_move_ids, ['picking_id']) if data['picking_id']]
250- picking_ids = list(set(picking_ids))
251-
252- for in_proc_id in self.pool.get('stock.incoming.processor').search(cr, uid, [('picking_id', 'in', picking_ids)], order='id desc', context=context):
253- # search for stock.move.in.processor with same wizard_id and line_number and with split_move_ok flag on
254- sm_in_proc = line_obj.search(cr, uid, [
255- ('wizard_id', '=', in_proc_id),
256- ('line_number', '=', move.line_number),
257- ('split_move_ok', '=', False),
258- ('pack_info_id', '!=', False),
259- ], order='id asc', context=context)
260- if sm_in_proc and context.get('picking_type') == 'incoming_shipment':
261- link_data = {'move_id': move.id}
262- break
263-
264- if not sm_in_proc and context.get('picking_type') == 'incoming_shipment' and move.picking_id and move.picking_id.origin:
265- # search backorder
266- picking_ids = self.pool.get('stock.picking').search(cr, uid, [('origin', '=', move.picking_id.origin), ('id', '!=', move.picking_id.id)])
267-
268- for in_proc_id in self.pool.get('stock.incoming.processor').search(cr, uid, [('picking_id', 'in', picking_ids)], order='id desc', context=context):
269- # search for stock.move.in.processor with same wizard_id and line_number and with split_move_ok flag on
270- sm_in_proc = line_obj.search(cr, uid, [
271- ('wizard_id', '=', in_proc_id),
272- ('line_number', '=', move.line_number),
273- ('split_move_ok', '=', False),
274- ('pack_info_id', '!=', False),
275- ], order='id asc', context=context)
276- if sm_in_proc and context.get('picking_type') == 'incoming_shipment':
277- link_data = {'move_id': move.id}
278- break
279-
280- for sm_in_proc in line_obj.browse(cr, uid, sm_in_proc, context=context):
281- if sm_in_proc.pack_info_id:
282- line_data.update({
283- 'from_pack': sm_in_proc.pack_info_id.parcel_from,
284- 'to_pack': sm_in_proc.pack_info_id.parcel_to,
285- 'weight': sm_in_proc.pack_info_id.total_weight,
286- 'volume': sm_in_proc.pack_info_id.total_volume,
287- 'height': sm_in_proc.pack_info_id.total_height,
288- 'length': sm_in_proc.pack_info_id.total_length,
289- 'width': sm_in_proc.pack_info_id.total_width,
290- 'cost': sm_in_proc.cost,
291- })
292- if link_data:
293- line_obj.write(cr, uid, [sm_in_proc.id], link_data, context=context)
294- break
295+ if line_obj._name == 'stock.move.in.processor' and move.pack_info_id:
296+ line_data.update({
297+ 'from_pack': move.pack_info_id.parcel_from,
298+ 'to_pack': move.pack_info_id.parcel_to,
299+ 'weight': move.pack_info_id.total_weight,
300+ 'volume': move.pack_info_id.total_volume,
301+ 'height': move.pack_info_id.total_height,
302+ 'length': move.pack_info_id.total_length,
303+ 'width': move.pack_info_id.total_width,
304+ 'cost': move.price_unit,
305+ 'currency': move.currency_id.id,
306+ })
307 line_obj.create(cr, uid, line_data, context=context)
308
309 return True
310@@ -849,7 +805,6 @@
311 'currency': move.price_currency_id.id,
312 'location_id': move.location_id and move.location_id.id,
313 }
314-
315 return line_data
316
317 def split(self, cr, uid, ids, new_qty=0.00, uom_id=False, context=None):
318
319=== modified file 'bin/addons/msf_printed_documents/report/report_reception.py'
320--- bin/addons/msf_printed_documents/report/report_reception.py 2017-12-19 10:34:23 +0000
321+++ bin/addons/msf_printed_documents/report/report_reception.py 2018-09-05 07:53:26 +0000
322@@ -21,6 +21,8 @@
323
324 import time
325 from report import report_sxw
326+from tools.translate import _
327+
328
329 class report_reception(report_sxw.rml_parse):
330 def __init__(self, cr, uid, name, context=None):
331@@ -75,59 +77,45 @@
332 warn = ''
333 tab = []
334 if kc_flag or dg_flag:
335- warn += 'You are about to receive'
336+ warn += _('You are about to receive')
337 if kc_flag :
338- tab.append('heat sensitive')
339+ tab.append(_(' heat sensitive'))
340 if dg_flag :
341- tab.append('dangerous')
342+ tab.append(_(' dangerous'))
343 if len(tab) > 0 :
344- if len(tab) ==1:
345- warn += ' ' + tab[0]
346+ if len(tab) == 1:
347+ warn += tab[0]
348 elif len(tab) == 2:
349- warn += ' ' + tab[0] + ' and ' + tab[1]
350+ warn += tab[0] + _(' and') + tab[1]
351 elif len(tab) == 3:
352- warn += ' ' + tab[0] + ', ' + tab[1] + ' and ' + tab[2]
353+ warn += tab[0] + ', ' + tab[1] + _(' and') + tab[2]
354 if warn:
355- warn += ' goods products, please refer to the appropriate procedures'
356+ warn += _(' goods products, please refer to the appropriate procedures')
357 return warn
358
359 def getQtyPO(self,line):
360 # line amount from the PO, always the same on all INs for a given PO
361- val = line.product_qty
362+ val = 0
363+ if line.state in ('assigned', 'confirmed', 'done'):
364+ val = line.product_qty
365 return "{0:.2f}".format(val)
366
367 def getQtyBO(self,line,o):
368- # Back Order amount = PO amount - all receipts
369-
370- # get PO qty
371- initial_qty = line.product_qty
372- # get received qty (current and previous INs)
373- cr, uid = self.cr, self.uid
374- val = 0.00
375- stock_move_obj = self.pool.get('stock.move')
376- closed_move_ids = stock_move_obj.search(cr, uid, [('purchase_line_id','=',line.purchase_line_id.id),('state','=','done'),('type','=','in')])
377- if closed_move_ids:
378- stock_moves = stock_move_obj.browse(cr, uid, closed_move_ids)
379- if stock_moves:
380- for move in stock_moves:
381- val = val + move.product_qty
382-
383- qtyBO = initial_qty - val
384- if qtyBO <= 0:
385- qtyBO = 0
386-
387- return "{0:.2f}".format(qtyBO)
388+ bo_qty = 0
389+ if line.state in ('assigned', 'shipped', 'confirmed'):
390+ bo_qty = line.product_qty
391+
392+ return "{0:.2f}".format(bo_qty)
393
394 def getQtyIS(self, line, o):
395 # Amount received in this IN only
396 # REF-96: Don't count the shipped available IN
397
398- if line.state in ('cancel') or o.state in ('cancel'):
399+ val = 0
400+ if line.state == 'done':
401+ val = line.product_qty
402+ elif line.state in ('cancel') or o.state in ('cancel'):
403 return '0' # US_275 Return 0 for cancel lines
404- elif o.state in ('assigned', 'shipped'):
405- val = 0
406- else:
407- val = line.product_qty
408
409 if val == 0:
410 return ' ' # display blank instead 0
411
412=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
413--- bin/addons/msf_profile/i18n/fr_MF.po 2018-08-22 15:47:29 +0000
414+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-09-05 07:53:26 +0000
415@@ -90065,7 +90065,7 @@
416 #: code:addons/msf_tools/automated_import_job.py:414
417 #, python-format
418 msgid " and "
419-msgstr " and "
420+msgstr " et "
421
422 #. module: register_accounting
423 #: report:addons/register_accounting/report/cheque_inventory_xls.mako:132
424@@ -101829,3 +101829,34 @@
425 #, python-format
426 msgid "FP date"
427 msgstr "Date du FP"
428+
429+#. module: msf_printed_documents
430+#: code:addons/msf_printed_documents/report/report_reception.py:80
431+#, python-format
432+msgid "You are about to receive"
433+msgstr "Vous êtes sur le point de recevoir des marchandises"
434+
435+#. module: msf_printed_documents
436+#: code:addons/msf_printed_documents/report/report_reception.py:82
437+#, python-format
438+msgid " heat sensitive"
439+msgstr " sensibles à la chaleur"
440+
441+#. module: msf_printed_documents
442+#: code:addons/msf_printed_documents/report/report_reception.py:89
443+#: code:addons/msf_printed_documents/report/report_reception.py:91
444+#, python-format
445+msgid " and"
446+msgstr " et"
447+
448+#. module: msf_printed_documents
449+#: code:addons/msf_printed_documents/report/report_reception.py:84
450+#, python-format
451+msgid " dangerous"
452+msgstr " dangeureuses"
453+
454+#. module: msf_printed_documents
455+#: code:addons/msf_printed_documents/report/report_reception.py:93
456+#, python-format
457+msgid " goods products, please refer to the appropriate procedures"
458+msgstr " veuillez vous référer aux procédures adéquates."
459
460=== modified file 'bin/addons/msf_tools/automated_import_job.py'
461--- bin/addons/msf_tools/automated_import_job.py 2018-07-18 08:34:06 +0000
462+++ bin/addons/msf_tools/automated_import_job.py 2018-09-05 07:53:26 +0000
463@@ -401,7 +401,12 @@
464 line_message = _('Line %s: ') % resjected_line[0]
465 line_message += resjected_line[2]
466 error_message.append(line_message)
467- self.infolog(cr, uid, _('%s :: Import job done with %s records processed and %s rejected') % (job.import_id.name, len(processed), len(rejected)))
468+
469+ if context.get('rejected_confirmation'):
470+ nb_rejected += context.get('rejected_confirmation')
471+ state = 'error'
472+
473+ self.infolog(cr, uid, _('%s :: Import job done with %s records processed and %s rejected') % (job.import_id.name, len(processed), nb_rejected))
474
475 if job.import_id.function_id.model_id.model == 'purchase.order':
476 po_id = self.pool.get('purchase.order').get_po_id_from_file(cr, uid, oldest_file, context=context)
477
478=== modified file 'bin/addons/purchase/purchase_order.py'
479--- bin/addons/purchase/purchase_order.py 2018-08-08 08:13:10 +0000
480+++ bin/addons/purchase/purchase_order.py 2018-09-05 07:53:26 +0000
481@@ -115,6 +115,14 @@
482 purchase.order_type in ['donation_exp', 'donation_st', 'loan', 'in_kind']):
483 res[purchase.id] = purchase.shipped_rate
484 else:
485+ # if all PO lines have been invoiced and the SI aren't in Draft anymore: invoiced rate must be 100%
486+ # (event if some SI amounts have been lowered)
487+ po_states = ['done']
488+ if purchase.order_type == 'direct': # DPO use case: CV and SI are both created at DPO confirmation
489+ po_states = ['confirmed', 'confirmed_p', 'done']
490+ if purchase.state in po_states and all(x.state != 'draft' for x in purchase.invoice_ids):
491+ res[purchase.id] = 100.0
492+ continue
493 tot = 0.0
494 # UTP-808: Deleted invoices amount should be taken in this process. So what we do:
495 # 1/ Take all closed stock picking linked to the purchase
496
497=== modified file 'bin/addons/purchase/purchase_view.xml'
498--- bin/addons/purchase/purchase_view.xml 2018-08-17 15:15:35 +0000
499+++ bin/addons/purchase/purchase_view.xml 2018-09-05 07:53:26 +0000
500@@ -188,16 +188,16 @@
501 <field name="origin" readonly="1" widget="char"/>
502 <field name="internal_type" string="Zone"/>
503 <field name="customer_ref" widget="char"/>
504- <group colspan="2" col="3">
505- <field name="stock_take_date" attrs="{'readonly': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}" />
506- <button colspan="1" name="update_date" string="Update Lines" type="object" context="{'field_name': 'stock_take', 'type': 'purchase.order'}" icon="gtk-indent" attrs="{'invisible': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}"/>
507- </group>
508+ <field name="from_address" domain="[('partner_id', '=', company_id)]" attrs="{'readonly': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}"/>
509 <group colspan="2" col="3">
510 <field name="no_line" invisible="1"/>
511 <field name="pricelist_id" string="Currency" colspan="2" attrs="{'readonly': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}" domain="[('type', '=', 'purchase'), ('in_search', '=', partner_type)]"/>
512 <button name="change_currency" string="Change currency" icon="terp-dolar" type="object" attrs="{'invisible': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}"/>
513 </group>
514- <field name="from_address" domain="[('partner_id', '=', company_id)]" attrs="{'readonly': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}"/>
515+ <group colspan="2" col="3">
516+ <field name="stock_take_date" attrs="{'readonly': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}" />
517+ <button colspan="1" name="update_date" string="Update Lines" type="object" context="{'field_name': 'stock_take', 'type': 'purchase.order'}" icon="gtk-indent" attrs="{'invisible': [('state', 'not in', ['draft', 'draft_p', 'validated'])]}"/>
518+ </group>
519 <button colspan="4" string="Round Qty to SoQ" type="object" name="round_to_soq" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'draft')]}"/>
520 </group>
521 <group name="import" string=" Import Lines " colspan="1" col="4" attrs="{'invisible':[('state', '!=', 'draft')]}">
522
523=== modified file 'bin/addons/purchase/wizard/purchase_line_cancel.py'
524--- bin/addons/purchase/wizard/purchase_line_cancel.py 2018-04-20 08:38:08 +0000
525+++ bin/addons/purchase/wizard/purchase_line_cancel.py 2018-09-05 07:53:26 +0000
526@@ -42,6 +42,7 @@
527 ids = [ids]
528
529 pol_obj = self.pool.get('purchase.order.line')
530+ po_obj = self.pool.get('purchase.order')
531 wf_service = netsvc.LocalService("workflow")
532
533 # cancel line:
534@@ -57,6 +58,10 @@
535 and p_order.partner_type == 'external' and p_order.state == 'confirmed':
536 pol_obj.create_counterpart_fo_for_external_partner_po(cr, uid, p_order, context=context)
537
538+ # check if the related CV should be set to Done
539+ if p_order:
540+ po_obj.check_close_cv(cr, uid, p_order.id, context=context)
541+
542 return {'type': 'ir.actions.act_window_close'}
543
544 def cancel_only_pol(self, cr, uid, ids, context=None):
545
546=== modified file 'bin/addons/purchase_override/purchase.py'
547--- bin/addons/purchase_override/purchase.py 2018-04-20 14:37:59 +0000
548+++ bin/addons/purchase_override/purchase.py 2018-09-05 07:53:26 +0000
549@@ -433,6 +433,9 @@
550 if resource and pol.linked_sol_id:
551 signal = 'cancel_r'
552 wf_service.trg_validate(uid, 'purchase.order.line', pol.id, signal, cr)
553+ # check if the related CV should be set to Done
554+ if po:
555+ self.pool.get('purchase.order').check_close_cv(cr, uid, po.id, context=context)
556
557 return {'type': 'ir.actions.act_window_close'}
558
559
560=== modified file 'bin/addons/purchase_override/report/merged_order.rml'
561--- bin/addons/purchase_override/report/merged_order.rml 2018-08-20 15:39:49 +0000
562+++ bin/addons/purchase_override/report/merged_order.rml 2018-09-05 07:53:26 +0000
563@@ -28,6 +28,9 @@
564 <blockTableStyle id="OrderInformations">
565 <blockAlignment value="LEFT" />
566 <blockVAlign value="MIDDLE" />
567+ <blockLeading length="0" />
568+ <blockBottomPadding length="1" />
569+ <blockTopPadding length="1" />
570 <lineStyle kind="OUTLINE" colorName="black" start="0,0" stop="0,-1" thickness="0.5" />
571 <lineStyle kind="OUTLINE" colorName="black" start="2,0" stop="2,-1" thickness="0.5" />
572 <lineStyle kind="OUTLINE" colorName="black" start="4,0" stop="4,-1" thickness="0.5" />
573@@ -80,8 +83,9 @@
574 <paraStyle name="Header_9" fontName="Helvetica-Bold" fontSize="8.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0" />
575 <paraStyle name="HeaderBlue" textColor="blue" fontName="Helvetica-Bold" fontSize="13.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="35.0" />
576 <!-- Information font style -->
577- <paraStyle name="TextInformation" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="1.0" spaceAfter="1.0" />
578- <paraStyle name="TextInformationMail" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="1.0" spaceAfter="1.0" />
579+ <paraStyle name="TextInformationH" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="3.0" spaceBefore="0" spaceAfter="0" />
580+ <paraStyle name="TextInformation" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="0" spaceAfter="0" />
581+ <paraStyle name="TextInformationMail" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="0" spaceAfter="0" />
582 <paraStyle name="TextRemarks" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="15.0" spaceBefore="1.0" spaceAfter="1.0" />
583 <!-- Lines font style -->
584 <paraStyle name="Lines" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" />
585@@ -95,36 +99,36 @@
586 <blockTable colWidths="90.0,600.0,100.0" style="Origin">
587 <tr>
588 <td>
589- <para style="TextInformation">Source Document :</para>
590- </td>
591- <td>
592- <para style="TextInformation">[[ getOrigin(objects[0].origin, 5)[0] ]]</para>
593- </td>
594- <td>
595- <para style="TextInformation"> </para>
596+ <para style="TextInformationH">Source Document :</para>
597+ </td>
598+ <td>
599+ <para style="TextInformationH">[[ getOrigin(objects[0].origin, 5)[0] ]]</para>
600+ </td>
601+ <td>
602+ <para style="TextInformationH"> </para>
603 </td>
604 </tr>
605 <tr>
606 <td>
607- <para style="TextInformation">Customer reference :</para>
608- </td>
609- <td>
610- <para style="TextInformation">[[ objects[0].customer_ref ]]</para>
611- </td>
612- <td>
613- <para style="TextInformation"> </para>
614+ <para style="TextInformationH">Customer reference :</para>
615+ </td>
616+ <td>
617+ <para style="TextInformationH">[[ objects[0].customer_ref ]]</para>
618+ </td>
619+ <td>
620+ <para style="TextInformationH"> </para>
621 </td>
622 </tr>
623 <tr>
624 [[ repeatIn(getOrigin(objects[0].origin, 5)[1:], 'orig') ]]
625 <td>
626- <para style="TextInformation"> </para>
627- </td>
628- <td>
629- <para style="TextInformation">[[ orig ]]</para>
630- </td>
631- <td>
632- <para style="TextInformation"> </para>
633+ <para style="TextInformationH"> </para>
634+ </td>
635+ <td>
636+ <para style="TextInformationH">[[ orig ]]</para>
637+ </td>
638+ <td>
639+ <para style="TextInformationH"> </para>
640 </td>
641 </tr>
642 <tr>
643
644=== modified file 'bin/addons/purchase_override/report/purchase_order.rml'
645--- bin/addons/purchase_override/report/purchase_order.rml 2018-08-20 15:39:49 +0000
646+++ bin/addons/purchase_override/report/purchase_order.rml 2018-09-05 07:53:26 +0000
647@@ -29,6 +29,9 @@
648 <blockTableStyle id="OrderInformations">
649 <blockAlignment value="LEFT" />
650 <blockVAlign value="MIDDLE" />
651+ <blockLeading length="0" />
652+ <blockBottomPadding length="1" />
653+ <blockTopPadding length="1" />
654 <lineStyle kind="OUTLINE" colorName="black" start="0,0" stop="0,-1" thickness="0.5" />
655 <lineStyle kind="OUTLINE" colorName="black" start="2,0" stop="2,-1" thickness="0.5" />
656 <lineStyle kind="OUTLINE" colorName="black" start="4,0" stop="4,-1" thickness="0.5" />
657@@ -81,8 +84,10 @@
658 <paraStyle name="Header_9" fontName="Helvetica-Bold" fontSize="8.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="3.0" />
659 <paraStyle name="HeaderBlue" textColor="blue" fontName="Helvetica-Bold" fontSize="13.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="35.0" />
660 <!-- Information font style -->
661- <paraStyle name="TextInformation" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="1.0" spaceAfter="1.0" />
662- <paraStyle name="TextInformationMail" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="1.0" spaceAfter="1.0" />
663+ <paraStyle name="TextInformationH" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="3.0" spaceBefore="1" spaceAfter="1" />
664+ <paraStyle name="TextInformation" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="0" spaceAfter="0" />
665+ <paraStyle name="TextInformation1" fontName="Helvetica" fontSize="1.0" alignment="LEFT" leading="1.0" spaceBefore="0" spaceAfter="0" />
666+ <paraStyle name="TextInformationMail" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" spaceBefore="0" spaceAfter="0" />
667 <paraStyle name="TextRemarks" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="15.0" spaceBefore="1.0" spaceAfter="1.0" />
668 <!-- Lines font style -->
669 <paraStyle name="Lines" fontName="Helvetica" fontSize="7.0" alignment="LEFT" leading="7.0" />
670@@ -96,36 +101,36 @@
671 <blockTable colWidths="90.0,582.0,100.0" style="Origin">
672 <tr>
673 <td>
674- <para style="TextInformation">Source Document :</para>
675- </td>
676- <td>
677- <para style="TextInformation">[[ getOrigin(objects[0].origin, 5)[0] ]]</para>
678- </td>
679- <td>
680- <para style="TextInformation"> </para>
681+ <para style="TextInformationH">Source Document :</para>
682+ </td>
683+ <td>
684+ <para style="TextInformationH">[[ getOrigin(objects[0].origin, 5)[0] ]]</para>
685+ </td>
686+ <td>
687+ <para style="TextInformationH"> </para>
688 </td>
689 </tr>
690 <tr>
691 <td>
692- <para style="TextInformation">Customer reference :</para>
693- </td>
694- <td>
695- <para style="TextInformation">[[ objects[0].customer_ref ]]</para>
696- </td>
697- <td>
698- <para style="TextInformation"> </para>
699+ <para style="TextInformationH">Customer reference :</para>
700+ </td>
701+ <td>
702+ <para style="TextInformationH">[[ objects[0].customer_ref ]]</para>
703+ </td>
704+ <td>
705+ <para style="TextInformationH"> </para>
706 </td>
707 </tr>
708 <tr>
709 [[ repeatIn(getOrigin(objects[0].origin, 5)[1:], 'orig') ]]
710 <td>
711- <para style="TextInformation"> </para>
712- </td>
713- <td>
714- <para style="TextInformation">[[ orig ]]</para>
715- </td>
716- <td>
717- <para style="TextInformation"> </para>
718+ <para style="TextInformationH"> </para>
719+ </td>
720+ <td>
721+ <para style="TextInformationH">[[ orig ]]</para>
722+ </td>
723+ <td>
724+ <para style="TextInformationH"> </para>
725 </td>
726 </tr>
727 <tr>
728@@ -141,25 +146,25 @@
729 <para style="TextInformation">Project : [[ objects[0].company_id.partner_id.name ]]</para>
730 </td>
731 <td>
732- <para style="TextInformation"> </para>
733+ <para style="TextInformation1"> </para>
734 </td>
735 <td>
736 <para style="TextInformation"><u>From</u> :</para>
737 </td>
738 <td>
739- <para style="TextInformation"> </para>
740+ <para style="TextInformation1"> </para>
741 </td>
742 <td>
743 <para style="TextInformation"><u>To (Supplier)</u> :</para>
744 </td>
745 <td>
746- <para style="TextInformation"> </para>
747+ <para style="TextInformation1"> </para>
748 </td>
749 <td>
750 <para style="TextInformation"><u>Ship to</u>[[ objects[0].incoterm_id and ' (%s)' % objects[0].incoterm_id.name or '' ]] :</para>
751 </td>
752 <td>
753- <para style="TextInformation"> </para>
754+ <para style="TextInformation1"> </para>
755 </td>
756 <td>
757 <para style="TextInformation"><u>Invoice to</u> :</para>
758@@ -199,25 +204,25 @@
759 <para style="TextInformation">Category : [[ getSel(objects[0], 'categ') ]] </para>
760 </td>
761 <td>
762- <para style="TextInformation"> </para>
763+ <para style="TextInformation1"> </para>
764 </td>
765 <td>
766 <para style="TextInformation">[[ objects[0].from_address.office_name or objects[0].from_address.partner_id.name or objects[0].partner_id.name or '' ]]</para>
767 </td>
768 <td>
769- <para style="TextInformation"> </para>
770+ <para style="TextInformation1"> </para>
771 </td>
772 <td>
773 <parawrap style="TextInformation">[[ (objects[0].partner_address_id.office_name or objects[0].partner_address_id.partner_id.name or objects[0].partner_id.name or '')[0:100] ]]</parawrap>
774 </td>
775 <td>
776- <para style="TextInformation"> </para>
777+ <para style="TextInformation1"> </para>
778 </td>
779 <td>
780 <para style="TextInformation">[[ objects[0].dest_address_id.office_name or objects[0].dest_address_id.partner_id.name or objects[0].partner_id.name ]]</para>
781 </td>
782 <td>
783- <para style="TextInformation"> </para>
784+ <para style="TextInformation1"> </para>
785 </td>
786 <td>
787 <para style="TextInformation">[[ objects[0].invoice_address_id.office_name or objects[0].invoice_address_id.partner_id.name or objects[0].company_id.partner_id.name ]] </para>
788@@ -228,25 +233,25 @@
789 <para style="TextInformation">Total Lines : [[ len([x for x in objects[0].order_line if x.state not in ('cancel', 'cancel_r')]) ]]</para>
790 </td>
791 <td>
792- <para style="TextInformation"> </para>
793+ <para style="TextInformation1"> </para>
794 </td>
795 <td>
796 <para style="TextInformation">[[ objects[0].from_address and objects[0].from_address.street or '' ]]</para>
797 </td>
798 <td>
799- <para style="TextInformation"> </para>
800+ <para style="TextInformation1"> </para>
801 </td>
802 <td>
803 <para style="TextInformation">[[ objects[0].partner_address_id.street ]]</para>
804 </td>
805 <td>
806- <para style="TextInformation"> </para>
807+ <para style="TextInformation1"> </para>
808 </td>
809 <td>
810 <para style="TextInformation">[[ objects[0].dest_address_id.street ]]</para>
811 </td>
812 <td>
813- <para style="TextInformation"> </para>
814+ <para style="TextInformation1"> </para>
815 </td>
816 <td>
817 <para style="TextInformation">[[ objects[0].invoice_address_id.street ]]</para>
818@@ -257,25 +262,25 @@
819 <para style="TextInformation">Transport mode : [[ getSel(objects[0], 'transport_type') ]]</para>
820 </td>
821 <td>
822- <para style="TextInformation"> </para>
823+ <para style="TextInformation1"> </para>
824 </td>
825 <td>
826 <para style="TextInformation">[[ objects[0].from_address and objects[0].from_address.street2 or '' ]]</para>
827 </td>
828 <td>
829- <para style="TextInformation"> </para>
830+ <para style="TextInformation1"> </para>
831 </td>
832 <td>
833 <para style="TextInformation">[[ objects[0].partner_address_id.street2 ]]</para>
834 </td>
835 <td>
836- <para style="TextInformation"> </para>
837+ <para style="TextInformation1"> </para>
838 </td>
839 <td>
840 <para style="TextInformation">[[ objects[0].dest_address_id.street2 ]]</para>
841 </td>
842 <td>
843- <para style="TextInformation"> </para>
844+ <para style="TextInformation1"> </para>
845 </td>
846 <td>
847 <para style="TextInformation">[[ objects[0].invoice_address_id.street2 ]]</para>
848@@ -286,25 +291,25 @@
849 <para style="TextInformation">Priority : [[ getSel(objects[0], 'priority') ]]</para>
850 </td>
851 <td>
852- <para style="TextInformation"> </para>
853+ <para style="TextInformation1"> </para>
854 </td>
855 <td>
856 <para style="TextInformation">[[ objects[0].from_address and objects[0].from_address.zip or '' ]] [[ objects[0].from_address and objects[0].from_address.city or '' ]]</para>
857 </td>
858 <td>
859- <para style="TextInformation"> </para>
860+ <para style="TextInformation1"> </para>
861 </td>
862 <td>
863 <para style="TextInformation">[[ objects[0].partner_address_id.zip ]] [[ objects[0].partner_address_id.city ]]</para>
864 </td>
865 <td>
866- <para style="TextInformation"> </para>
867+ <para style="TextInformation1"> </para>
868 </td>
869 <td>
870 <para style="TextInformation">[[ objects[0].dest_address_id.zip ]] [[ objects[0].dest_address_id.city ]]</para>
871 </td>
872 <td>
873- <para style="TextInformation"> </para>
874+ <para style="TextInformation1"> </para>
875 </td>
876 <td>
877 <para style="TextInformation">[[ objects[0].invoice_address_id.zip ]] [[ objects[0].invoice_address_id.city ]]</para>
878@@ -315,25 +320,25 @@
879 <para style="TextInformation"> </para>
880 </td>
881 <td>
882- <para style="TextInformation"> </para>
883+ <para style="TextInformation1"> </para>
884 </td>
885 <td>
886 <para style="TextInformation">[[ objects[0].from_address and objects[0].from_address.country_id and objects[0].from_address.country_id.name or '' ]]</para>
887 </td>
888 <td>
889- <para style="TextInformation"> </para>
890+ <para style="TextInformation1"> </para>
891 </td>
892 <td>
893 <para style="TextInformation">[[ objects[0].partner_address_id.country_id.name or '' ]]</para>
894 </td>
895 <td>
896- <para style="TextInformation"> </para>
897+ <para style="TextInformation1"> </para>
898 </td>
899 <td>
900 <para style="TextInformation">[[ objects[0].dest_address_id.country_id and objects[0].dest_address_id.country_id.name or '' ]]</para>
901 </td>
902 <td>
903- <para style="TextInformation"> </para>
904+ <para style="TextInformation1"> </para>
905 </td>
906 <td>
907 <para style="TextInformation">[[ objects[0].invoice_address_id.country_id and objects[0].invoice_address_id.country_id.name or '' ]]</para>
908@@ -344,25 +349,25 @@
909 <para style="TextInformation">Goods value : [[ objects[0].amount_untaxed or '0.00' ]]</para>
910 </td>
911 <td>
912- <para style="TextInformation"> </para>
913+ <para style="TextInformation1"> </para>
914 </td>
915 <td>
916 <para style="TextInformation">[[ objects[0].from_address and objects[0].from_address.phone or '' ]]</para>
917 </td>
918 <td>
919- <para style="TextInformation"> </para>
920+ <para style="TextInformation1"> </para>
921 </td>
922 <td>
923 <para style="TextInformation">[[ objects[0].partner_address_id.phone ]]</para>
924 </td>
925 <td>
926- <para style="TextInformation"> </para>
927+ <para style="TextInformation1"> </para>
928 </td>
929 <td>
930 <para style="TextInformation">[[ objects[0].dest_address_id.phone ]]</para>
931 </td>
932 <td>
933- <para style="TextInformation"> </para>
934+ <para style="TextInformation1"> </para>
935 </td>
936 <td>
937 <para style="TextInformation">[[ objects[0].invoice_address_id.phone ]]</para>
938@@ -373,25 +378,25 @@
939 <para style="TextInformation">Tax amount : [[ objects[0].amount_tax or '0.00' ]]</para>
940 </td>
941 <td>
942- <para style="TextInformation"> </para>
943+ <para style="TextInformation1"> </para>
944 </td>
945 <td>
946 <parawrap style="TextInformationMail">[[ objects[0].from_address and objects[0].from_address.email or '' ]]</parawrap>
947 </td>
948 <td>
949- <para style="TextInformation"> </para>
950+ <para style="TextInformation1"> </para>
951 </td>
952 <td>
953 <parawrap style="TextInformationMail">[[ objects[0].partner_address_id.email ]]</parawrap>
954 </td>
955 <td>
956- <para style="TextInformation"> </para>
957+ <para style="TextInformation1"> </para>
958 </td>
959 <td>
960 <parawrap style="TextInformationMail">[[ objects[0].dest_address_id.email ]]</parawrap>
961 </td>
962 <td>
963- <para style="TextInformation"> </para>
964+ <para style="TextInformation1"> </para>
965 </td>
966 <td>
967 <parawrap style="TextInformationMail">[[ objects[0].invoice_address_id.email ]]</parawrap>
968@@ -402,28 +407,28 @@
969 <parawrap style="TextInformation">Transport cost : [[ objects[0].transport_cost or '0.00' ]]</parawrap>
970 </td>
971 <td>
972- <para style="TextInformation"> </para>
973- </td>
974- <td>
975- <para style="TextInformation"> </para>
976- </td>
977- <td>
978- <para style="TextInformation"> </para>
979- </td>
980- <td>
981- <para style="TextInformation"> </para>
982- </td>
983- <td>
984- <para style="TextInformation"> </para>
985- </td>
986- <td>
987- <para style="TextInformation"> </para>
988- </td>
989- <td>
990- <para style="TextInformation"> </para>
991- </td>
992- <td>
993- <para style="TextInformation"> </para>
994+ <para style="TextInformation1"> </para>
995+ </td>
996+ <td>
997+ <para style="TextInformation1"> </para>
998+ </td>
999+ <td>
1000+ <para style="TextInformation1"> </para>
1001+ </td>
1002+ <td>
1003+ <para style="TextInformation1"> </para>
1004+ </td>
1005+ <td>
1006+ <para style="TextInformation1"> </para>
1007+ </td>
1008+ <td>
1009+ <para style="TextInformation1"> </para>
1010+ </td>
1011+ <td>
1012+ <para style="TextInformation1"> </para>
1013+ </td>
1014+ <td>
1015+ <para style="TextInformation1"> </para>
1016 </td>
1017 </tr>
1018 <tr>
1019@@ -431,28 +436,28 @@
1020 <para style="TextInformation">Total cost : [[ objects[0].total_price_include_transport or '0.00' ]]</para>
1021 </td>
1022 <td>
1023- <para style="TextInformation"> </para>
1024- </td>
1025- <td>
1026- <para style="TextInformation"> </para>
1027- </td>
1028- <td>
1029- <para style="TextInformation"> </para>
1030- </td>
1031- <td>
1032- <para style="TextInformation"> </para>
1033- </td>
1034- <td>
1035- <para style="TextInformation"> </para>
1036- </td>
1037- <td>
1038- <para style="TextInformation"> </para>
1039- </td>
1040- <td>
1041- <para style="TextInformation"> </para>
1042- </td>
1043- <td>
1044- <para style="TextInformation"> </para>
1045+ <para style="TextInformation1"> </para>
1046+ </td>
1047+ <td>
1048+ <para style="TextInformation1"> </para>
1049+ </td>
1050+ <td>
1051+ <para style="TextInformation1"> </para>
1052+ </td>
1053+ <td>
1054+ <para style="TextInformation1"> </para>
1055+ </td>
1056+ <td>
1057+ <para style="TextInformation1"> </para>
1058+ </td>
1059+ <td>
1060+ <para style="TextInformation1"> </para>
1061+ </td>
1062+ <td>
1063+ <para style="TextInformation1"> </para>
1064+ </td>
1065+ <td>
1066+ <para style="TextInformation1"> </para>
1067 </td>
1068 </tr>
1069 <tr>
1070@@ -461,28 +466,28 @@
1071 <para style="TextInformation"> </para>
1072 </td>
1073 <td>
1074- <para style="TextInformation"> </para>
1075- </td>
1076- <td>
1077- <para style="TextInformation"> </para>
1078- </td>
1079- <td>
1080- <para style="TextInformation"> </para>
1081- </td>
1082- <td>
1083- <para style="TextInformation"> </para>
1084- </td>
1085- <td>
1086- <para style="TextInformation"> </para>
1087- </td>
1088- <td>
1089- <para style="TextInformation"> </para>
1090- </td>
1091- <td>
1092- <para style="TextInformation"> </para>
1093- </td>
1094- <td>
1095- <para style="TextInformation"> </para>
1096+ <para style="TextInformation1"> </para>
1097+ </td>
1098+ <td>
1099+ <para style="TextInformation1"> </para>
1100+ </td>
1101+ <td>
1102+ <para style="TextInformation1"> </para>
1103+ </td>
1104+ <td>
1105+ <para style="TextInformation1"> </para>
1106+ </td>
1107+ <td>
1108+ <para style="TextInformation1"> </para>
1109+ </td>
1110+ <td>
1111+ <para style="TextInformation1"> </para>
1112+ </td>
1113+ <td>
1114+ <para style="TextInformation1"> </para>
1115+ </td>
1116+ <td>
1117+ <para style="TextInformation1"> </para>
1118 </td>
1119 </tr>
1120 <tr>
1121@@ -490,25 +495,25 @@
1122 <para style="TextInformation">Confirmed delivery date : </para>
1123 </td>
1124 <td>
1125- <para style="TextInformation"> </para>
1126+ <para style="TextInformation1"> </para>
1127 </td>
1128 <td>
1129 <para style="TextInformation">Date sent : </para>
1130 </td>
1131 <td>
1132- <para style="TextInformation"> </para>
1133+ <para style="TextInformation1"> </para>
1134 </td>
1135 <td>
1136 <para style="TextInformation">Date received : </para>
1137 </td>
1138 <td>
1139- <para style="TextInformation"> </para>
1140+ <para style="TextInformation1"> </para>
1141 </td>
1142 <td>
1143 <para style="TextInformation">Requested delivery date : </para>
1144 </td>
1145 <td>
1146- <para style="TextInformation"> </para>
1147+ <para style="TextInformation1"> </para>
1148 </td>
1149 <td>
1150 <para style="TextInformation">Dated before :</para>
1151@@ -517,33 +522,30 @@
1152 <tr>
1153 <td>
1154 <para style="TextInformation">[[ to_time(objects[0].delivery_confirmed_date) ]]</para>
1155- <para style="TextInformation"> </para>
1156- </td>
1157- <td>
1158- <para style="TextInformation"> </para>
1159- </td>
1160- <td>
1161- <para style="TextInformation">[[ to_time(objects[0].date_confirm) ]]</para>
1162- <para style="TextInformation"> </para>
1163- </td>
1164- <td>
1165- <para style="TextInformation"> </para>
1166- </td>
1167- <td>
1168- <para style="TextInformation"> </para>
1169- </td>
1170- <td>
1171- <para style="TextInformation"> </para>
1172+ </td>
1173+ <td>
1174+ <para style="TextInformation1"> </para>
1175+ </td>
1176+ <td>
1177+ <para style="TextInformation">[[ to_time(objects[0].date_confirm) ]]</para>
1178+ </td>
1179+ <td>
1180+ <para style="TextInformation1"> </para>
1181+ </td>
1182+ <td>
1183+ <para style="TextInformation1"> </para>
1184+ </td>
1185+ <td>
1186+ <para style="TextInformation1"> </para>
1187 </td>
1188 <td>
1189 <para style="TextInformation">[[ to_time(objects[0].delivery_requested_date) ]]</para>
1190- <para style="TextInformation"> </para>
1191- </td>
1192- <td>
1193- <para style="TextInformation"> </para>
1194- </td>
1195- <td>
1196- <para style="TextInformation"> </para>
1197+ </td>
1198+ <td>
1199+ <para style="TextInformation1"> </para>
1200+ </td>
1201+ <td>
1202+ <para style="TextInformation1"> </para>
1203 </td>
1204 </tr>
1205 </blockTable>
1206
1207=== modified file 'bin/addons/register_accounting/account_bank_statement.py'
1208--- bin/addons/register_accounting/account_bank_statement.py 2018-07-17 12:20:07 +0000
1209+++ bin/addons/register_accounting/account_bank_statement.py 2018-09-05 07:53:26 +0000
1210@@ -1910,7 +1910,7 @@
1211 process_invoice_move_line_ids = []
1212 total_payment = True
1213 diff = st_line.first_move_line_id.amount_currency - total_amount
1214- if abs(diff) > 0.001:
1215+ if len(st_line.imported_invoice_line_ids) > 1 and abs(diff) > 0.001:
1216 # multi unpartial payment
1217 total_payment = False
1218 # Delete them
1219
1220=== modified file 'bin/addons/register_accounting/report/report_fully_report.py'
1221--- bin/addons/register_accounting/report/report_fully_report.py 2018-06-15 09:18:20 +0000
1222+++ bin/addons/register_accounting/report/report_fully_report.py 2018-09-05 07:53:26 +0000
1223@@ -260,6 +260,15 @@
1224 color = 'red'
1225 return color
1226
1227-
1228-SpreadsheetReport('report.fully.report','account.bank.statement','addons/register_accounting/report/fully_report_xls.mako', parser=report_fully_report)
1229+class SpreadsheetReportX(SpreadsheetReport):
1230+ def create(self, cr, uid, ids, data, context=None):
1231+ if not context:
1232+ context = {}
1233+ context['pathit'] = True
1234+ return super(SpreadsheetReportX, self).create(cr, uid, ids, data, context=context)
1235+
1236+
1237+
1238+
1239+SpreadsheetReportX('report.fully.report','account.bank.statement','addons/register_accounting/report/fully_report_xls.mako', parser=report_fully_report)
1240 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1241
1242=== modified file 'bin/addons/res_currency_functional/account_move_compute_currency.py'
1243--- bin/addons/res_currency_functional/account_move_compute_currency.py 2017-12-21 16:34:38 +0000
1244+++ bin/addons/res_currency_functional/account_move_compute_currency.py 2018-09-05 07:53:26 +0000
1245@@ -164,14 +164,18 @@
1246 amount_currency = 0
1247 sorted_line_ids = move.line_id
1248 sorted_line_ids.sort(key=lambda x: abs(x.debit - x.credit), reverse=True)
1249+ all_line_zero_func = True
1250 for line in sorted_line_ids:
1251 amount += line.debit - line.credit
1252+ if all_line_zero_func:
1253+ # because of high fx rate, funct. amount could be 0 on all lines, we must not consider this case as func balanced
1254+ all_line_zero_func = abs(line.debit - line.credit) < 10**-4
1255 amount_currency += line.amount_currency
1256
1257 if move.period_id and not move.period_id.is_system \
1258 and len(sorted_line_ids) > 2:
1259- if abs(amount_currency) > 10 ** -4 and abs(amount) < 10 ** -4:
1260- # The move is balanced, but there is a difference in the converted amounts;
1261+ if not all_line_zero_func and abs(amount_currency) > 10 ** -4 and abs(amount) < 10 ** -4:
1262+ # The move is func. balanced, but there is a difference in the converted amounts;
1263 # the second-biggest move line is modified accordingly
1264 line_to_be_balanced = self._sub_sort_by_xmlid(cr, uid, sorted_line_ids)
1265 amount_currency = line_to_be_balanced.amount_currency - amount_currency
1266@@ -189,7 +193,7 @@
1267 if line_to_be_balanced.reconcile_id:
1268 reconcile[line_to_be_balanced.reconcile_id.id] = 1
1269 elif abs(amount) > 10 ** -4 and abs(amount_currency) < 10 ** -4:
1270- # The move is balanced, but there is a difference in the converted amounts;
1271+ # The move is book. balanced, but there is a difference in the converted amounts;
1272 # the second-biggest move line is modified accordingly
1273 line_to_be_balanced = self._sub_sort_by_xmlid(cr, uid, sorted_line_ids)
1274 amount = line_to_be_balanced.debit - line_to_be_balanced.credit - amount
1275
1276=== modified file 'bin/addons/spreadsheet_xml/spreadsheet_xml_write.py'
1277--- bin/addons/spreadsheet_xml/spreadsheet_xml_write.py 2017-10-09 21:06:10 +0000
1278+++ bin/addons/spreadsheet_xml/spreadsheet_xml_write.py 2018-09-05 07:53:26 +0000
1279@@ -2,6 +2,7 @@
1280
1281 from tools.translate import _
1282 from tools.misc import file_open
1283+from tools.misc import Path
1284 from osv import osv
1285 from report_webkit.webkit_report import WebKitParser
1286 from report import report_sxw
1287@@ -126,6 +127,10 @@
1288 os.unlink(tmpname)
1289 return (out, 'zip')
1290
1291+ if context.get('pathit'):
1292+ os.close(null)
1293+ return (Path(tmpname, delete=True), 'xls')
1294+
1295 out = file(tmpname, 'rb').read()
1296 os.close(null)
1297 os.unlink(tmpname)
1298
1299=== modified file 'bin/addons/stock/physical_inventory.py'
1300--- bin/addons/stock/physical_inventory.py 2018-07-05 08:44:50 +0000
1301+++ bin/addons/stock/physical_inventory.py 2018-09-05 07:53:26 +0000
1302@@ -1457,19 +1457,21 @@
1303 r = super(PhysicalInventoryDiscrepancy, self).write(cr, uid, ids, vals, context=context)
1304 move_obj = self.pool.get("stock.move")
1305
1306- lines = self.read(cr, uid, ids, ["move_id", "comment"], context=context)
1307+ lines = self.read(cr, uid, ids, ["move_id"], context=context)
1308
1309 for line in lines:
1310 if not line["move_id"]:
1311 continue
1312 reason_type_id = vals.get("reason_type_id", False)
1313- comment = vals.get("comment", False)
1314 to_update = {}
1315 if reason_type_id:
1316 to_update["reason_type_id"] = reason_type_id
1317- if comment:
1318- to_update["comment"] = comment
1319+ if 'comment' in vals:
1320+ to_update["comment"] = vals['comment']
1321+
1322 if to_update:
1323+ if '__last_update' in context:
1324+ context['__last_update'] = {}
1325 move_obj.write(cr, uid, [line["move_id"]], to_update, context=context)
1326
1327 return r

Subscribers

People subscribed via source and target branches