[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:
parent
43be0c1ab2
commit
722017ca83
|
@ -57,9 +57,7 @@ index_template = """
|
||||||
<p>
|
<p>
|
||||||
If you need to grant remote debugging access to a developer, you can do it <a href='/remote_connect'>here</a>.
|
If you need to grant remote debugging access to a developer, you can do it <a href='/remote_connect'>here</a>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
%s
|
||||||
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>
|
|
||||||
<p>
|
<p>
|
||||||
The PosBox software installed on this posbox is <b>version 16</b>,
|
The PosBox software installed on this posbox is <b>version 16</b>,
|
||||||
the posbox version number is independent from Odoo. You can upgrade
|
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):
|
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)
|
@http.route('/', type='http', auth='none', website=True)
|
||||||
def index(self):
|
def index(self):
|
||||||
#return request.render('hw_posbox_homepage.index',mimetype='text/html')
|
#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)
|
@http.route('/wifi', type='http', auth='none', website=True)
|
||||||
def wifi(self):
|
def wifi(self):
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
from openerp import http
|
from openerp import http
|
||||||
from openerp.tools import config
|
from openerp.tools import config
|
||||||
from openerp.addons.web.controllers import main as web
|
from openerp.addons.web.controllers import main as web
|
||||||
|
from openerp.addons.hw_posbox_homepage.controllers import main as homepage
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import netifaces as ni
|
import netifaces as ni
|
||||||
|
@ -35,6 +36,14 @@ self_port = str(config['xmlrpc_port'] or 8069)
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_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):
|
class HardwareScreen(web.Home):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue