diff --git a/addons/account/account.py b/addons/account/account.py index ac70559fe7d..ddc3d12f4bb 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1647,7 +1647,8 @@ class account_move_reconcile(osv.osv): if not total: self.pool.get('account.move.line').write(cr, uid, map(lambda x: x.id, rec.line_partial_ids), - {'reconcile_id': rec.id } + {'reconcile_id': rec.id }, + context=context ) return True diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 642c209b438..5cac88c7274 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -817,11 +817,14 @@ class account_move_line(osv.osv): if self.pool.get('res.currency').is_zero(cr, uid, currency_id, total): res = self.reconcile(cr, uid, merges+unmerge, context=context, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id) return res + # marking the lines as reconciled does not change their validity, so there is no need + # to revalidate their moves completely. + reconcile_context = dict(context, novalidate=True) r_id = move_rec_obj.create(cr, uid, { 'type': type, 'line_partial_ids': map(lambda x: (4,x,False), merges+unmerge) - }, context=context) - move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=context) + }, context=reconcile_context) + move_rec_obj.reconcile_partial_check(cr, uid, [r_id] + merges_rec, context=reconcile_context) return r_id def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None): @@ -946,11 +949,14 @@ class account_move_line(osv.osv): writeoff_line_ids = [writeoff_line_ids[1]] ids += writeoff_line_ids + # marking the lines as reconciled does not change their validity, so there is no need + # to revalidate their moves completely. + reconcile_context = dict(context, novalidate=True) r_id = move_rec_obj.create(cr, uid, { 'type': type, 'line_id': map(lambda x: (4, x, False), ids), 'line_partial_ids': map(lambda x: (3, x, False), ids) - }) + }, context=reconcile_context) # the id of the move.reconcile is written in the move.line (self) by the create method above # because of the way the line_id are defined: (4, x, False) for id in ids: diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 6015f7f4e05..e7cf8394ccd 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -403,7 +403,7 @@ class account_analytic_account(osv.osv): result = dict.fromkeys(ids, 0) for record in self.browse(cr, uid, ids, context=context): if record.quantity_max > 0.0: - result[record.id] = int(record.hours_quantity >= record.quantity_max) + result[record.id] = int(record.hours_quantity > record.quantity_max) else: result[record.id] = 0 return result diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index 0b3c573b943..ce9c89ad531 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -127,14 +127,14 @@ class account_invoice_line(osv.osv): if line.get('invl_id', 0) == i_line.id and a == line['account_id']: uom = i_line.product_id.uos_id or i_line.product_id.uom_id valuation_price_unit = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.standard_price, i_line.uos_id.id) - if inv.currency_id.id != company_currency: - standard_price = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, standard_price, context={'date': inv.date_invoice}) if i_line.product_id.cost_method != 'standard' and i_line.purchase_line_id: #for average/fifo/lifo costing method, fetch real cost price from incomming moves stock_move_obj = self.pool.get('stock.move') valuation_stock_move = stock_move_obj.search(cr, uid, [('purchase_line_id', '=', i_line.purchase_line_id.id)], limit=1, context=context) if valuation_stock_move: valuation_price_unit = stock_move_obj.browse(cr, uid, valuation_stock_move[0], context=context).price_unit + if inv.currency_id.id != company_currency: + valuation_price_unit = self.pool.get('res.currency').compute(cr, uid, company_currency, inv.currency_id.id, valuation_price_unit, context={'date': inv.date_invoice}) if valuation_price_unit != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc: price_diff = round(i_line.price_unit - valuation_price_unit, account_prec) line.update({'price': round(valuation_price_unit * line['quantity'], account_prec)}) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index a02768079f7..a5f1621de98 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -361,7 +361,7 @@ class account_voucher(osv.osv): \n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \ \n* The \'Cancelled\' status is used when user cancel voucher.'), 'amount': fields.float('Total', digits_compute=dp.get_precision('Account'), required=True, readonly=True, states={'draft':[('readonly',False)]}), - 'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), + 'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True), 'reference': fields.char('Ref #', readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number.", copy=False), 'number': fields.char('Number', readonly=True, copy=False), @@ -1330,10 +1330,14 @@ class account_voucher(osv.osv): if voucher.payment_option == 'with_writeoff': account_id = voucher.writeoff_acc_id.id write_off_name = voucher.comment - elif voucher.type in ('sale', 'receipt'): - account_id = voucher.partner_id.property_account_receivable.id + elif voucher.partner_id: + if voucher.type in ('sale', 'receipt'): + account_id = voucher.partner_id.property_account_receivable.id + else: + account_id = voucher.partner_id.property_account_payable.id else: - account_id = voucher.partner_id.property_account_payable.id + # fallback on account of voucher + account_id = voucher.account_id.id sign = voucher.type == 'payment' and -1 or 1 move_line = { 'name': write_off_name or name, diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 2b93231f741..ffcc8fc4b1b 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -159,7 +159,7 @@ account.voucher form tree,form,graph - {'type':'general'} + {} diff --git a/addons/auth_oauth/auth_oauth.py b/addons/auth_oauth/auth_oauth.py index 62e5b0300c9..303a17bea94 100644 --- a/addons/auth_oauth/auth_oauth.py +++ b/addons/auth_oauth/auth_oauth.py @@ -21,4 +21,5 @@ class auth_oauth_provider(osv.osv): } _defaults = { 'enabled' : False, + 'css_class' : "zocial", } diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index efc46dfe9ce..d8da759de87 100644 --- a/addons/point_of_sale/report/pos_order_report.py +++ b/addons/point_of_sale/report/pos_order_report.py @@ -27,7 +27,7 @@ class pos_order_report(osv.osv): _description = "Point of Sale Orders Statistics" _auto = False _columns = { - 'date': fields.date('Date Order', readonly=True), + 'date': fields.datetime('Date Order', readonly=True), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'state': fields.selection([('draft', 'New'), ('paid', 'Closed'), ('done', 'Synchronized'), ('invoiced', 'Invoiced'), ('cancel', 'Cancelled')], diff --git a/addons/product/product.py b/addons/product/product.py index a7284296222..8c0a919797d 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -937,6 +937,9 @@ class product_product(osv.osv): unlink_ids = [] unlink_product_tmpl_ids = [] for product in self.browse(cr, uid, ids, context=context): + # Check if product still exists, in case it has been unlinked by unlinking its template + if not product.exists(): + continue tmpl_id = product.product_tmpl_id.id # Check if the product is last product of this template other_product_ids = self.search(cr, uid, [('product_tmpl_id', '=', tmpl_id), ('id', '!=', product.id)], context=context) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 5b8b2c113d9..e785e8d1fb3 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -15,10 +15,12 @@ + + @@ -181,6 +183,7 @@ product.attribute.value tree form + [('product_ids.product_tmpl_id', '=', active_id)] {'default_product_tmpl_id': active_id} diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0db6b9cd415..4c28f7cc26e 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -27,6 +27,12 @@ from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FO import openerp.addons.decimal_precision as dp from openerp import workflow +class res_company(osv.Model): + _inherit = "res.company" + _columns = { + 'sale_note': fields.text('Default Terms and Conditions', translate=True, help="Default terms and conditions for quotations."), + } + class sale_order(osv.osv): _name = "sale.order" _inherit = ['mail.thread', 'ir.needaction_mixin'] @@ -1165,12 +1171,6 @@ class sale_order_line(osv.osv): raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a sales order line which is in state \'%s\'.') %(rec.state,)) return super(sale_order_line, self).unlink(cr, uid, ids, context=context) -class res_company(osv.Model): - _inherit = "res.company" - _columns = { - 'sale_note': fields.text('Default Terms and Conditions', translate=True, help="Default terms and conditions for quotations."), - } - class mail_compose_message(osv.Model): _inherit = 'mail.compose.message' diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index c526c0f1127..48a0d282fd0 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -639,7 +639,8 @@ class Proxy(http.Controller): from werkzeug.test import Client from werkzeug.wrappers import BaseResponse - return Client(request.httprequest.app, BaseResponse).get(path).data + base_url = request.httprequest.base_url + return Client(request.httprequest.app, BaseResponse).get(path, base_url=base_url).data class Database(http.Controller): diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 597217ef058..5e55130e395 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2890,7 +2890,7 @@ instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instanc if (! this.get("effective_readonly")) { self._updating_editor = false; this.$textarea = this.$el.find('textarea'); - var width = ((this.node.attrs || {}).editor_width || '100%'); + var width = ((this.node.attrs || {}).editor_width || 'auto'); var height = ((this.node.attrs || {}).editor_height || 250); this.$textarea.cleditor({ width: width, // width not including margins, borders or padding diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index a83e9042199..62a0717d374 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -258,7 +258,7 @@ if (!focus_field){ focus_field = _.find(self.editor.form.fields_order, function(field){ return fields[field] && fields[field].$el.is(':visible:has(input)'); }); } - if (focus_field) fields[focus_field].$el.find('input').select(); + if (focus_field && fields[focus_field]) fields[focus_field].$el.find('input').select(); return record.attributes; }); }).fail(function () { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index e2a6f85a328..d54e4fb964e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1227,16 +1227,18 @@ -
- - - - + + diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index 532dd4f05b6..a1491a4c8f8 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -1037,6 +1037,7 @@ openerp.web_calendar = function(instance) { var self = this; var def = $.Deferred(); var defaults = {}; + var created = false; _.each($.extend({}, this.data_template, data), function(val, field_name) { defaults['default_' + field_name] = val; @@ -1076,9 +1077,14 @@ openerp.web_calendar = function(instance) { } }); pop.on('create_completed', self, function(id) { - self.trigger('slowadded'); + created = true; + self.trigger('slowadded'); }); def.then(function() { + if (created) { + var parent = self.getParent(); + parent.$calendar.fullCalendar('refetchEvents'); + } self.trigger('close'); }); return def; diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 02a42b0b621..793d6067fb7 100644 --- a/addons/website_customer/controllers/main.py +++ b/addons/website_customer/controllers/main.py @@ -59,9 +59,9 @@ class WebsiteCustomer(http.Controller): partner_count = partner_obj.search_count(cr, openerp.SUPERUSER_ID, domain, context=request.context) # pager - url = '/customers/' + url = '/customers' if country_id: - url += 'country/%s' % country_id + url += '/country/%s' % country_id pager = request.website.pager( url=url, total=partner_count, page=page, step=self._references_per_page, scope=7, url_args=post diff --git a/addons/website_forum/security/ir.model.access.csv b/addons/website_forum/security/ir.model.access.csv index 0d00861d65d..7c2a5db9b63 100644 --- a/addons/website_forum/security/ir.model.access.csv +++ b/addons/website_forum/security/ir.model.access.csv @@ -2,7 +2,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_forum_forum,forum.forum,model_forum_forum,,1,0,0,0 access_forum_forum_manager,forum.forum.maanger,model_forum_forum,base.group_erp_manager,1,1,1,1 access_forum_post_public,forum.post.public,model_forum_post,base.group_public,1,0,0,0 -access_forum_post_portal,forum.post.portal,model_forum_post,base.group_portal,1,1,1,0 +access_forum_post_portal,forum.post.portal,model_forum_post,base.group_portal,1,1,1,1 access_forum_post_user,forum.post.user,model_forum_post,base.group_user,1,1,1,1 access_forum_post_vote_public,forum.post.vote.public,model_forum_post_vote,base.group_public,1,0,0,0 access_forum_post_vote_portal,orum.post.vote.portal,model_forum_post_vote,base.group_portal,1,1,1,0 diff --git a/addons/website_twitter/static/src/js/website.twitter.animation.js b/addons/website_twitter/static/src/js/website.twitter.animation.js index bb19fd5e66a..9bd336b98d0 100644 --- a/addons/website_twitter/static/src/js/website.twitter.animation.js +++ b/addons/website_twitter/static/src/js/website.twitter.animation.js @@ -61,7 +61,9 @@ function (hashtag) { return create_link("http://twitter.com/search?q="+hashtag.replace("#",""), hashtag); }); }, parse_date: function(tweet) { - var d = new Date(tweet.created_at); + if (_.isEmpty(tweet.created_at)) return ""; + var v = tweet.created_at.split(' '); + var d = new Date(Date.parse(v[1]+" "+v[2]+", "+v[5]+" "+v[3]+" UTC")); return d.toDateString(); }, setupMouseEvents: function() { diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index fee67eaa903..eda03100376 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -47,7 +47,7 @@ from openerp.tools.translate import _ _logger = logging.getLogger(__name__) -MOVABLE_BRANDING = ['data-oe-model', 'data-oe-id', 'data-oe-field', 'data-oe-xpath'] +MOVABLE_BRANDING = ['data-oe-model', 'data-oe-id', 'data-oe-field', 'data-oe-xpath', 'data-oe-source-id'] def keep_query(*keep_params, **additional_params): """ diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index bf520bd4824..520950b8e8e 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -182,7 +182,7 @@ - + diff --git a/openerp/addons/base/tests/test_views.py b/openerp/addons/base/tests/test_views.py index cf814947d5d..8d79398cd04 100644 --- a/openerp/addons/base/tests/test_views.py +++ b/openerp/addons/base/tests/test_views.py @@ -544,9 +544,9 @@ class TestTemplating(ViewCase): 'data-oe-id': str(id2), 'data-oe-field': 'arch', 'data-oe-xpath': '/xpath/item/content[1]', + 'data-oe-source-id': str(id) }), { 'order': '2', - 'data-oe-source-id': str(id) }), E.item({ 'order': '1', @@ -612,7 +612,7 @@ class TestTemplating(ViewCase): {'t-ignore': 'true', 'order': '1'}, E.t({'t-esc': 'foo'}), E.item( - {'order': '2', 'data-oe-source-id': str(id)}, + {'order': '2'}, E.content( {'t-att-href': 'foo'}, "bar") diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 5bac08850f7..4c3ef1f75ad 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1295,9 +1295,9 @@ class function(_column): # if we already have a value, don't recompute it. # This happen if case of stored many2one fields if values and not multi and name in values[0]: - result = {v['id']: v[name] for v in values} + result = dict((v['id'], v[name]) for v in values) elif values and multi and all(n in values[0] for n in name): - result = {v['id']: dict((n, v[n]) for n in name) for v in values} + result = dict((v['id'], dict((n, v[n]) for n in name)) for v in values) else: result = self._fnct(obj, cr, uid, ids, name, self._arg, context) if multi: