[IMP] hw_posbox_upgrade: show latest commit of odoo repository on posbox

Is useful when debugging, and figuring out whether or not an upgrade was
successful.
This commit is contained in:
Joren Van Onder 2015-08-25 16:07:27 +02:00
parent e7c51228f3
commit 2a96e18a79
1 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import time
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import threading
import subprocess
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
@ -74,6 +75,14 @@ upgrade_template = """
<p>
To upgrade the posbox, click on the upgrade button. The upgrade will take a few minutes. <b>Do not reboot</b> the PosBox during the upgrade.
</p>
<p>
Latest patch:
</p>
<pre>
"""
upgrade_template += subprocess.check_output("git --work-tree=/home/pi/odoo/ --git-dir=/home/pi/odoo/.git log -1", shell=True).replace("\n", "<br/>")
upgrade_template += """
</pre>
<div class='centering'>
<a href='#' id='upgrade'>Upgrade</a>
</div>