diff --git a/addons/account_payment/i18n/es.po b/addons/account_payment/i18n/es.po index a5a91e24093..00870fc971e 100644 --- a/addons/account_payment/i18n/es.po +++ b/addons/account_payment/i18n/es.po @@ -12,13 +12,14 @@ # Pedro M. Baeza , 2017 # Nicolás Broggi , 2018 # RGB Consulting , 2018 +# Carlos Vásquez , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~11.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-22 14:10+0000\n" "PO-Revision-Date: 2018-03-22 14:10+0000\n" -"Last-Translator: RGB Consulting , 2018\n" +"Last-Translator: Carlos Vásquez , 2018\n" "Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -174,6 +175,8 @@ msgid "" "The invoice was not confirmed despite response from the acquirer (%s): " "invoice amount is %r but acquirer replied with %r." msgstr "" +"La factura no fue confirmada a pesar de la respuesta del cliente (%s): el " +"monto de la factura es %r pero el cliente respondió con %r." #. module: account_payment #: model:ir.ui.view,arch_db:account_payment.portal_invoice_error diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py index 396b05bee0e..2dcd9cb373a 100644 --- a/addons/auth_signup/models/res_users.py +++ b/addons/auth_signup/models/res_users.py @@ -118,7 +118,7 @@ class ResUsers(models.Model): if not values.get('login'): raise ValueError(_('Signup: no login given for new user')) - if not values.get('partner_id') or not values.get('name'): + if not values.get('partner_id') and not values.get('name'): raise ValueError(_('Signup: no name or partner given for new user')) # create a copy of the template user (attached to a specific partner_id if given) diff --git a/addons/base_import/i18n/es.po b/addons/base_import/i18n/es.po index 76ffa8fceec..289e37980aa 100644 --- a/addons/base_import/i18n/es.po +++ b/addons/base_import/i18n/es.po @@ -17,13 +17,14 @@ # RGB Consulting , 2017 # Pedro M. Baeza , 2017 # e2f , 2018 +# Carlos Vásquez , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~11.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-22 14:10+0000\n" "PO-Revision-Date: 2018-03-22 14:10+0000\n" -"Last-Translator: e2f , 2018\n" +"Last-Translator: Carlos Vásquez , 2018\n" "Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -154,7 +155,7 @@ msgstr "Separador de decimales:" #: code:addons/base_import/static/src/xml/base_import.xml:76 #, python-format msgid "Defer parent/child computation" -msgstr "" +msgstr "Diferir cálculo de padres e hijos" #. module: base_import #: model:ir.model.fields,field_description:base_import.field_base_import_import__display_name @@ -331,6 +332,9 @@ msgid "" " parent / child relation occurs on every line, and lead" " to a slower import. Defering it can speed up import." msgstr "" +"Si el modelo utiliza relaciones padre/hijo, se calcula la relación hija en " +"cada línea, lo que lleva a una importación lenta. Diferir el proceso de " +"cálculo puede acelerar la importación." #. module: base_import #. openerp-web diff --git a/addons/bus/static/src/js/bus.js b/addons/bus/static/src/js/bus.js index fcb2860285c..e93d2112d2f 100644 --- a/addons/bus/static/src/js/bus.js +++ b/addons/bus/static/src/js/bus.js @@ -14,9 +14,17 @@ var MASTER_TAB_HEARTBEAT_PERIOD = 1500; // 1.5 second bus.ERROR_DELAY = 10000; bus.Bus = Widget.extend({ - init: function () { + /** + * @override + * @param {Object} params + * @param {Object} params.session the session to use to perform the poll RPC + * @param {string} params.pollRoute the longpolling route to use + */ + init: function (params) { var self = this; this._super(); + this.pollRoute = params.pollRoute; + this.session = params.session; this.options = {}; this.activated = false; this.bus_id = _.uniqueId('bus'); @@ -77,7 +85,7 @@ bus.Bus = Widget.extend({ } var data = {channels: self.channels, last: self.last, options: options}; // The backend has a maximum cycle time of 50 seconds so give +10 seconds - this._pollRpc = session.rpc('/longpolling/poll', data, {shadow : true, timeout: 60000}); + this._pollRpc = session.rpc(this.pollRoute, data, {shadow : true, timeout: 60000}); this._pollRpc.then(function (result) { self._pollRpc = false; self.on_notification(result); @@ -164,13 +172,17 @@ bus.Bus = Widget.extend({ * - bus.tab_list : list of opened tab ids * - bus.tab_master : generated id of the master tab */ -var CrossTabBus = bus.Bus.extend({ +bus.CrossTabBus = bus.Bus.extend({ init: function () { this._super.apply(this, arguments); + + // used to prefix localStorage keys + this.sanitizedOrigin = this.session.origin.replace(/:\/{0,2}/g, '_'); + this.is_master = false; this.is_registered = false; - if (parseInt(getItem('bus.last_ts', 0)) + 50000 < new Date().getTime()) { - setItem('bus.last', -1); + if (parseInt(this._getItem('last_ts', 0)) + 50000 < new Date().getTime()) { + this._setItem('last', -1); } on("storage", this.on_storage.bind(this)); @@ -189,15 +201,15 @@ var CrossTabBus = bus.Bus.extend({ // Write last_presence in local storage if it has been updated since last heartbeat var hb_period = this.is_master ? MASTER_TAB_HEARTBEAT_PERIOD : TAB_HEARTBEAT_PERIOD; if (self.last_presence + hb_period > new Date().getTime()) { - setItem('bus.last_presence', self.last_presence); + self._setItem('last_presence', self.last_presence); } - }); + }, this._generateKey.bind(this)); if (this.is_master) { - setItem('bus.channels', this.channels); - setItem('bus.options', this.options); + this._setItem('channels', this.channels); + this._setItem('options', this.options); } else { - this.channels = getItem('bus.channels', this.channels); - this.options = getItem('bus.options', this.options); + this.channels = this._getItem('channels', this.channels); + this.options = this._getItem('options', this.options); } return; // start_polling will be called again on tab registration } @@ -208,7 +220,7 @@ var CrossTabBus = bus.Bus.extend({ }, on_notification: function (notifications) { if (this.is_master) { // broadcast to other tabs - var last = getItem('bus.last', -1); + var last = this._getItem('last', -1); var max_id = Math.max(last, 0); var new_notifications = _.filter(notifications, function (notif) { max_id = Math.max(max_id, notif.id); @@ -216,9 +228,9 @@ var CrossTabBus = bus.Bus.extend({ }); this.last = max_id; if (new_notifications.length) { - setItem('bus.last', max_id); - setItem('bus.last_ts', new Date().getTime()); - setItem('bus.notification', new_notifications); + this._setItem('last', max_id); + this._setItem('last_ts', new Date().getTime()); + this._setItem('notification', new_notifications); this._super(new_notifications); } } else { @@ -230,45 +242,78 @@ var CrossTabBus = bus.Bus.extend({ // localStorage (avoid race condition) var value = e.newValue; // notifications changed - if (e.key === 'bus.notification') { + if (e.key === this._generateKey('notification')) { var notifs = JSON.parse(value); this.on_notification(notifs); } // update channels - if (e.key === 'bus.channels') { + if (e.key === this._generateKey('channels')) { this.channels = JSON.parse(value); } // update options - if (e.key === 'bus.options') { + if (e.key === this._generateKey('options')) { this.options = JSON.parse(value); } // update focus - if (e.key === 'bus.focus') { + if (e.key === this._generateKey('focus')) { this.set('window_focus', JSON.parse(value)); } }, add_channel: function () { this._super.apply(this, arguments); - setItem('bus.channels', this.channels); + this._setItem('channels', this.channels); }, delete_channel: function () { this._super.apply(this, arguments); - setItem('bus.channels', this.channels); + this._setItem('channels', this.channels); }, get_last_presence: function () { - return getItem('bus.last_presence') || new Date().getTime(); + return this._getItem('last_presence') || new Date().getTime(); }, update_option: function () { this._super.apply(this, arguments); - setItem('bus.options', this.options); + this._setItem('options', this.options); }, delete_option: function () { this._super.apply(this, arguments); - setItem('bus.options', this.options); + this._setItem('options', this.options); }, focus_change: function (focus) { this._super.apply(this, arguments); - setItem('bus.focus', focus); + this._setItem('focus', focus); + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * Generates localStorage keys prefixed by bus. (the name of this addon), + * and the sanitized origin, to prevent keys from conflicting when several + * bus instances (polling different origins) co-exist. + * + * @private + * @param {string} key + * @returns key prefixed with the origin + */ + _generateKey: function (key) { + return 'bus.' + this.sanitizedOrigin + '.' + key; + }, + /** + * @private + * @param {string} key + * @param {*} defaultValue + */ + _getItem: function (key, defaultValue) { + return getItem(this._generateKey(key), defaultValue); + }, + /** + * @private + * @param {string} key + * @param {*} value + */ + _setItem: function (key, value) { + setItem(this._generateKey(key), value); }, }); @@ -291,14 +336,16 @@ function setItem(key, value) { local_storage.setItem(key, JSON.stringify(value)); } + var tab_manager = { - peersKey: 'bus.peers', - masterKey: 'bus.master', - heartbeatKey: 'bus.heartbeat', isMaster: false, id: new Date().getTime() + ':' + (Math.random() * 1000000000 | 0), - register_tab: function (is_master_callback, is_no_longer_master, on_heartbeat_callback) { + register_tab: function (is_master_callback, is_no_longer_master, on_heartbeat_callback, generateKey) { + this.heartbeatKey = generateKey('heartbeat'); + this.masterKey = generateKey('master'); + this.peersKey = generateKey('peers'); + this.is_master_callback = is_master_callback; this.is_no_longer_master = is_no_longer_master || function () {}; this.on_heartbeat_callback = on_heartbeat_callback || function () {}; @@ -417,10 +464,14 @@ var tab_manager = { // bus singleton, depending of the browser : // if supporting LocalStorage, there will be only one tab polling +var params = { + pollRoute: '/longpolling/poll', + session: session, +}; if (typeof Storage !== "undefined") { - bus.bus = new CrossTabBus(); + bus.bus = new bus.CrossTabBus(params); } else { - bus.bus = new bus.Bus(); + bus.bus = new bus.Bus(params); } return bus; diff --git a/addons/crm/i18n/es.po b/addons/crm/i18n/es.po index ae19b1c0c3a..314691cb429 100644 --- a/addons/crm/i18n/es.po +++ b/addons/crm/i18n/es.po @@ -34,13 +34,14 @@ # Juan José Scarafía , 2017 # Pablo Rojas , 2018 # José Matias Zuazo , 2018 +# Carlos Vásquez , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~11.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-22 14:09+0000\n" "PO-Revision-Date: 2018-03-22 14:09+0000\n" -"Last-Translator: José Matias Zuazo , 2018\n" +"Last-Translator: Carlos Vásquez , 2018\n" "Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1053,7 +1054,7 @@ msgstr "Forzar asignación" #. module: crm #: model:ir.ui.view,arch_db:crm.res_config_settings_view_form msgid "Format phone numbers based on national conventions" -msgstr "" +msgstr "Dar formato a los números de teléfono basado en estándares nacionales" #. module: crm #: code:addons/crm/models/crm_lead.py:588 @@ -1461,12 +1462,12 @@ msgstr "" #. module: crm #: model:ir.actions.server,name:crm.action_mark_activities_done msgid "Mark All Activities as Done" -msgstr "" +msgstr "Marcar Todas las Actividades como Hechas" #. module: crm #: model:ir.actions.server,name:crm.action_mark_late_activities_done msgid "Mark Late Activities as Done" -msgstr "" +msgstr "Marcar Actividades Atrasadas como Hechas" #. module: crm #: model:ir.ui.view,arch_db:crm.crm_case_form_view_oppor @@ -1912,7 +1913,7 @@ msgstr "Teléfono" #. module: crm #: model:ir.model.fields,field_description:crm.field_res_config_settings__module_crm_phone_validation msgid "Phone Formatting" -msgstr "" +msgstr "Formateo de Números Telefónicos" #. module: crm #: code:addons/crm/models/crm_team.py:165 diff --git a/addons/delivery/i18n/es.po b/addons/delivery/i18n/es.po index ead6ed6ee13..5f080a4446f 100644 --- a/addons/delivery/i18n/es.po +++ b/addons/delivery/i18n/es.po @@ -25,13 +25,14 @@ # Christopher Ormaza , 2017 # Nicolás Broggi , 2018 # e2f , 2018 +# Carlos Vásquez , 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~11.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-03-22 14:10+0000\n" "PO-Revision-Date: 2018-03-22 14:10+0000\n" -"Last-Translator: e2f , 2018\n" +"Last-Translator: Carlos Vásquez , 2018\n" "Language-Team: Spanish (https://www.transifex.com/odoo/teams/41243/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -751,7 +752,7 @@ msgstr "Peso del envío" #: model:ir.ui.view,arch_db:delivery.report_package_barcode_delivery #: model:ir.ui.view,arch_db:delivery.report_package_barcode_small_delivery msgid "Shipping Weight:" -msgstr "" +msgstr "Peso del envío:" #. module: delivery #: model:ir.model.fields,help:delivery.field_product_product__hs_code @@ -884,7 +885,7 @@ msgstr "" #: model:ir.ui.view,arch_db:delivery.report_package_barcode_delivery #: model:ir.ui.view,arch_db:delivery.report_package_barcode_small_delivery msgid "Weight:" -msgstr "" +msgstr "Peso:" #. module: delivery #: model:ir.model.fields,field_description:delivery.field_product_packaging__width diff --git a/addons/delivery/models/delivery_carrier.py b/addons/delivery/models/delivery_carrier.py index 41ea4cc7682..dafb0e484b4 100644 --- a/addons/delivery/models/delivery_carrier.py +++ b/addons/delivery/models/delivery_carrier.py @@ -34,7 +34,7 @@ class DeliveryCarrier(models.Model): # Internals for shipping providers # # -------------------------------- # - name = fields.Char(required=True) + name = fields.Char(required=True, translate=True) active = fields.Boolean(default=True) sequence = fields.Integer(help="Determine the display order", default=10) # This field will be overwritten by internal shipping providers by adding their own type (ex: 'fedex') diff --git a/addons/delivery/models/sale_order.py b/addons/delivery/models/sale_order.py index b2ffaf67231..4402cb5a127 100644 --- a/addons/delivery/models/sale_order.py +++ b/addons/delivery/models/sale_order.py @@ -96,10 +96,9 @@ class SaleOrder(models.Model): taxes_ids = self.fiscal_position_id.map_tax(taxes, carrier.product_id, self.partner_id).ids # Create the sales order line - carrier_name = carrier.product_id.with_context(lang=self.partner_id.lang).name_get()[0][1] values = { 'order_id': self.id, - 'name': carrier_name, + 'name': carrier.with_context(lang=self.partner_id.lang).name, 'product_uom_qty': 1, 'product_uom': carrier.product_id.uom_id.id, 'product_id': carrier.product_id.id, diff --git a/addons/hr_holidays/models/hr.py b/addons/hr_holidays/models/hr.py index ccd960a60f2..17b7cd93785 100644 --- a/addons/hr_holidays/models/hr.py +++ b/addons/hr_holidays/models/hr.py @@ -224,11 +224,13 @@ class Employee(models.Model): def write(self, values): res = super(Employee, self).write(values) if 'parent_id' in values or 'department_id' in values: - holidays = self.env['hr.leave'].search([('state', 'in', ['draft', 'confirm']), ('employee_id', 'in', self.ids)]) hr_vals = {} if values.get('parent_id') is not None: hr_vals['manager_id'] = values['parent_id'] if values.get('department_id') is not None: hr_vals['department_id'] = values['department_id'] + holidays = self.env['hr.leave'].search([('state', 'in', ['draft', 'confirm']), ('employee_id', 'in', self.ids)]) holidays.write(hr_vals) + allocations = self.env['hr.leave.allocation'].search([('state', 'in', ['draft', 'confirm']), ('employee_id', 'in', self.ids)]) + allocations.write(hr_vals) return res diff --git a/addons/hr_payroll/views/hr_salary_rule_views.xml b/addons/hr_payroll/views/hr_salary_rule_views.xml index 41571aec0ed..14b222eaaf8 100644 --- a/addons/hr_payroll/views/hr_salary_rule_views.xml +++ b/addons/hr_payroll/views/hr_salary_rule_views.xml @@ -132,18 +132,6 @@ - - hr.salary.rule.category.tree.view - hr.salary.rule.category - children_ids - - - - - - - - hr.salary.rule.category.select @@ -169,20 +157,6 @@ sequence="11" groups="base.group_no_one" /> - - Salary Rule Categories Hierarchy - hr.salary.rule.category - tree - [('parent_id','=',False)] - - -