From 606eab8ef8d904aed9c83f9cb5b61e237b13b586 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Mon, 13 Jun 2016 19:37:36 +0200 Subject: [PATCH 01/22] [FIX] product: make copy friendlier to overrides Do not force to use " (copy)" when duplicating Closes #12397 --- addons/product/product.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 75e9ccfcc22..c2c081630d3 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -784,8 +784,9 @@ class product_template(osv.osv): def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} - template = self.browse(cr, uid, id, context=context) - default['name'] = _("%s (copy)") % (template['name']) + if 'name' not in default: + template = self.browse(cr, uid, id, context=context) + default['name'] = _("%s (copy)") % (template['name']) return super(product_template, self).copy(cr, uid, id, default=default, context=context) _defaults = { From ae74ebb5ce74b9f62fe1f5222b82983780db2d47 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 16 Jun 2016 11:24:13 +0200 Subject: [PATCH 02/22] [FIX] purchase: `related_usage` must be readonly The `related_usage` field of `purchase.order` is a related field to the location `usage` field, which is defined in order to display/hide some other field in the PO according to the location usage This is purely a technical field, which is set only to change the form view according to the location usage. This is not expected to change the location usage through this field, this field must therefore be set to readonly. A change on the location usage could happen because of the `onchange_picking_type_id`: If the user changed the picking type, and then the location, the usage returned by the `onchange_picking_type_id` was applied on the location, and this must not have happened. In addition, since `related_usage` is a related to the location usage, it should be changed as well when the location is changed. (in the new api, this is no longer required, the related field is updated automatically). This revision therefore adds an onchange on the location as well, to handle this. opw-676428 --- addons/purchase/purchase.py | 9 ++++++++- addons/purchase/purchase_view.xml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 5d453686f97..253e8e52fc1 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -316,7 +316,7 @@ class purchase_order(osv.osv): 'picking_type_id': fields.many2one('stock.picking.type', 'Deliver To', help="This will determine picking type of incoming shipment", required=True, states={'confirmed': [('readonly', True)], 'approved': [('readonly', True)], 'done': [('readonly', True)]}), 'related_location_id': fields.related('picking_type_id', 'default_location_dest_id', type='many2one', relation='stock.location', string="Related location", store=True), - 'related_usage': fields.related('location_id', 'usage', type='char'), + 'related_usage': fields.related('location_id', 'usage', type='char', readonly=True), 'shipment_count': fields.function(_count_all, type='integer', string='Incoming Shipments', multi=True), 'invoice_count': fields.function(_count_all, type='integer', string='Invoices', multi=True) } @@ -421,6 +421,13 @@ class purchase_order(osv.osv): value.update({'related_location_id': picktype.default_location_dest_id.id}) return {'value': value} + def onchange_location_id(self, cr, uid, ids, location_id, context=None): + value = {'related_usage': False} + if location_id: + value['related_usage'] = self.pool['stock.location'].browse(cr, uid, location_id, context=context).usage + return {'value': value} + + def onchange_partner_id(self, cr, uid, ids, partner_id, context=None): partner = self.pool.get('res.partner') if not partner_id: diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 2b22a23890a..cf55d63ae7c 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -274,7 +274,7 @@ - + From eeb53881dc9b7c5aaf81687437c59c8f11174715 Mon Sep 17 00:00:00 2001 From: William Moreno Date: Thu, 16 Jun 2016 15:23:49 -0600 Subject: [PATCH 03/22] [CLA] signature for williamjmorenor Closes #12467 --- doc/cla/individual/williamjmorenor.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/cla/individual/williamjmorenor.md diff --git a/doc/cla/individual/williamjmorenor.md b/doc/cla/individual/williamjmorenor.md new file mode 100644 index 00000000000..b09599fe626 --- /dev/null +++ b/doc/cla/individual/williamjmorenor.md @@ -0,0 +1,9 @@ +Nicaragua, Jun 16th, 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, + +William Moreno williamjmorenor@gmail.com https://github.com/williamjmorenor From 80db184616580201b1ad6110afc33014aaa14b78 Mon Sep 17 00:00:00 2001 From: Florian Kisser Date: Thu, 16 Jun 2016 18:01:35 +0200 Subject: [PATCH 04/22] [CLA] Corporate signature for Seekda GmbH Closes #12463 --- doc/cla/corporate/Seekda.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/cla/corporate/Seekda.md diff --git a/doc/cla/corporate/Seekda.md b/doc/cla/corporate/Seekda.md new file mode 100644 index 00000000000..0b5c0addde0 --- /dev/null +++ b/doc/cla/corporate/Seekda.md @@ -0,0 +1,17 @@ +Austria, 2016-06-16 + +Seekda GmbH agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Holger Lausen holger.lausen@seekda.com https://github.com/holgerlausen + +List of contributors: + +Holger Lausen holger.lausen@seekda.com https://github.com/holgerlausen +Florian Kisser florian.kisser@seekda.com https://github.com/floriankisser + From bdf93910c324b17033f6215e217a0d13a64d2456 Mon Sep 17 00:00:00 2001 From: Nick-OpusVL Date: Tue, 29 Mar 2016 11:17:53 +0100 Subject: [PATCH 05/22] [FIX] doc: 'Searching' instead of 'Research' The word 'Research' isn't usually used in this context. 'Searching' is better. Closes #11517 --- doc/reference/orm.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/reference/orm.rst b/doc/reference/orm.rst index 10ac368e950..07d2a40315f 100644 --- a/doc/reference/orm.rst +++ b/doc/reference/orm.rst @@ -640,7 +640,7 @@ Model Reference .. automethod:: read - .. rubric:: Research + .. rubric:: Searching .. automethod:: search .. automethod:: search_count From 9007ed4c0b5eff88800ef36b555d121db278ac99 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 17 Jun 2016 09:48:47 +0200 Subject: [PATCH 06/22] [FIX] doc: Research -> Search If I need to do researchs to find a quotation, the goal of having a userfriendly software may be missed. --- addons/web/doc/search_view.rst | 2 +- doc/reference/views.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/doc/search_view.rst b/addons/web/doc/search_view.rst index 12b0eaf3104..76692a0d775 100644 --- a/addons/web/doc/search_view.rst +++ b/addons/web/doc/search_view.rst @@ -241,7 +241,7 @@ with directly by external objects or search view controls .. js:class:: openerp.web.search.Facet A `backbone model`_ representing a single facet of the current - research. May map to a search field, or to a more complex or + search. May map to a search field, or to a more complex or fuzzier input (e.g. a custom filter or an advanced search). .. js:attribute:: category diff --git a/doc/reference/views.rst b/doc/reference/views.rst index 1667b731b08..c0e639eb9ac 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -804,7 +804,7 @@ attributes: ``default_group_by`` whether the kanban view should be grouped if no grouping is specified via - the action or the current research. Should be the name of the field to group + the action or the current search. Should be the name of the field to group by when no grouping is otherwise specified ``default_order`` cards sorting order used if the user has not already sorted the records (via From 1750b90252e040cb6f84e7aadc4292ff7eee5182 Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Fri, 17 Jun 2016 10:27:53 +0200 Subject: [PATCH 07/22] [FIX] account: fixed group_lines method of invoices. The group_lines method didn't make the sum of the quantity field, hence resulting in incorrect results when making product based statistics from the account.move.line records. Courtesy of Luc De Meyer. Was PR #10551 --- addons/account/account_invoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index aefa91aa3da..6625cc5493a 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -781,6 +781,9 @@ class account_invoice(models.Model): line2[tmp]['tax_amount'] += l['tax_amount'] line2[tmp]['amount_currency'] += l['amount_currency'] line2[tmp]['analytic_lines'] += l['analytic_lines'] + qty = l.get('quantity') + if qty: + line2[tmp]['quantity'] = line2[tmp].get('quantity', 0.0) + qty else: line2[tmp] = l line = [] From e9aa5fdd852900ee6be4e23d86e32815d3b693cf Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Fri, 17 Jun 2016 10:19:52 +0200 Subject: [PATCH 08/22] [FIX] base: fix domain of serialization_field_id in ir model field view During refactoring of the field view, parent.model has been replaced by model_id since it is more elegant. (odoo/odoo@4a60a3) That was correct when you was working directly from the ir.model.field. But if you was comming from ir.model -> fields -> 'add an item', the model_id is unknow in the context of pyeval. This commit close #12455 --- openerp/addons/base/ir/ir_model_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml index cb4881daacd..b2df784d673 100644 --- a/openerp/addons/base/ir/ir_model_view.xml +++ b/openerp/addons/base/ir/ir_model_view.xml @@ -103,7 +103,7 @@ From ba49172929559aeff0be5e59fd95b5562fab3224 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Fri, 17 Jun 2016 14:41:12 +0200 Subject: [PATCH 09/22] [FIX] account: on ir_sequence, number_next_actual must always be read instead of number_next which might contain wrong value in case of 'standard' sequence. This was causing a crash on creating a new invoice, if demo data were installed and the user went to settings\accounting to do some modification. Issue #12471 --- addons/account/res_config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/account/res_config.py b/addons/account/res_config.py index bc449209e28..09642a2ba5d 100644 --- a/addons/account/res_config.py +++ b/addons/account/res_config.py @@ -68,16 +68,16 @@ class account_config_settings(osv.osv_memory): 'sale_journal_id': fields.many2one('account.journal', 'Sale journal'), 'sale_sequence_prefix': fields.related('sale_journal_id', 'sequence_id', 'prefix', type='char', string='Invoice sequence'), - 'sale_sequence_next': fields.related('sale_journal_id', 'sequence_id', 'number_next', type='integer', string='Next invoice number'), + 'sale_sequence_next': fields.related('sale_journal_id', 'sequence_id', 'number_next_actual', type='integer', string='Next invoice number'), 'sale_refund_journal_id': fields.many2one('account.journal', 'Sale refund journal'), 'sale_refund_sequence_prefix': fields.related('sale_refund_journal_id', 'sequence_id', 'prefix', type='char', string='Credit note sequence'), - 'sale_refund_sequence_next': fields.related('sale_refund_journal_id', 'sequence_id', 'number_next', type='integer', string='Next credit note number'), + 'sale_refund_sequence_next': fields.related('sale_refund_journal_id', 'sequence_id', 'number_next_actual', type='integer', string='Next credit note number'), 'purchase_journal_id': fields.many2one('account.journal', 'Purchase journal'), 'purchase_sequence_prefix': fields.related('purchase_journal_id', 'sequence_id', 'prefix', type='char', string='Supplier invoice sequence'), - 'purchase_sequence_next': fields.related('purchase_journal_id', 'sequence_id', 'number_next', type='integer', string='Next supplier invoice number'), + 'purchase_sequence_next': fields.related('purchase_journal_id', 'sequence_id', 'number_next_actual', type='integer', string='Next supplier invoice number'), 'purchase_refund_journal_id': fields.many2one('account.journal', 'Purchase refund journal'), 'purchase_refund_sequence_prefix': fields.related('purchase_refund_journal_id', 'sequence_id', 'prefix', type='char', string='Supplier credit note sequence'), - 'purchase_refund_sequence_next': fields.related('purchase_refund_journal_id', 'sequence_id', 'number_next', type='integer', string='Next supplier credit note number'), + 'purchase_refund_sequence_next': fields.related('purchase_refund_journal_id', 'sequence_id', 'number_next_actual', type='integer', string='Next supplier credit note number'), 'module_account_check_writing': fields.boolean('Pay your suppliers by check', help='This allows you to check writing and printing.\n' @@ -248,7 +248,7 @@ class account_config_settings(osv.osv_memory): values.update({ journal.type + '_journal_id': journal.id, journal.type + '_sequence_prefix': journal.sequence_id.prefix, - journal.type + '_sequence_next': journal.sequence_id.number_next, + journal.type + '_sequence_next': journal.sequence_id.number_next_actual, }) # update taxes ir_values = self.pool.get('ir.values') From e1deae7eab8be77d7bcb46a68560b86ffbb2277a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 17 Jun 2016 13:52:53 +0200 Subject: [PATCH 10/22] [IMP] base: allow 'render' override with new api New API use a frozendict for context, so when a function in the call chain is overrided by new API (eg: render function of ir.qweb) the code now changed by this commit would cause an error. Instead this code duplicate the context frozendict as a dict removing the need to set back the intial language in the context. opw-681167 note: no need for >=saas-11 --- openerp/addons/base/ir/ir_qweb.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb.py b/openerp/addons/base/ir/ir_qweb.py index 5511298e746..1c909d67ed0 100644 --- a/openerp/addons/base/ir/ir_qweb.py +++ b/openerp/addons/base/ir/ir_qweb.py @@ -439,9 +439,8 @@ class QWeb(orm.AbstractModel): d = qwebcontext.copy() if 'lang' in template_attributes: - init_lang = d.context.get('lang', 'en_US') lang = template_attributes['lang'] - d.context['lang'] = self.eval(lang, d) or lang + d.context = dict(d.context, lang=self.eval(lang, d) or lang) if not self.pool['res.lang'].search(d.cr, d.uid, [('code', '=', d.context['lang'])], count=True, context=d.context): _logger.info("'%s' is not a valid language code, is an empty field or is not installed, falling back to en_US", lang) @@ -458,10 +457,6 @@ class QWeb(orm.AbstractModel): d['generated_attributes'] = generated_attributes res = self.render(cr, uid, template, d) - # we need to reset the lang after the rendering - if 'lang' in template_attributes: - d.context['lang'] = init_lang - return res def render_tag_call_assets(self, element, template_attributes, generated_attributes, qwebcontext): From bcb191f273bae8ed99c17843658789a44f6e5bfc Mon Sep 17 00:00:00 2001 From: jeffery chen fan Date: Thu, 16 Jun 2016 20:14:30 +0800 Subject: [PATCH 11/22] [FIX] crm_profiling: backport of cf9230d1ff Do not redefine the view arch but do a proper inherit. It was a problem as the redefinition removed some fields (headers,..). It was also a problem if crm_profiling was uninstalled as the redefinition was not removed. Closes #12454 --- addons/crm_profiling/crm_profiling_view.xml | 67 ++++++++++----------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/addons/crm_profiling/crm_profiling_view.xml b/addons/crm_profiling/crm_profiling_view.xml index a60aad2b12d..973c41b51be 100644 --- a/addons/crm_profiling/crm_profiling_view.xml +++ b/addons/crm_profiling/crm_profiling_view.xml @@ -143,52 +143,47 @@ - + crm.segmentation.form crm.segmentation + -
- - - - - - - - - - - - -