Merge lp:~jfb-tempo-consulting/unifield-server/US-8503 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5956
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-8503
Merge into: lp:unifield-server
Diff against target: 62 lines (+9/-2)
3 files modified
bin/addons/msf_tools/automated_export.py (+2/-0)
bin/addons/msf_tools/views/automated_export_view.xml (+1/-0)
bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py (+6/-2)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-8503
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+401446@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_tools/automated_export.py'
2--- bin/addons/msf_tools/automated_export.py 2020-09-18 13:38:52 +0000
3+++ bin/addons/msf_tools/automated_export.py 2021-04-20 08:23:07 +0000
4@@ -109,10 +109,12 @@
5 'ftp_dest_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
6 'ftp_dest_fail_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
7 'ftp_report_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
8+ 'pause': fields.integer('Pause between generation and transfer (in seconds)'),
9
10 }
11
12 _defaults = {
13+ 'pause': 120,
14 'interval': lambda *a: 1,
15 'interval_unit': lambda *a: 'hours',
16 'active': lambda *a: False,
17
18=== modified file 'bin/addons/msf_tools/views/automated_export_view.xml'
19--- bin/addons/msf_tools/views/automated_export_view.xml 2020-09-18 10:39:31 +0000
20+++ bin/addons/msf_tools/views/automated_export_view.xml 2021-04-20 08:23:07 +0000
21@@ -41,6 +41,7 @@
22 <field name="function_id" widget="selection" on_change="change_function_id(function_id)"/>
23 <field name="active" />
24 <field name="export_format" attrs="{'invisible': [('disable_cron', '=', True)]}"/>
25+ <field name="pause" attrs="{'invisible': [('disable_cron', '=', False)]}"/>
26 <button name="run_job_manually" string="Run job manually" colspan="2" type="object" icon="gtk-execute" />
27 <button name="sent_to_remote" string="Manually send to FTP" colspan="2" type="object" icon="cloud.png" attrs="{'invisible': ['|', ('disable_cron', '=', False), ('ftp_ok', '=', False)]}" />
28
29
30=== modified file 'bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py'
31--- bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py 2020-09-25 09:57:42 +0000
32+++ bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py 2021-04-20 08:23:07 +0000
33@@ -132,13 +132,17 @@
34 p_state_obj.write(cr, uid, period_state_ids, {'auto_export_vi': True}, context=context)
35
36
37+ if nb_ok and export_wiz.pause:
38+ msg.append('[%s] pause for %s seconds' % (time.strftime('%Y-%m-%d %H:%M:%S'), export_wiz.pause))
39+ time.sleep(export_wiz.pause)
40+
41 if export_wiz.ftp_dest_ok:
42 # send all reports (old + and new) to remote
43 for filename in os.listdir(export_wiz.destination_local_path):
44 fullfilename = os.path.join(export_wiz.destination_local_path, filename)
45- msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.dest_path))
46 try:
47 if os.path.isfile(fullfilename):
48+ msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.dest_path))
49 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.dest_path, delete=True, context=context)
50 if disable_generation:
51 nb_ok += 1
52@@ -152,9 +156,9 @@
53 current_report_path = export_wiz.report_local_path
54 for filename in os.listdir(export_wiz.report_local_path):
55 fullfilename = os.path.join(export_wiz.report_local_path, filename)
56- msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.report_path))
57 try:
58 if os.path.isfile(fullfilename):
59+ msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.report_path))
60 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.report_path, delete=True, context=context)
61 if disable_generation:
62 nb_ok += 1

Subscribers

People subscribed via source and target branches