From deacba0ed6bb4d50eb22cfa8a8ac528b65744138 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 14 Aug 2014 12:00:27 +0200 Subject: [PATCH 01/26] [IMP] base: no default domain for partner's title The title field should not have a domain by default. When a new record is created or the 'is company' field is changed, the onchange_type is triggered to restrict the domain accordingly to is_company field. When an existing record is modified, there will have no domain on title field. It's not ideal but at least companies will be able to change the title without the need to modify twice the field is_company. Fixes #1713 --- openerp/addons/base/res/res_partner_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index 5fa95114d50..2f442479434 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -179,7 +179,7 @@ - + From 9207748a7121f540a0bfb07231efabf14dd450b8 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 13 Aug 2014 14:55:03 +0530 Subject: [PATCH 02/26] [FIX] Fixed the issue of calendar view reload events inconsistency, when the slow create popup creates event through any form button which is kind of object, action or workflow at that time events are reloaded but still button action is not called like workflow is not triggered and hence state of the event is still not changed and due to domain newly created event is filtered, note that events are refetched when create_completed is triggered and create_completed is triggered right after creation of record, but there are case where some form button changes state of the record and it requires to refetched for example we have scenario in mrp order planning where Confirm Production creates event but before workflow is triggered and state of the event is changed, events are reloaded and newly created event will not returned because of domain. --- addons/web_calendar/static/src/js/web_calendar.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/web_calendar/static/src/js/web_calendar.js b/addons/web_calendar/static/src/js/web_calendar.js index ad49ff9a9b1..388fd0c8da1 100644 --- a/addons/web_calendar/static/src/js/web_calendar.js +++ b/addons/web_calendar/static/src/js/web_calendar.js @@ -1084,6 +1084,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; @@ -1123,9 +1124,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; From 971ffa3db10d23108873446a06d7eb848c9512dd Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 14 Aug 2014 15:46:37 +0200 Subject: [PATCH 03/26] [FIX] account: reconcile: no useless revalidation Avoid revalidating the complete account moves that contain the lines being reconciled. The reconciliation does not change the validity of those moves anyway. This represents a very important speed up of reconciliation when moves with several hundred lines are involved. --- addons/account/account.py | 3 ++- addons/account/account_move_line.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index a42bab8e7f5..a12b5bd1052 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1682,7 +1682,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 b3f21eb1525..cf14d465f47 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -803,11 +803,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 True def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False, context=None): @@ -932,11 +935,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) wf_service = netsvc.LocalService("workflow") # 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) From fa27d284947451b83f1807d6d6039ec0cea663c5 Mon Sep 17 00:00:00 2001 From: Rifakat Date: Thu, 7 Aug 2014 16:56:27 +0200 Subject: [PATCH 04/26] [FIX] stock: inventory lines with no production lot: compare with correct stock level Inventory lines without production lot number should be compared with the stock level of products without a production lot. Otherwise the final result of a validated inventory is wrong as soon as there are lines with and without production lot for the same product. Adds corresponding regression test. Fixes https://bugs.launchpad.net/openobject-addons/+bug/1008099 Manual rebase of #1658, courtesy of Numerigraphe --- addons/stock/product.py | 2 ++ addons/stock/test/opening_stock.yml | 30 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/addons/stock/product.py b/addons/stock/product.py index 5db1e1b3164..3050d2aff28 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -283,6 +283,8 @@ class product_product(osv.osv): if prodlot_id: prodlot_clause = ' and prodlot_id = %s ' where += [prodlot_id] + elif 'prodlot_id' in context and not prodlot_id: + prodlot_clause = ' and prodlot_id is null ' # TODO: perhaps merge in one query. if 'in' in what: diff --git a/addons/stock/test/opening_stock.yml b/addons/stock/test/opening_stock.yml index 9efcfd3af99..5dfb5c4b9fa 100644 --- a/addons/stock/test/opening_stock.yml +++ b/addons/stock/test/opening_stock.yml @@ -37,6 +37,36 @@ !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 10, "Stock is not updated." +- + I update the current stock of the Ice-cream with 10 kgm without Production Lot. +- + !record {model: stock.change.product.qty, id: change_qty_nolot}: + location_id: location_monitor_small + new_quantity: 10 + product_id: product_product_6 +- + !python {model: stock.change.product.qty}: | + self.change_product_qty(cr, uid, [ref('change_qty_nolot')], context=dict(context, active_id=ref('product_product_6'))) +- + I check available stock of Ice-cream after update stock. +- + !python {model: product.product}: | + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert product.qty_available == 20, "Real stock is not updated." +- + I revert 10kgm updated stock again with no production lot in order to level the stock +- + !record {model: stock.change.product.qty, id: change_qty_nolot_1}: + location_id: location_monitor_small + new_quantity: 0 + product_id: product_product_6 +- + !python {model: stock.change.product.qty}: | + self.change_product_qty(cr, uid, [ref('change_qty_nolot_1')], context=dict(context, active_id=ref('product_product_6'))) +- + !python {model: product.product}: | + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert product.qty_available == 10, "Real stock is not updated." - Stock user can merge inventory, so let's check data with giving the access rights of user. - From dcd26acccfb9ffb021060bdc076241024bae6452 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 14 Aug 2014 17:33:59 +0200 Subject: [PATCH 05/26] [FIX] web: do not focus if the focus_field is not a field Sometimes, focus_field could be a button, and in such cases, we should not focus on it opw-612045 --- addons/web/static/src/js/view_list_editable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index f3ee5dbb7ad..8cb34418bdb 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -255,7 +255,7 @@ openerp.web.list_editable = function (instance) { 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 () { From 97d097a2af8c3992d5108bd75b82fa8479d196cc Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 14 Aug 2014 18:01:37 +0200 Subject: [PATCH 06/26] [FIX] point_of_sale: field date of report.pos.order should be a datetime The date_order field of the pos.order is a datetime, not a date As, in report.pos.order, the date field is related to date_order of the pos.order We usually do not commit fixes altering the model fields structure in 7.0, but this one is retro-compatible, as the database structure won't change --- addons/point_of_sale/report/pos_order_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/report/pos_order_report.py b/addons/point_of_sale/report/pos_order_report.py index 62250f11e17..c27738ec230 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), 'year': fields.char('Year', size=4, readonly=True), 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), From 397e83554b09357a227b4d4b4758739a4778748f Mon Sep 17 00:00:00 2001 From: Thomas Groutars Date: Thu, 14 Aug 2014 16:47:01 +0200 Subject: [PATCH 07/26] [FIX] product: make sure unlinked product still exists When uninstalling/updating a module, we may execute unlink method on product.template before product.product. In such cases, the product is already removed after removeing the template (_inherits) and the chained unlink of the product would fail (traceback when browsing). --- addons/product/product.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/product/product.py b/addons/product/product.py index ce17af7f88f..83ab8183f7a 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -589,6 +589,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) From e55098263bd3339370acd027e479df29a28dfeb2 Mon Sep 17 00:00:00 2001 From: JKE-be Date: Mon, 18 Aug 2014 11:39:33 +0200 Subject: [PATCH 08/26] [FIX] website_customer: the extra / for url pager is not need in saas-4 --- addons/website_customer/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py index 2cb9be04abc..34d064f104a 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 From 1d77697a5dec9263b4d382a15ff2c1ac4fb86999 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 18 Aug 2014 13:13:56 +0200 Subject: [PATCH 09/26] [FIX] website_twitter: IE does not accept twitter date format Datetime like Tue Jul 13 23:18:36 +0000 2010 is not accepted by IE and return "Invalid date". Therefore, We parse the date to a format known by IE (and other browsers) Trick took from http://stackoverflow.com/questions/3243546/problem-with-javascript-date-function-in-ie-7-returns-nan --- .../static/src/js/website.twitter.animation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() { From e2532dd8e0ee1b10fa0e1e06bb1c869d4a56c833 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 18 Aug 2014 14:05:41 +0200 Subject: [PATCH 10/26] [FIX] account_analytic_analysis: quantity overdue on quantity exceeded, not reached --- addons/account_analytic_analysis/account_analytic_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index e6cec60f3ce..9a0729ec0cd 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -404,7 +404,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 From 85b08a75f616ff412a36a96ac5ae3c52e06898f1 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 18 Aug 2014 17:50:32 +0200 Subject: [PATCH 11/26] [FIX] account_voucher: avoid error if no partner The field partner_id is not required on an account.voucher but the validation was failing if none was set (opw 611663). This patch makes a fallback on the account of the voucher if neither a partner nor a writeoff account is specified. --- addons/account_voucher/account_voucher.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index ce6a35adb32..3b0bfe80ba4 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1337,10 +1337,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, From f572b27ec8cbf02ae633485d07458d838f1ad0aa Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 18 Aug 2014 17:59:17 +0200 Subject: [PATCH 12/26] [IMP] account_voucher: make the field tax_amount always readonly The field tax_amount is fieled with onchanges and the compute_tax method. Setting a different value than the one computed by the system may lead to unbalanced move (which is obviously wrong). In the future, handeling these operations by setting the correct value to the tax accounts would be better. --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 3b0bfe80ba4..4b19ae6b824 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -367,7 +367,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 #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."), 'number': fields.char('Number', size=32, readonly=True,), 'move_id':fields.many2one('account.move', 'Account Entry'), From cee1f0457d51de48987603131d41eab5ef810508 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 19 Aug 2014 09:48:05 +0200 Subject: [PATCH 13/26] [FIX] sale: define sale_note field before using it as a default value for sale.order When uninstalling/installing sale module, this can be problematic --- addons/sale/sale.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index f7875eb235d..8326fb4a1e5 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -28,6 +28,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'] @@ -992,12 +998,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' From 6164f52ca3d652ac6a8e2936a2c34570564544b3 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Tue, 19 Aug 2014 01:43:47 -0500 Subject: [PATCH 14/26] [FIX] account_voucher: wrong type in context The type 'general' no longer exists on a account.voucher. As in general context, removed the default value on this menu. Fixes #1261, it produces a traceback in 8.0 where the selection fields are less fault-tolerant. --- addons/account_voucher/account_voucher_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index b7ea4b8fc71..c3a1c5c60a8 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'} + {} From ad05669460825e90c6b6d604690e76c1ab372546 Mon Sep 17 00:00:00 2001 From: kevin wang Date: Tue, 19 Aug 2014 10:54:01 +0800 Subject: [PATCH 15/26] [IMP] product: specify a view for 'Variant Values' action --- addons/product/product_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index fecaa91ded4..b9b676075a1 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -180,6 +180,7 @@ product.attribute.value tree form + [('product_ids.product_tmpl_id', '=', active_id)] {'default_product_tmpl_id': active_id} From 9247c37de7d67beb479905e218656665dc12391f Mon Sep 17 00:00:00 2001 From: fka-odoo Date: Wed, 13 Aug 2014 12:43:34 +0530 Subject: [PATCH 16/26] [FIX] web: rendering issue in mail composer on Firefox The cleditor width does not include the margins. Setting 100% will make the editable area too large (104%) on Firefox (opw 611700). Replaced by auto, the default value adviced by CLEditor. --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4f6322ea0a0..8446a4c79fb 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2733,7 +2733,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 From 3b901f0aa03b084e1700c2f43ee89435465b06b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Sun, 17 Aug 2014 01:44:12 +0200 Subject: [PATCH 17/26] [FIX] web: ignored readonly attribute on image widget --- addons/web/static/src/xml/base.xml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 3fc40128cf6..13d7e5df080 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1202,16 +1202,18 @@ -
- - - Edit - - + From 9a763928e1503ab1a56cf73b972e72e6aafefb5c Mon Sep 17 00:00:00 2001 From: Daniel Dico Date: Sat, 16 Aug 2014 00:59:27 -0400 Subject: [PATCH 18/26] [FIX] account_anglo_saxon: variable 'standard_price' referenced before assignment Due to forward-port, the variable standard_price was reintroduced instead of valuation_price_unit Move the change of currency after the fifo/lifo computation. Fixes #1801 --- addons/account_anglo_saxon/invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)}) From 11e4cad9f7ac84fe63054cb5e4d9d4a0c041fdfb Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Mon, 11 Aug 2014 13:21:29 -0400 Subject: [PATCH 19/26] [IMP] auth_oauth: set default 'zocial' css_class The buttons for new providers needs at least the zocial css class to be seen as button. As the field css_class is not in the default form view, add it by default. --- addons/auth_oauth/auth_oauth.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/auth_oauth/auth_oauth.py b/addons/auth_oauth/auth_oauth.py index 34b6aa44936..f9fb206f51e 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", } From 106cb1ec2ba74d07ff389a43565b2b8517070234 Mon Sep 17 00:00:00 2001 From: Martin Ambroz Date: Wed, 20 Aug 2014 08:42:19 +0400 Subject: [PATCH 20/26] [FIX] base: python 2.6 incompatibility for dictionary comprehension --- openerp/osv/fields.py | 4 ++-- openerp/tools/translate.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index ee0ea8fa23a..9ee0c8da506 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -1145,9 +1145,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) for id in ids: diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index 721fb47d9a3..ac011626ce4 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -830,7 +830,7 @@ def trans_generate(lang, modules, cr): def get_module_paths(): # default addons path (base) def_path = os.path.abspath(os.path.join(config.config['root_path'], 'addons')) - mod_paths = { def_path } + mod_paths = set([ def_path ]) ad_paths = map(lambda m: os.path.abspath(m.strip()),config.config['addons_path'].split(',')) for adp in ad_paths: mod_paths.add(adp) @@ -838,7 +838,7 @@ def trans_generate(lang, modules, cr): mod_paths.add(adp) elif adp != def_path and adp.startswith(def_path): mod_paths.add(adp[len(def_path)+1:]) - return mod_paths + return list(mod_paths) def get_module_from_path(path, mod_paths): for mp in mod_paths: From 86f99ef250ef9ffc33b53febd39053f46790e65a Mon Sep 17 00:00:00 2001 From: Hardik Ansodariya Date: Tue, 12 Aug 2014 15:49:15 +0530 Subject: [PATCH 21/26] [IMP] product: filter and group by category_id on product.template Was removed (for unknown reason) during refactoring of product and template (opw 611699) --- addons/product/product_view.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index b9b676075a1..b2d7c5d3744 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -15,10 +15,12 @@ + + From d0a0b7d91de08612cb03bdead4d2789185884402 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 9 Jul 2014 13:56:24 +0200 Subject: [PATCH 22/26] [FIX] purchase: skip move if not linked to a purchase order When this situation happens. the 'cost' is None and the web interface cannot handle this value, provoking a JS error. Thus, prefer to fallback on the standard way to get the cost: based on the current standard price of the product. Fixes #1032 --- addons/purchase/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py index d0055d80c7f..24df0b5eaa0 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -127,7 +127,7 @@ class stock_partial_picking(osv.osv_memory): # Overridden to inject the purchase price as true 'cost price' when processing # incoming pickings. def _product_cost_for_average_update(self, cr, uid, move): - if move.picking_id.purchase_id: + if move.picking_id.purchase_id and move.purchase_line_id: return {'cost': move.purchase_line_id.price_unit, 'currency': move.picking_id.purchase_id.pricelist_id.currency_id.id} return super(stock_partial_picking, self)._product_cost_for_average_update(cr, uid, move) From 3cc9a844db4b8036e0af6842efc3d304f55fa815 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 20 Aug 2014 16:12:25 +0200 Subject: [PATCH 23/26] [FIX] website_forum: portal user are allowed to delete forum post If a portal user has engouh karma, this is possible for him, at least graphically, to delete forum posts, even if is not the author of it. So, he should be allowed to delete forum posts in the ACL --- addons/website_forum/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From c0132100ce3badfb3bc9591e100296225ff550f8 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 20 Aug 2014 17:16:29 +0200 Subject: [PATCH 24/26] [FIX] website translation bug Sometimes a node can't be translated using the website Translate mode. The translation is added to the Application term list but the id of the view is not correct. This happen when a translatable node is a children of a inherited node whose branding could not be kept. data-oe-source-id was left over because it was not registered in MOVABLE_BRANDING --- openerp/addons/base/ir/ir_ui_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index c9ec51b3169..b9156c7006c 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -46,7 +46,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(*args, **kw): if not args and not kw: From f32c88f932f6a27868a24aefb6fe46c0e635bf22 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 20 Aug 2014 17:33:27 +0200 Subject: [PATCH 25/26] [FIX] web: correct /web/proxy/load to set correct base_url --- addons/web/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 6dea47c153a..4889cdb81f6 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -850,7 +850,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): From 39bee35e25ca964f73fea3538c3a5794bff4c142 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 20 Aug 2014 18:23:12 +0200 Subject: [PATCH 26/26] [FIX] base: correct view branding tests after c013210 --- openerp/addons/base/tests/test_views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/addons/base/tests/test_views.py b/openerp/addons/base/tests/test_views.py index 9167b65a70f..125ddcffa2d 100644 --- a/openerp/addons/base/tests/test_views.py +++ b/openerp/addons/base/tests/test_views.py @@ -541,9 +541,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', @@ -609,7 +609,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")