Merge lp:~dorian-kemps/unifield-server/US-6141 into lp:unifield-server

Proposed by jftempo on 2019-07-15
Status: Merged
Merged at revision: 5410
Proposed branch: lp:~dorian-kemps/unifield-server/US-6141
Merge into: lp:unifield-server
Diff against target: 83 lines (+20/-12)
2 files modified
bin/addons/msf_supply_doc_export/msf_supply_doc_export.py (+2/-3)
bin/addons/msf_supply_doc_export/wizard/po_follow_up.py (+18/-9)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-6141
Reviewer Review Type Date Requested Status
UniField Reviewer Team 2019-07-15 Pending
Review via email: mp+370099@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_supply_doc_export/msf_supply_doc_export.py'
2--- bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2019-05-22 11:20:42 +0000
3+++ bin/addons/msf_supply_doc_export/msf_supply_doc_export.py 2019-07-15 07:18:54 +0000
4@@ -759,7 +759,6 @@
5 # Background
6 if not self.localcontext.get('processed_pos'):
7 self.localcontext['processed_pos'] = []
8- back_browse = get_back_browse(self, self.cr, self.uid, context=self.localcontext)
9
10 for line in self.yieldPoLines(po_line_ids):
11 analytic_lines = self.getAnalyticLines(po, line)
12@@ -955,9 +954,9 @@
13 if 'processed_pos' in self.localcontext and po_id not in self.localcontext['processed_pos']:
14 self._order_iterator += 1
15 self.localcontext['processed_pos'].append(po_id)
16- if back_browse:
17+ if self.back_browse:
18 percent = float(self._order_iterator) / float(self._nb_orders)
19- self.pool.get('memory.background.report').update_percent(self.cr, self.uid, [back_browse.id], percent)
20+ self.pool.get('memory.background.report').update_percent(self.cr, self.uid, [self.back_browse.id], percent)
21
22 if pending_only_ok:
23 report_lines = self.filter_pending_only(report_lines)
24
25=== modified file 'bin/addons/msf_supply_doc_export/wizard/po_follow_up.py'
26--- bin/addons/msf_supply_doc_export/wizard/po_follow_up.py 2019-05-13 09:04:11 +0000
27+++ bin/addons/msf_supply_doc_export/wizard/po_follow_up.py 2019-07-15 07:18:54 +0000
28@@ -61,18 +61,31 @@
29 if isinstance(ids, (int,long)):
30 ids = [ids]
31
32+ # Create background report
33+ report_name = 'po.follow.up_xls'
34+ background_id = self.pool.get('memory.background.report').\
35+ create(cr, uid, {'file_name': report_name, 'report_name': report_name}, context=context)
36+ context['background_id'] = background_id
37+ context['background_time'] = 3
38+
39 self.write(cr, uid, ids, {'export_format': 'xls'}, context=context)
40- return self.button_validate(cr, uid, ids, report_name='po.follow.up_xls', context=None)
41-
42+ return self.button_validate(cr, uid, ids, report_name=report_name, context=context)
43
44 def pdf_report(self, cr, uid, ids, context=None):
45 if context is None:
46 context = {}
47 if isinstance(ids, (int,long)):
48 ids = [ids]
49+
50+ report_name = 'po.follow.up_rml'
51+ # Create background report
52+ background_id = self.pool.get('memory.background.report').\
53+ create(cr, uid, {'file_name': report_name, 'report_name': report_name}, context=context)
54+ context['background_id'] = background_id
55+ context['background_time'] = 3
56+
57 self.write(cr, uid, ids, {'export_format': 'pdf'}, context=context)
58-
59- return self.button_validate(cr, uid, ids, report_name='po.follow.up_rml', context=None)
60+ return self.button_validate(cr, uid, ids, report_name=report_name, context=context)
61
62
63 def get_state_list(self, cr, uid, wiz, context=None):
64@@ -222,8 +235,6 @@
65
66 return report_lines
67
68-
69-
70 def button_validate(self, cr, uid, ids, report_name, context=None):
71 if context is None:
72 context = {}
73@@ -318,9 +329,7 @@
74 if wiz.po_date_from:
75 domain.append(('date_order', '>=', wiz.po_date_from))
76
77- background_id = self.pool.get('memory.background.report').create(cr, uid, {'file_name': report_name, 'report_name': report_name}, context=context)
78- context['background_id'] = background_id
79- context['background_time'] = wiz.background_time
80+ # For background report
81 context['nb_orders'] = len(po_ids)
82
83 return {

Subscribers

People subscribed via source and target branches