From a4bca7c7753a75e7b9d50f26add2e2bd5de27b11 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Tue, 3 Dec 2013 14:18:21 +0530 Subject: [PATCH 1/6] [FIX]Web: Fixed the issue of group and search_default propagated in context to next action while executing button action. bzr revid: msh@openerp.com-20131203084821-0amelfix4bji3wr6 --- addons/web/static/src/js/views.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 21ff627c544..17d91f9ea6d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1347,6 +1347,14 @@ instance.web.View = instance.web.Widget.extend({ }; var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {}); var handler = function (action) { + if (action_data.model !== dataset.model) { + // filter out context keys that are specific to the action model. + // Wrong default_ and search_default values will no give the expected views + // Wrong group_by values will simply fail and forbid rendering of the destination view + context = _.reject(_.keys(context.eval()), function(key) { + return key.match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf)$') !== null; + }); + } if (action && action.constructor == Object) { var ncontext = new instance.web.CompoundContext(context); if (record_id) { From 34067a1f49be91ce9d9a14344012c8a413bc9e83 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 24 Apr 2014 16:28:29 +0200 Subject: [PATCH 2/6] [FIX] hr_timesheet_sheet: forbid to record an attendance in a submitted timesheet lp bug: https://launchpad.net/bugs/1180769 fixed bzr revid: mat@openerp.com-20140424142829-ramy830hwkghk1jv --- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b8e9fde2253..0a4c7793d72 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -20,10 +20,11 @@ ############################################################################## import time -from datetime import datetime, timedelta +from datetime import datetime from dateutil.relativedelta import relativedelta from openerp.osv import fields, osv +from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.translate import _ from openerp import netsvc @@ -390,18 +391,21 @@ class hr_attendance(osv.osv): attendance_ids.extend([row[0] for row in cr.fetchall()]) return attendance_ids + def _get_current_sheet(self, cr, uid, employee_id, date=False, context=None): + if not date: + date = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) + date_to = date[0:10]+' 00:00:00' + # limit=1 because only one sheet possible for an employee between 2 dates + sheet_ids = self.pool.get('hr_timesheet_sheet.sheet').search(cr, uid, [ + ('date_to', '>=', date_to), ('date_from', '<=', date), + ('employee_id', '=', employee_id) + ], limit=1, context=context) + return sheet_ids and sheet_ids[0] or False + def _sheet(self, cursor, user, ids, name, args, context=None): - sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') res = {}.fromkeys(ids, False) for attendance in self.browse(cursor, user, ids, context=context): - date_to = datetime.strftime(datetime.strptime(attendance.name[0:10], '%Y-%m-%d'), '%Y-%m-%d %H:%M:%S') - sheet_ids = sheet_obj.search(cursor, user, - [('date_to', '>=', date_to), ('date_from', '<=', attendance.name), - ('employee_id', '=', attendance.employee_id.id)], - context=context) - if sheet_ids: - # [0] because only one sheet possible for an employee between 2 dates - res[attendance.id] = sheet_obj.name_get(cursor, user, sheet_ids, context=context)[0] + res[attendance.id] = self._get_current_sheet(cursor, user, attendance.employee_id.id, attendance.name, context=context) return res _columns = { @@ -420,16 +424,15 @@ class hr_attendance(osv.osv): def create(self, cr, uid, vals, context=None): if context is None: context = {} - if 'sheet_id' in context: - ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context) + + sheet_id = context.get('sheet_id') or self._get_current_sheet(cr, uid, vals.get('employee_id'), vals.get('name'), context=context) + if sheet_id: + ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, sheet_id, context=context) if ts.state not in ('draft', 'new'): - raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.')) - res = super(hr_attendance,self).create(cr, uid, vals, context=context) - if 'sheet_id' in context: - if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id: - raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \ - 'date outside the current timesheet dates.')) - return res + raise osv.except_osv(_('Error!'), _('You can not enter an attendance in a submitted timesheet. Ask your manager to reset it before adding attendance.')) + elif ts.date_from > vals.get('name') or ts.date_to < vals.get('name'): + raise osv.except_osv(_('User Error!'), _('You can not enter an attendance date outside the current timesheet dates.')) + return super(hr_attendance,self).create(cr, uid, vals, context=context) def unlink(self, cr, uid, ids, *args, **kwargs): if isinstance(ids, (int, long)): From 10d3dd4ec3aece711ed64bc4c3fbd76c39d81900 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 24 Apr 2014 18:08:33 +0200 Subject: [PATCH 3/6] [FIX] update to latest version saas code with updated underscore lib bzr revid: mat@openerp.com-20140424160833-p0uf6zzst0pnj3i7 --- addons/web/static/src/js/views.js | 34 ++++--------------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 78aeb299d8d..3e6bb080450 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1348,13 +1348,12 @@ instance.web.View = instance.web.Widget.extend({ var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {}); var handler = function (action) { if (action && action.constructor == Object) { - // filter out context keys that are specific to the action model. - // Wrong default_ and search_default values will no give the expected views + // filter out context keys that are specific to the current action. + // Wrong default_* and search_default_* values will no give the expected result // Wrong group_by values will simply fail and forbid rendering of the destination view - var view_refs = _(action.views).map(function(view){return view[1] + '_view_ref';}).join('|'); var ncontext = new instance.web.CompoundContext( - self.object(_.reject(self.pairs(dataset.get_context().eval()), function(pair) { - return pair[0].match('^(?:(?:default_|search_default_)|(?:'+view_refs+')|group_by|group_by_no_leaf|active_id|active_ids)$') !== null; + _.object(_.reject(_.pairs(dataset.get_context().eval()), function(pair) { + return pair[0].match('^(?:(?:default_|search_default_).+|.+_view_ref|group_by|group_by_no_leaf|active_id|active_ids)$') !== null; })) ); ncontext.add(action_data.context || {}); @@ -1406,31 +1405,6 @@ instance.web.View = instance.web.Widget.extend({ return dataset.exec_workflow(record_id, action_data.name).then(handler); } }, - // Convert an object into a list of `[key, value]` pairs. - pairs: function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = new Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }, - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - object: function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, length = list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }, /** * Directly set a view to use instead of calling fields_view_get. This method must * be called before start(). When an embedded view is set, underlying implementations From 12eb1573973d2352a0b26c685ac2571de4387595 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 25 Apr 2014 14:55:07 +0200 Subject: [PATCH 4/6] [FIX] product: price computation failed when for pricelists based on Cost price for non-employee users bzr revid: dle@openerp.com-20140425125507-njfyl1r6wn11vqwx --- addons/product/product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 34503b5136e..5d6fb7a15bc 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -24,7 +24,7 @@ import re from _common import ceiling -from openerp import tools +from openerp import tools, SUPERUSER_ID from openerp.osv import osv, fields from openerp.tools.translate import _ @@ -703,7 +703,7 @@ class product_product(osv.osv): res = {} product_uom_obj = self.pool.get('product.uom') - for product in self.browse(cr, uid, ids, context=context): + for product in self.browse(cr, SUPERUSER_ID, ids, context=context): res[product.id] = product[ptype] or 0.0 if ptype == 'list_price': res[product.id] = (res[product.id] * (product.price_margin or 1.0)) + \ From 986e466bf206a1c8b87433bcce5ab0cf89aa7c4e Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 25 Apr 2014 15:34:21 +0200 Subject: [PATCH 5/6] [FIX] multi_company: set currency of OpenERP US to USD in the demo data bzr revid: dle@openerp.com-20140425133421-czisl2dpm5hletts --- addons/multi_company/multi_company_demo.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/multi_company/multi_company_demo.xml b/addons/multi_company/multi_company_demo.xml index 088aa35e915..bf963146267 100644 --- a/addons/multi_company/multi_company_demo.xml +++ b/addons/multi_company/multi_company_demo.xml @@ -28,7 +28,7 @@ - + OpenERP US @@ -450,7 +450,7 @@ - + From a2536d5e3271160d9d67d49268b0d4f7960588bf Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of openerp <> Date: Sun, 27 Apr 2014 06:18:44 +0000 Subject: [PATCH 6/6] Launchpad automatic translations update. bzr revid: launchpad_translations_on_behalf_of_openerp-20140427061844-eycgmbqvphlakiz3 --- addons/account_anglo_saxon/i18n/sk.po | 62 +++++++++++ addons/account_report_company/i18n/mk.po | 62 +++++++++++ addons/association/i18n/sk.po | 135 +++++++++++++++++++++++ 3 files changed, 259 insertions(+) create mode 100644 addons/account_anglo_saxon/i18n/sk.po create mode 100644 addons/account_report_company/i18n/mk.po create mode 100644 addons/association/i18n/sk.po diff --git a/addons/account_anglo_saxon/i18n/sk.po b/addons/account_anglo_saxon/i18n/sk.po new file mode 100644 index 00000000000..e3452974d53 --- /dev/null +++ b/addons/account_anglo_saxon/i18n/sk.po @@ -0,0 +1,62 @@ +# Slovak translation for openobject-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-06-07 19:36+0000\n" +"PO-Revision-Date: 2014-04-26 16:04+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n" +"X-Generator: Launchpad (build 16985)\n" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_product_category +msgid "Product Category" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line +msgid "Invoice Line" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_product_template +msgid "Product Template" +msgstr "" + +#. module: account_anglo_saxon +#: field:product.category,property_account_creditor_price_difference_categ:0 +#: field:product.template,property_account_creditor_price_difference:0 +msgid "Price Difference Account" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_anglo_saxon +#: model:ir.model,name:account_anglo_saxon.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: account_anglo_saxon +#: help:product.category,property_account_creditor_price_difference_categ:0 +#: help:product.template,property_account_creditor_price_difference:0 +msgid "" +"This account will be used to value price difference between purchase price " +"and cost price." +msgstr "" diff --git a/addons/account_report_company/i18n/mk.po b/addons/account_report_company/i18n/mk.po new file mode 100644 index 00000000000..c738c069832 --- /dev/null +++ b/addons/account_report_company/i18n/mk.po @@ -0,0 +1,62 @@ +# Macedonian translation for openobject-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-06-07 19:36+0000\n" +"PO-Revision-Date: 2014-04-26 12:11+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Macedonian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n" +"X-Generator: Launchpad (build 16985)\n" + +#. module: account_report_company +#: field:res.partner,display_name:0 +msgid "Name" +msgstr "" + +#. module: account_report_company +#: field:account.invoice,commercial_partner_id:0 +#: help:account.invoice.report,commercial_partner_id:0 +msgid "Commercial Entity" +msgstr "" + +#. module: account_report_company +#: field:account.invoice.report,commercial_partner_id:0 +msgid "Partner Company" +msgstr "" + +#. module: account_report_company +#: model:ir.model,name:account_report_company.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_report_company +#: view:account.invoice:0 +#: view:account.invoice.report:0 +#: model:ir.model,name:account_report_company.model_res_partner +msgid "Partner" +msgstr "" + +#. module: account_report_company +#: model:ir.model,name:account_report_company.model_account_invoice_report +msgid "Invoices Statistics" +msgstr "" + +#. module: account_report_company +#: view:res.partner:0 +msgid "True" +msgstr "" + +#. module: account_report_company +#: help:account.invoice,commercial_partner_id:0 +msgid "" +"The commercial entity that will be used on Journal Entries for this invoice" +msgstr "" diff --git a/addons/association/i18n/sk.po b/addons/association/i18n/sk.po new file mode 100644 index 00000000000..dfce4c381b6 --- /dev/null +++ b/addons/association/i18n/sk.po @@ -0,0 +1,135 @@ +# Slovak translation for openobject-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-01-11 11:14+0000\n" +"PO-Revision-Date: 2014-04-26 16:22+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Slovak \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-04-27 06:18+0000\n" +"X-Generator: Launchpad (build 16985)\n" + +#. module: association +#: field:profile.association.config.install_modules_wizard,wiki:0 +msgid "Wiki" +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +msgid "Event Management" +msgstr "" + +#. module: association +#: field:profile.association.config.install_modules_wizard,project_gtd:0 +msgid "Getting Things Done" +msgstr "" + +#. module: association +#: model:ir.module.module,description:association.module_meta_information +msgid "This module is to create Profile for Associates" +msgstr "" + +#. module: association +#: field:profile.association.config.install_modules_wizard,progress:0 +msgid "Configuration Progress" +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +msgid "" +"Here are specific applications related to the Association Profile you " +"selected." +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +msgid "title" +msgstr "" + +#. module: association +#: help:profile.association.config.install_modules_wizard,event_project:0 +msgid "Helps you to manage and organize your events." +msgstr "" + +#. module: association +#: field:profile.association.config.install_modules_wizard,config_logo:0 +msgid "Image" +msgstr "" + +#. module: association +#: help:profile.association.config.install_modules_wizard,hr_expense:0 +msgid "" +"Tracks and manages employee expenses, and can automatically re-invoice " +"clients if the expenses are project-related." +msgstr "" + +#. module: association +#: help:profile.association.config.install_modules_wizard,project_gtd:0 +msgid "" +"GTD is a methodology to efficiently organise yourself and your tasks. This " +"module fully integrates GTD principle with OpenERP's project management." +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +msgid "Resources Management" +msgstr "" + +#. module: association +#: model:ir.module.module,shortdesc:association.module_meta_information +msgid "Association profile" +msgstr "" + +#. module: association +#: field:profile.association.config.install_modules_wizard,hr_expense:0 +msgid "Expenses Tracking" +msgstr "" + +#. module: association +#: model:ir.actions.act_window,name:association.action_config_install_module +#: view:profile.association.config.install_modules_wizard:0 +msgid "Association Application Configuration" +msgstr "" + +#. module: association +#: help:profile.association.config.install_modules_wizard,wiki:0 +msgid "" +"Lets you create wiki pages and page groups in order to keep track of " +"business knowledge and share it with and between your employees." +msgstr "" + +#. module: association +#: help:profile.association.config.install_modules_wizard,project:0 +msgid "" +"Helps you manage your projects and tasks by tracking them, generating " +"plannings, etc..." +msgstr "" + +#. module: association +#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard +msgid "profile.association.config.install_modules_wizard" +msgstr "" + +#. module: association +#: field:profile.association.config.install_modules_wizard,event_project:0 +msgid "Events" +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +#: field:profile.association.config.install_modules_wizard,project:0 +msgid "Project Management" +msgstr "" + +#. module: association +#: view:profile.association.config.install_modules_wizard:0 +msgid "Configure" +msgstr ""