Merge lp:~jfb-tempo-consulting/unifield-web/US-3961 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 4898
Proposed branch: lp:~jfb-tempo-consulting/unifield-web/US-3961
Merge into: lp:unifield-web
Diff against target: 114 lines (+68/-2)
3 files modified
addons/openerp/controllers/database.py (+62/-1)
addons/openerp/controllers/form.py (+1/-1)
addons/openerp/controllers/templates/auto_create_progress.mako (+5/-0)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-web/US-3961
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+340171@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 'addons/openerp/controllers/database.py'
--- addons/openerp/controllers/database.py 2017-11-25 10:50:11 +0000
+++ addons/openerp/controllers/database.py 2018-03-01 09:44:27 +0000
@@ -442,12 +442,73 @@
442 ('backup', 'auto_bck_interval_unit', ('minutes', 'hours', 'work_days', 'days', 'weeks', 'months')),442 ('backup', 'auto_bck_interval_unit', ('minutes', 'hours', 'work_days', 'days', 'weeks', 'months')),
443 ('reconfigure', 'delivery_process', ('complex', 'simple')),443 ('reconfigure', 'delivery_process', ('complex', 'simple')),
444 )444 )
445
446 for section, option, possible_values in possible_value_list:445 for section, option, possible_values in possible_value_list:
447 self.check_possible_value(config, section, option, possible_values)446 self.check_possible_value(config, section, option, possible_values)
448 if self.msg:447 if self.msg:
449 return448 return
450449
450 if config.get('instance', 'instance_level') == 'project':
451 if len(config.get('instance', 'group_names').split(',')) != 3:
452 self.msg = {
453 'message': _('Project creation asked, you must set 3 sync groups'),
454 'title': _('Bad sync groups'),
455 }
456 return
457
458 if config.get('instance', 'instance_level') == 'coordo':
459 if len(config.get('instance', 'group_names').split(',')) != 4:
460 self.msg = {
461 'message': _('Project creation asked, you must set 3 sync groups'),
462 'title': _('Bad sync groups'),
463 }
464 return
465
466 protocol = 'http'
467 if config.get('instance', 'sync_protocol') == 'xmlrpcs':
468 protocol = 'https'
469 server_rpc = rpc.RPCSession(config.get('instance', 'sync_host'), config.get('instance', 'sync_port'), protocol=protocol)
470 uid = server_rpc.login(config.get('instance', 'sync_server'), config.get('instance', 'sync_user'), config.get('instance', 'sync_pwd'))
471 if uid <= 0:
472 self.msg = {
473 'message': _('Unable to connect to Sync Server %s:%s, db:%s, user:%s') % (config.get('instance', 'sync_host'), config.get('instance', 'sync_port'), config.get('instance', 'sync_server'), config.get('instance', 'sync_user')),
474 'title': _('Sync Server Error'),
475 }
476 return
477
478 config_groups = config.get('instance', 'group_names').split(',')
479 found_group = []
480 groups_ids = server_rpc.execute('object', 'execute', 'sync.server.entity_group', 'search', [('name', 'in', config_groups)])
481 for x in server_rpc.execute('object', 'execute', 'sync.server.entity_group', 'read', groups_ids, ['name', 'oc']):
482 found_group.append(x['name'])
483 if x['oc'].lower() != config.get('instance', 'oc').lower():
484 self.msg = {
485 'message': _('Group %s has not the same OC (configured: %s)') % (x['name'], config.get('instance', 'oc')),
486 'title': _('Sync Group'),
487 }
488 return
489
490 if set(config_groups) - set(found_group):
491 self.msg = {
492 'message': _('Sync Groups %s not found on sync server') % (", ".join(list(set(config_groups) - set(found_group)),)),
493 'title': _('Sync Group'),
494 }
495 return
496
497 if not server_rpc.execute('object', 'execute', 'sync.server.entity', 'search', [('name', '=', config.get('instance', 'parent_instance'))]):
498 self.msg = {
499 'message': _('Parent Instance %s not found on sync server') % (config.get('instance', 'parent_instance'), ),
500 'title': _('Parent Instance'),
501 }
502 return
503
504 if not server_rpc.execute('object', 'execute', 'sync.server.update', 'search', [('model', '=', 'msf.instance'), ('values', 'like', "'%s'" % config.get('instance', 'instance_name'))]):
505 self.msg = {
506 'message': _('No update found for %s. Did you create the new instance at HQ ?') % (config.get('instance', 'instance_name'), ),
507 'title': _('HQ creation'),
508 }
509 return
510
511
451 except NoOptionError as e:512 except NoOptionError as e:
452 self.msg = {'message': ustr(_('No option \'%s\' found for the section \'[%s]\' in the config file \'%s\'') % (e.option, e.section, file_path)),513 self.msg = {'message': ustr(_('No option \'%s\' found for the section \'[%s]\' in the config file \'%s\'') % (e.option, e.section, file_path)),
453 'title': ustr(_('Option missing in configuration file'))}514 'title': ustr(_('Option missing in configuration file'))}
454515
=== modified file 'addons/openerp/controllers/form.py'
--- addons/openerp/controllers/form.py 2017-10-27 12:14:43 +0000
+++ addons/openerp/controllers/form.py 2018-03-01 09:44:27 +0000
@@ -513,7 +513,7 @@
513 # Model.write([params.id], modified, ctx)513 # Model.write([params.id], modified, ctx)
514 #else:514 #else:
515 # Model.write([params.id], data, ctx)515 # Model.write([params.id], data, ctx)
516 Model.write([params.id], data, ctx)516 Model.write_web([params.id], data, ctx)
517517
518 tw.ConcurrencyInfo.update(518 tw.ConcurrencyInfo.update(
519 params.model, Model.read([params.id], ['__last_update'], ctx)519 params.model, Model.read([params.id], ['__last_update'], ctx)
520520
=== modified file 'addons/openerp/controllers/templates/auto_create_progress.mako'
--- addons/openerp/controllers/templates/auto_create_progress.mako 2017-11-25 10:50:11 +0000
+++ addons/openerp/controllers/templates/auto_create_progress.mako 2018-03-01 09:44:27 +0000
@@ -37,6 +37,7 @@
37 $("div.my_state").text(data.state);37 $("div.my_state").text(data.state);
38 if (data.state === 'done') {38 if (data.state === 'done') {
39 clearInterval(interval);39 clearInterval(interval);
40 $("#login-button").css({'display': 'inline'})
40 };41 };
41 if (data.monitor_status) {42 if (data.monitor_status) {
42 $("div.my_monitor_status").text(data.monitor_status);43 $("div.my_monitor_status").text(data.monitor_status);
@@ -75,6 +76,10 @@
75 <div class="auto_creation_resume">76 <div class="auto_creation_resume">
76 <textarea rows="20" cols="80">${resume}</textarea>77 <textarea rows="20" cols="80">${resume}</textarea>
77 </div>78 </div>
79
80 <div id="connect_instance" class="auto_creation_resume">
81 <a href="/openerp/login/" id="login-button" style="display:none" class="button-a">Open Login Page</a>
82 </div>
78 </div>83 </div>
79<a class="auto_instance_debug" href="/openerp/login/?style=noauto"><img src="/openerp/static/images/icons/idea.png" alt="debug access" /></a>84<a class="auto_instance_debug" href="/openerp/login/?style=noauto"><img src="/openerp/static/images/icons/idea.png" alt="debug access" /></a>
80<%include file="footer.mako"/>85<%include file="footer.mako"/>

Subscribers

People subscribed via source and target branches