From f2abde5659aa087ff8834140147f8d3be3bcdb3e Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 14 Nov 2016 22:27:53 +0100 Subject: [PATCH 1/2] [FIX] base: binary url attachment on windows On windows when opening a binary file a 'b' flag is to be used: https://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files Before this commit, /web/image/* and /web/content/* routes serving an ir.attachment with url could return empty or truncated content. opw-693306 --- openerp/addons/base/ir/ir_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_http.py b/openerp/addons/base/ir/ir_http.py index dde75a64a76..2ff316f1ea1 100644 --- a/openerp/addons/base/ir/ir_http.py +++ b/openerp/addons/base/ir/ir_http.py @@ -264,7 +264,7 @@ class ir_http(osv.AbstractModel): module_path = os.path.join(os.path.normpath(module_path), '') # join ensures the path ends with '/' module_resource_path = os.path.normpath(module_resource_path) if module_resource_path.startswith(module_path): - with open(module_resource_path, 'r') as f: + with open(module_resource_path, 'rb') as f: content = base64.b64encode(f.read()) last_update = str(os.path.getmtime(module_resource_path)) From 3bad13d65091bb9ded87865e2925c3834c81e65e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 14 Nov 2016 13:00:25 +0100 Subject: [PATCH 2/2] [FIX] point_of_sale: closing balance access rights In 9.0 when the pos user was not at least in the group Accountant (group_account_user), he was not allow to close or open the balance when the pos session was configured in cash control. ps:be carefull with the old rule: Point Of Sale Cashbox Line POS User deleted with a26b805f5ef43527e6e37c6cbc16f97e50217ceb opw:69251 --- addons/point_of_sale/security/ir.model.access.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/point_of_sale/security/ir.model.access.csv b/addons/point_of_sale/security/ir.model.access.csv index 8023c5dc076..b83298d0c09 100644 --- a/addons/point_of_sale/security/ir.model.access.csv +++ b/addons/point_of_sale/security/ir.model.access.csv @@ -35,3 +35,5 @@ access_barcode_nomenclature_pos_user,barcode.nomenclature.pos.user,barcodes.mode access_barcode_nomenclature_pos_manager,barcode.nomenclature.pos.manager,barcodes.model_barcode_nomenclature,group_pos_manager,1,1,1,1 access_barcode_rule_pos_user,barcode.rule.pos.user,barcodes.model_barcode_rule,group_pos_user,1,0,0,0 access_barcode_rule_pos_manager,barcode.rule.pos.manager,barcodes.model_barcode_rule,group_pos_manager,1,1,1,1 +access_bank_statement_cashbox_user,account.bank.statement.cashbox user,account.model_account_bank_statement_cashbox,group_pos_user,1,1,1,0 +access_account_cashbox_line_user,account.cashbox.line user,account.model_account_cashbox_line,group_pos_user,1,1,1,0