Skip to content

Commit

Permalink
[MERGE] forward port branch saas-6 up to 1d00e32
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Oct 24, 2016
2 parents 39a8b39 + 1d00e32 commit 6690bfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/resource/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ class resource_calendar_attendance(osv.osv):
'date_to': fields.date('End Date'),
'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True),
'hour_to' : fields.float("Work to", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True),
'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True, ondelete='cascade'),
}

_order = 'dayofweek, hour_from'
Expand Down
9 changes: 7 additions & 2 deletions openerp/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def phantom_poll(self, phantom, timeout):
_logger.info("phantomjs: %s", line)

if line == "ok":
break
return True

def phantom_run(self, cmd, timeout):
_logger.info('phantom_run executing %s', ' '.join(cmd))
Expand All @@ -375,8 +375,9 @@ def phantom_run(self, cmd, timeout):
phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None)
except OSError:
raise unittest.SkipTest("PhantomJS not found")
result = False
try:
self.phantom_poll(phantom, timeout)
result = self.phantom_poll(phantom, timeout)
finally:
# kill phantomjs if phantom.exit() wasn't called in the test
if phantom.poll() is None:
Expand All @@ -385,6 +386,10 @@ def phantom_run(self, cmd, timeout):
self._wait_remaining_requests()
# we ignore phantomjs return code as we kill it as soon as we have ok
_logger.info("phantom_run execution finished")
self.assertTrue(
result,
"PhantomJS test completed without reporting success; "
"the log may contain errors or hints.")

def _wait_remaining_requests(self):
t0 = int(time.time())
Expand Down

0 comments on commit 6690bfb

Please sign in to comment.