From 2a162d9be71ee00f7698dda7075801ef8213c1d4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 4 Feb 2015 14:31:32 +0100 Subject: [PATCH 1/6] [FIX] web: widget date handling user timezone When converting a datetime field to date, using the widget date, the date time value was just cropped, removing the hours, therefore ignoring the user time zone. For instance, if the user was in UTC + 1, for a date time 02/02/2015 00:30:00, applying the widget date on this datetime had as result 02/01/2015, due to the fact the UTC value of the datetime field was 02/01/2015 23:30:00 fixes #4420 opw-621281 --- addons/web/static/src/js/formats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 80719d708ab..cddeced29ca 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -191,7 +191,7 @@ instance.web.format_value = function (value, descriptor, value_if_empty) { + ' ' + normalize_format(l10n.time_format)); case 'date': if (typeof(value) == "string") - value = instance.web.str_to_date(value.substring(0,10)); + value = instance.web.auto_str_to_date(value); return value.toString(normalize_format(l10n.date_format)); case 'time': if (typeof(value) == "string") From d7f30de9ae8a432c95fbd87e0ffbf8057b85992f Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Wed, 4 Feb 2015 16:12:44 +0100 Subject: [PATCH 2/6] [FIX] product: moved pricelist_item ACL from stock to product Otherwise if we install sale without stock, we can create pricelist and pricelist versions, but not pricelist items. Fix for issue 626985 --- addons/product/security/ir.model.access.csv | 1 + addons/stock/security/ir.model.access.csv | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/security/ir.model.access.csv b/addons/product/security/ir.model.access.csv index d4c4261bb8c..a305e4704cb 100644 --- a/addons/product/security/ir.model.access.csv +++ b/addons/product/security/ir.model.access.csv @@ -12,6 +12,7 @@ access_product_pricelist_type_user,product.pricelist.type.user,model_product_pri access_product_pricelist_user,product.pricelist.user,model_product_pricelist,base.group_user,1,0,0,0 access_product_pricelist_version_user,product.pricelist.version.user,model_product_pricelist_version,base.group_user,1,0,0,0 access_product_pricelist_item_user,product.pricelist.item.user,model_product_pricelist_item,base.group_user,1,0,0,0 +access_product_pricelist_item_sale_manager,product.pricelist.item salemanager,product.model_product_pricelist_item,base.group_sale_manager,1,1,1,1 access_product_pricelist_type_partner_manager,product.pricelist.type partner manager,model_product_pricelist_type,base.group_partner_manager,1,0,0,0 access_product_pricelist_partner_manager,product.pricelist partner manager,model_product_pricelist,base.group_partner_manager,1,0,0,0 access_product_product_employee,product.product employee,model_product_product,base.group_user,1,0,0,0 diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index a3bd5eb33cb..20e1f0f2570 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -42,7 +42,6 @@ access_account_invoice_line_user,account.invoice.line stock user,account.model_a access_account_invoice_tax_user,account.invoice.tax stock user,account.model_account_invoice_tax,stock.group_stock_user,1,1,1,0 access_account_journal_user,account.journal stock user,account.model_account_journal,stock.group_stock_user,1,0,0,0 access_account_fiscalyear,account.fiscalyear stock user,account.model_account_fiscalyear,stock.group_stock_user,1,0,0,0 -access_product_pricelist_item_sale_manager,product.pricelist.item salemanager,product.model_product_pricelist_item,base.group_sale_manager,1,1,1,1 access_product_uom_categ_stock_manager,product.uom.categ stock_manager,product.model_product_uom_categ,stock.group_stock_manager,1,1,1,1 access_product_uom_stock_manager,product.uom stock_manager,product.model_product_uom,stock.group_stock_manager,1,1,1,1 access_product_ul_stock_manager,product.ul stock_manager,product.model_product_ul,stock.group_stock_manager,1,1,1,1 From 8ff7d299f57e5d8eed9c55ff33e4e600aa3d476f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 5 Feb 2015 15:03:16 +0100 Subject: [PATCH 3/6] [FIX] stock: picking, Set date of reception if not set by user previously If the date_done field of the model stock.picking is already filled in it means the user do wanted to have this date of reception date instead of the moment when the user clicked the receive button. opw-627219 --- addons/stock/stock.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index bcc3e22f791..b58eca5ccb9 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -884,7 +884,13 @@ class stock_picking(osv.osv): This method is called at the end of the workflow by the activity "done". @return: True """ - self.write(cr, uid, ids, {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')}) + for picking in self.browse(cr, uid, ids, context=context): + values = { + 'state': 'done' + } + if not picking.date_done: + values['date_done'] = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) + self.write(cr, uid, ids, values, context=context) return True def action_move(self, cr, uid, ids, context=None): From 764be06f4431eb3eb9be4171279345b81d514cc6 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 5 Feb 2015 15:09:06 +0100 Subject: [PATCH 4/6] [FIX] stock: obvious distraction error of previous rev. 8ff7d299f57e5d8eed9c55ff33e4e600aa3d476f --- addons/stock/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b58eca5ccb9..1d38265a71c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -890,7 +890,7 @@ class stock_picking(osv.osv): } if not picking.date_done: values['date_done'] = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) - self.write(cr, uid, ids, values, context=context) + picking.write(values) return True def action_move(self, cr, uid, ids, context=None): From 8bee3bbfad0f3ad5ed69e62c49f178405c49986e Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 6 Feb 2015 12:51:55 +0100 Subject: [PATCH 5/6] [FIX] share: mail.notification is also transversal mail.message and mail.notification are transversal: they should not received directly the access rights --- addons/share/wizard/share_wizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index e9d83be85cb..f8643fc71b4 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -508,7 +508,7 @@ class share_wizard(osv.TransientModel): # already granted for dummy, model in fields_relations: # mail.message is transversal: it should not received directly the access rights - if model.model in ['mail.message']: continue + if model.model in ['mail.message', 'mail.notification']: continue values = { 'name': _('Copied access for sharing'), 'group_id': group_id, @@ -640,7 +640,7 @@ class share_wizard(osv.TransientModel): if domain: for rel_field, model in fields_relations: # mail.message is transversal: it should not received directly the access rights - if model.model in ['mail.message']: continue + if model.model in ['mail.message', 'mail.notification']: continue related_domain = [] if not rel_field: continue for element in domain: From 0b7db5583f9b3b40c94ff7ed81cfb6bc2f3bd37e Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 6 Feb 2015 12:59:07 +0100 Subject: [PATCH 6/6] [FIX] share: action params in url is action, not action_id When sharing a record to a share user (for instance, the quotation), the action in the url was set to "action_id=" instead of "action=", therefore, the link sent just leaded to nowhere. --- addons/share/wizard/share_wizard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index f8643fc71b4..c01ad220be1 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -915,8 +915,8 @@ class share_result_line(osv.osv_memory): for this in self.browse(cr, uid, ids, context=context): data = dict(dbname=cr.dbname, login=this.login, password=this.password) if this.share_wizard_id and this.share_wizard_id.action_id: - data['action_id'] = this.share_wizard_id.action_id.id - ctx = dict(context, share_url_template_hash_arguments=['action_id']) + data['action'] = this.share_wizard_id.action_id.id + ctx = dict(context, share_url_template_hash_arguments=['action']) result[this.id] = this.share_wizard_id.share_url_template(context=ctx) % data return result