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
=== modified file 'bin/addons/msf_tools/automated_export.py'
--- bin/addons/msf_tools/automated_export.py 2020-09-18 13:38:52 +0000
+++ bin/addons/msf_tools/automated_export.py 2021-04-20 08:23:07 +0000
@@ -109,10 +109,12 @@
109 'ftp_dest_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),109 'ftp_dest_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
110 'ftp_dest_fail_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),110 'ftp_dest_fail_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
111 'ftp_report_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),111 'ftp_report_ok': fields.boolean(string='on FTP server', help='Is given path is located on FTP server ?'),
112 'pause': fields.integer('Pause between generation and transfer (in seconds)'),
112113
113 }114 }
114115
115 _defaults = {116 _defaults = {
117 'pause': 120,
116 'interval': lambda *a: 1,118 'interval': lambda *a: 1,
117 'interval_unit': lambda *a: 'hours',119 'interval_unit': lambda *a: 'hours',
118 'active': lambda *a: False,120 'active': lambda *a: False,
119121
=== modified file 'bin/addons/msf_tools/views/automated_export_view.xml'
--- bin/addons/msf_tools/views/automated_export_view.xml 2020-09-18 10:39:31 +0000
+++ bin/addons/msf_tools/views/automated_export_view.xml 2021-04-20 08:23:07 +0000
@@ -41,6 +41,7 @@
41 <field name="function_id" widget="selection" on_change="change_function_id(function_id)"/>41 <field name="function_id" widget="selection" on_change="change_function_id(function_id)"/>
42 <field name="active" />42 <field name="active" />
43 <field name="export_format" attrs="{'invisible': [('disable_cron', '=', True)]}"/>43 <field name="export_format" attrs="{'invisible': [('disable_cron', '=', True)]}"/>
44 <field name="pause" attrs="{'invisible': [('disable_cron', '=', False)]}"/>
44 <button name="run_job_manually" string="Run job manually" colspan="2" type="object" icon="gtk-execute" />45 <button name="run_job_manually" string="Run job manually" colspan="2" type="object" icon="gtk-execute" />
45 <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)]}" />46 <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)]}" />
4647
4748
=== modified file 'bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py'
--- bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py 2020-09-25 09:57:42 +0000
+++ bin/addons/vertical_integration/wizard/wizard_hq_report_oca.py 2021-04-20 08:23:07 +0000
@@ -132,13 +132,17 @@
132 p_state_obj.write(cr, uid, period_state_ids, {'auto_export_vi': True}, context=context)132 p_state_obj.write(cr, uid, period_state_ids, {'auto_export_vi': True}, context=context)
133133
134134
135 if nb_ok and export_wiz.pause:
136 msg.append('[%s] pause for %s seconds' % (time.strftime('%Y-%m-%d %H:%M:%S'), export_wiz.pause))
137 time.sleep(export_wiz.pause)
138
135 if export_wiz.ftp_dest_ok:139 if export_wiz.ftp_dest_ok:
136 # send all reports (old + and new) to remote140 # send all reports (old + and new) to remote
137 for filename in os.listdir(export_wiz.destination_local_path):141 for filename in os.listdir(export_wiz.destination_local_path):
138 fullfilename = os.path.join(export_wiz.destination_local_path, filename)142 fullfilename = os.path.join(export_wiz.destination_local_path, filename)
139 msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.dest_path))
140 try:143 try:
141 if os.path.isfile(fullfilename):144 if os.path.isfile(fullfilename):
145 msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.dest_path))
142 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.dest_path, delete=True, context=context)146 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.dest_path, delete=True, context=context)
143 if disable_generation:147 if disable_generation:
144 nb_ok += 1148 nb_ok += 1
@@ -152,9 +156,9 @@
152 current_report_path = export_wiz.report_local_path156 current_report_path = export_wiz.report_local_path
153 for filename in os.listdir(export_wiz.report_local_path):157 for filename in os.listdir(export_wiz.report_local_path):
154 fullfilename = os.path.join(export_wiz.report_local_path, filename)158 fullfilename = os.path.join(export_wiz.report_local_path, filename)
155 msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.report_path))
156 try:159 try:
157 if os.path.isfile(fullfilename):160 if os.path.isfile(fullfilename):
161 msg.append('[%s] sending %s to %s' % (time.strftime('%Y-%m-%d %H:%M:%S'), fullfilename, export_wiz.report_path))
158 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.report_path, delete=True, context=context)162 export_job_obj.send_file(cr, uid, export_wiz, remote_con, fullfilename, export_wiz.report_path, delete=True, context=context)
159 if disable_generation:163 if disable_generation:
160 nb_ok += 1164 nb_ok += 1

Subscribers

People subscribed via source and target branches