diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 653d1e30bd0..fbfd10b1d18 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1312,7 +1312,7 @@ class account_move_line(osv.osv): done = {} for line in self.browse(cr, uid, ids, context=context): err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id)) - if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted): + if line.move_id.state <> 'draft': raise UserError(_('You cannot do this modification on a confirmed entry. You can just change some non legal fields or you must unconfirm the journal entry first.\n%s.') % err_msg) if line.reconcile_id: raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg) diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index 983d57ebecc..ff4b17ccda5 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -45,7 +45,6 @@ class general_ledger(report_sxw.rml_parse, common_report_header): self.init_balance = data['form'].get('initial_balance', True) if self.init_balance: ctx2.update({'initial_bal': True}) - self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2) self.display_account = data['form']['display_account'] self.target_move = data['form'].get('target_move', 'all') ctx = self.context.copy() @@ -54,11 +53,14 @@ class general_ledger(report_sxw.rml_parse, common_report_header): period_from_id = data['form']['period_from'] period_to_id = data['form']['period_to'] ctx['periods'] = self.pool["account.period"].build_ctx_periods(self.cr, self.uid, period_from_id, period_to_id) + # Do not let "_query_get" calculate the periods itself + ctx2.update({'periods': ctx['periods']}) elif data['form']['filter'] == 'filter_date': ctx['date_from'] = data['form']['date_from'] ctx['date_to'] = data['form']['date_to'] ctx['state'] = data['form']['target_move'] self.context.update(ctx) + self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2) if (data['model'] == 'ir.ui.menu'): new_ids = [data['form']['chart_account_id']] objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 862a66da26f..508f1f42d32 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1268,7 +1268,7 @@ class calendar_event(osv.Model): """ if data['interval'] and data['interval'] < 0: raise UserError(_('interval cannot be negative.')) - if data['count'] and data['count'] <= 0: + if data['end_type'] == 'count' and int(data['count']) <= 0: raise UserError(_('Event recurrence interval cannot be negative.')) def get_week_string(freq, data): @@ -1538,6 +1538,7 @@ class calendar_event(osv.Model): recurrent_id=real_event_id, recurrent_id_date=data.get('start'), rrule_type=False, + end_type=False, rrule='', recurrency=False, final_date=datetime.strptime(data.get('start'), DEFAULT_SERVER_DATETIME_FORMAT if data['allday'] else DEFAULT_SERVER_DATETIME_FORMAT) + timedelta(hours=values.get('duration', False) or data.get('duration')) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index fe893ac21a2..d4032669966 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -102,8 +102,11 @@ function reload_favorite_list(result) { }, }); this.ir_model_m2o.insertAfter($('div.oe_calendar_filter')); - this.ir_model_m2o.on('change:value', self, function() { - self.add_filter(); + this.ir_model_m2o.on('change:value', self, function() { + // once selected, we reset the value to false. + if (self.ir_model_m2o.get_value()) { + self.add_filter(); + } }); }, add_filter: function() { diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 3bb5a988537..ae9fc9c69f3 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -361,9 +361,10 @@ class google_calendar(osv.AbstractModel): url = "/calendar/v3/calendars/%s/events/%s" % ('primary', google_id) try: status, content, ask_time = self.pool['google.service']._do_request(cr, uid, url, params, headers, type='GET', context=context) - except: + except Exception, e: _logger.info("Calendar Synchro - In except of get_one_event_synchro") - pass + _logger.info(exception_to_unicode(e)) + return False return status_response(status) and content or False diff --git a/addons/payment_paypal/models/paypal.py b/addons/payment_paypal/models/paypal.py index cfef739ecb7..5a5ae3c9e5a 100644 --- a/addons/payment_paypal/models/paypal.py +++ b/addons/payment_paypal/models/paypal.py @@ -120,8 +120,8 @@ class AcquirerPaypal(osv.Model): 'currency_code': tx_values['currency'] and tx_values['currency'].name or '', 'address1': partner_values['address'], 'city': partner_values['city'], - 'country': partner_values['country'] and partner_values['country'].name or '', - 'state': partner_values['state'] and partner_values['state'].name or '', + 'country': partner_values['country'] and partner_values['country'].code or '', + 'state': partner_values['state'] and (partner_values['state'].code or partner_values['state'].name) or '', 'email': partner_values['email'], 'zip': partner_values['zip'], 'first_name': partner_values['first_name'], diff --git a/addons/product/product.py b/addons/product/product.py index 69daef5d4fc..b3af4829b0a 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -314,7 +314,7 @@ class produce_price_history(osv.osv): 'company_id': fields.many2one('res.company', required=True), 'product_template_id': fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade'), 'datetime': fields.datetime('Historization Time'), - 'cost': fields.float('Historized Cost'), + 'cost': fields.float('Historized Cost', digits_compute=dp.get_precision('Product Price')), } def _get_default_company(self, cr, uid, context=None): diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index f3b0933a5b3..b3df52068eb 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -109,7 +109,7 @@ class product_pricelist(report_sxw.rml_parse): if price_dict[pricelist_id]: price = float_round(price_dict[pricelist_id], precision_digits=sale_price_digits) else: - res = self.pool.get('product.product').read(self.cr, self.uid, [product_id]) + res = self.pool.get('product.product').read(self.cr, self.uid, [product_id], ['list_price']) price = float_round(res[0]['list_price'], precision_digits=sale_price_digits) price = self.formatLang(price, digits=sale_price_digits, currency_obj=pricelist.currency_id) return price diff --git a/doc/cla/individual/gouravchawla.md b/doc/cla/individual/gouravchawla.md new file mode 100644 index 00000000000..cbdd94b3ebe --- /dev/null +++ b/doc/cla/individual/gouravchawla.md @@ -0,0 +1,9 @@ +India, July 10, 2016 + +I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this declaration. + +Signed, + +Gourav Chawla gouravchawla@live.com https://github.com/Gouravchawla diff --git a/doc/reference/guidelines.rst b/doc/reference/guidelines.rst index 17e50fe89ae..fa62b8cb147 100644 --- a/doc/reference/guidelines.rst +++ b/doc/reference/guidelines.rst @@ -129,7 +129,7 @@ When declaring a record in XML, - + diff --git a/doc/reference/views.rst b/doc/reference/views.rst index c0e639eb9ac..30d708f76bb 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -366,7 +366,7 @@ system. Available semantic components are: .. todo:: list of widgets & options & specific attributes (e.g. widget=statusbar - statusbar_visible statusbar_colors clickable) + statusbar_visible clickable) ``options`` JSON object specifying configuration option for the field's widget (including default widgets) @@ -505,13 +505,10 @@ The states are shown following the order used in the field (the list in a selection field, etc). States that are always visible are specified with the attribute ``statusbar_visible``. -``statusbar_colors`` can be used to give a custom color to specific states. - :: + statusbar_visible="draft,sent,progress,invoiced,done" /> The Sheet ''''''''' diff --git a/openerp/service/server.py b/openerp/service/server.py index 6c5204235c0..21b5605da86 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -728,6 +728,7 @@ class WorkerHTTP(Worker): """ HTTP Request workers """ def process_request(self, client, addr): client.setblocking(1) + client.settimeout(0.5) client.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) # Prevent fd inherientence close_on_exec flags = fcntl.fcntl(client, fcntl.F_GETFD) | fcntl.FD_CLOEXEC