diff --git a/addons/account/models/account.py b/addons/account/models/account.py index e722ea039aa..ae06e71f0cf 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -687,7 +687,7 @@ class AccountTax(models.Model): partner = partner_id and self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) or None ids = isinstance(ids, (int, long)) and [ids] or ids recs = self.browse(cr, uid, ids, context=context) - return recs.compute_all(price_unit, currency, quantity, product, partner) + return AccountTax.compute_all(recs, price_unit, currency, quantity, product, partner) @api.model def _fix_tax_included_price(self, price, prod_taxes, line_taxes): diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index a46430c6cfd..36429c10bcb 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -796,4 +796,4 @@ class report_xml(osv.osv): if object_id: model = self.pool.get('ir.model').browse(cr, uid, object_id, context=context).model args.append(('model', '=', model)) - return super(report_xml, self).search(cr, uid, args, offset, limit, order, context, count) + return super(report_xml, self).search(cr, uid, args, offset=offset, limit=limit, order=order, context=context, count=count) diff --git a/addons/point_of_sale/tools/posbox/configuration/connect_to_wifi.sh b/addons/point_of_sale/tools/posbox/configuration/connect_to_wifi.sh index 11f6d18eae4..681732ae714 100755 --- a/addons/point_of_sale/tools/posbox/configuration/connect_to_wifi.sh +++ b/addons/point_of_sale/tools/posbox/configuration/connect_to_wifi.sh @@ -7,6 +7,7 @@ function connect () { WPA_PASS_FILE="/tmp/wpa_pass.txt" PERSISTENT_WIFI_NETWORK_FILE="/home/pi/wifi_network.txt" CURRENT_WIFI_NETWORK_FILE="/tmp/current_wifi_network.txt" # used to repair connection when we lose it + LOST_WIFI_FILE="/tmp/lost_wifi.txt" ESSID="${1}" PASSWORD="${2}" PERSIST="${3}" @@ -15,6 +16,7 @@ function connect () { sleep 3 sudo pkill -f keep_wifi_alive.sh + WIFI_WAS_LOST=$? # make network choice persistent if [ -n "${ESSID}" ] ; then @@ -54,13 +56,24 @@ function connect () { # give dhcp some time timeout 30 sh -c 'until ifconfig wlan0 | grep "inet addr:" ; do sleep 0.1 ; done' + TIMEOUT_RETURN=$? - if [ $? -eq 124 ] && [ -z "${NO_AP}" ] ; then + if [ ${TIMEOUT_RETURN} -eq 124 ] && [ -z "${NO_AP}" ] ; then logger -t posbox_connect_to_wifi "Failed to connect, forcing Posbox AP" sudo /home/pi/odoo/addons/point_of_sale/tools/posbox/configuration/wireless_ap.sh "force" & else - logger -t posbox_connect_to_wifi "Restarting odoo" - sudo service odoo restart + if [ ${TIMEOUT_RETURN} -ne 124 ] ; then + rm -f "${LOST_WIFI_FILE}" + fi + + if [ ! -f "${LOST_WIFI_FILE}" ] ; then + logger -t posbox_connect_to_wifi "Restarting odoo" + sudo service odoo restart + fi + + if [ ${WIFI_WAS_LOST} -eq 0 ] ; then + touch "${LOST_WIFI_FILE}" + fi logger -t posbox_connect_to_wifi "Starting wifi keep alive script" /home/pi/odoo/addons/point_of_sale/tools/posbox/configuration/keep_wifi_alive.sh & diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 98e90a550c5..694b240a327 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -131,8 +131,8 @@ class Report(osv.Model): @api.v8 def get_html(self, records, report_name, data=None): - return self._model.get_html(self._cr, self._uid, records.ids, report_name, - data=data, context=self._context) + return Report.get_html(self._model, self._cr, self._uid, records.ids, + report_name, data=data, context=self._context) @api.v7 def get_pdf(self, cr, uid, ids, report_name, html=None, data=None, context=None): @@ -245,8 +245,8 @@ class Report(osv.Model): @api.v8 def get_pdf(self, records, report_name, html=None, data=None): - return self._model.get_pdf(self._cr, self._uid, records.ids, report_name, - html=html, data=data, context=self._context) + return Report.get_pdf(self._model, self._cr, self._uid, records.ids, + report_name, html=html, data=data, context=self._context) @api.v7 def get_action(self, cr, uid, ids, report_name, data=None, context=None): @@ -279,8 +279,8 @@ class Report(osv.Model): @api.v8 def get_action(self, records, report_name, data=None): - return self._model.get_action(self._cr, self._uid, records.ids, report_name, - data=data, context=self._context) + return Report.get_action(self._model, self._cr, self._uid, records.ids, + report_name, data=data, context=self._context) #-------------------------------------------------------------------------- # Report generation helpers @@ -326,8 +326,8 @@ class Report(osv.Model): @api.v8 def _check_attachment_use(self, records, report): - return self._model._check_attachment_use( - self._cr, self._uid, records.ids, report, context=self._context) + return Report._check_attachment_use( + self._model, self._cr, self._uid, records.ids, report, context=self._context) def _check_wkhtmltopdf(self): return wkhtmltopdf_state diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index e9776226bc8..5bc71a5848c 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -603,7 +603,7 @@ class WebsiteForum(http.Controller): if (user_id != request.session.uid and not (user.website_published or (count_user_questions and current_user.karma > forum.karma_unlink_all))): - return request.website.render("website_forum.private_profile", values) + return request.render("website_forum.private_profile", values, status=404) # limit length of visible posts by default for performance reasons, except for the high # karma users (not many of them, and they need it to properly moderate the forum) diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml index 879ca5ba379..ab29205ea40 100644 --- a/addons/website_forum/views/website_forum.xml +++ b/addons/website_forum/views/website_forum.xml @@ -768,7 +768,7 @@ By - @@ -916,13 +916,17 @@