[FIX] hw_posbox_homepage: do not display not working links

The '/point_of_sale/display' controller is added in the hw_screen module.
This module is not loaded if the init scripts are not modified.
This means that updating a posbox with the internal update feature will not work.

This adds the link only in hw_screen and display an information message for old
versions.
This commit is contained in:
Martin Trigaux 2017-05-16 16:30:26 +02:00
parent 43be0c1ab2
commit 722017ca83
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
2 changed files with 22 additions and 4 deletions

View File

@ -57,9 +57,7 @@ index_template = """
<p>
If you need to grant remote debugging access to a developer, you can do it <a href='/remote_connect'>here</a>.
</p>
<p>
If you need to display the current customer basket on another device, you can do it <a href='/point_of_sale/display'>here</a>.
</p>
%s
<p>
The PosBox software installed on this posbox is <b>version 16</b>,
the posbox version number is independent from Odoo. You can upgrade
@ -74,10 +72,21 @@ index_template = """
class PosboxHomepage(openerp.addons.web.controllers.main.Home):
def get_hw_screen_message(self):
return """
<p>
The activate the customer display feature, you will need to reinstall the PosBox software.
You can find the latest images on the <a href="http://nightly.odoo.com/master/posbox/">Odoo Nightly builds</a> website.
Make sure to download at least the version 16.<br/>
Odoo version 11, or above, is required to use the customer display feature.
</p>
"""
@http.route('/', type='http', auth='none', website=True)
def index(self):
#return request.render('hw_posbox_homepage.index',mimetype='text/html')
return index_template
return index_template % self.get_hw_screen_message()
@http.route('/wifi', type='http', auth='none', website=True)
def wifi(self):

View File

@ -23,6 +23,7 @@
from openerp import http
from openerp.tools import config
from openerp.addons.web.controllers import main as web
from openerp.addons.hw_posbox_homepage.controllers import main as homepage
import logging
import netifaces as ni
@ -35,6 +36,14 @@ self_port = str(config['xmlrpc_port'] or 8069)
_logger = logging.getLogger(__name__)
class Homepage(homepage.PosboxHomepage):
def get_hw_screen_message(self):
return """
<p>
If you need to display the current customer basket on another device, you can do it <a href='/point_of_sale/display'>here</a>.
</p>
"""
class HardwareScreen(web.Home):