From 451b6b9f3a5987778227c3eafd1e0d64833e56b4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 1 Jul 2014 15:48:53 +0200 Subject: [PATCH 1/8] [FIX] project_issue_sheet: make invoiceable field autofield for worklogs When setting a worklog on a project_issue, the field to_invoice is prefilled with on_change_account_id based on the contract settings. As the field was not present on the list view, the information was lost and every worklog was not written as invoiceable, even if enabled on the contract. opw 609082. --- addons/project_issue_sheet/project_issue_sheet_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/project_issue_sheet/project_issue_sheet_view.xml b/addons/project_issue_sheet/project_issue_sheet_view.xml index fb245a0510a..80304deaab1 100644 --- a/addons/project_issue_sheet/project_issue_sheet_view.xml +++ b/addons/project_issue_sheet/project_issue_sheet_view.xml @@ -31,6 +31,7 @@ + From 1c5058c931a6ef55f013ec0c0ca2578ddf75f4a4 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Wed, 2 Jul 2014 14:07:52 +0200 Subject: [PATCH 2/8] [FIX] auth_oauth: hide invalid providers from login screen --- addons/auth_oauth/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index 62eb2e812cc..8fb7ce92607 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -46,7 +46,7 @@ class OAuthController(oeweb.Controller): registry = RegistryManager.get(dbname) with registry.cursor() as cr: providers = registry.get('auth.oauth.provider') - l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True)])) + l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True), ('auth_endpoint', '!=', False), ('validation_endpoint', '!=', False)])) except Exception: l = [] return l From e80014eae3a622c1491d3f2905b3b6b9e12c6be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lionel=20Sausin=20=28Num=C3=A9rigraphe=29?= Date: Sat, 31 May 2014 19:00:34 +0200 Subject: [PATCH 3/8] [FIX] Fixes #273: avoid double-warning when changing the quantity of a stock move --- addons/stock/stock.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 981b6f749c0..3b1e70646f1 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1901,7 +1901,6 @@ class stock_move(osv.osv): result = { 'product_qty': 0.00 } - warning = {} if (not product_id) or (product_uos_qty <=0.0): result['product_uos_qty'] = 0.0 @@ -1909,22 +1908,15 @@ class stock_move(osv.osv): product_obj = self.pool.get('product.product') uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff']) - - # Warn if the quantity was decreased - for move in self.read(cr, uid, ids, ['product_uos_qty']): - if product_uos_qty < move['product_uos_qty']: - warning.update({ - 'title': _('Warning: No Back Order'), - 'message': _("By changing the quantity here, you accept the " - "new quantity as complete: OpenERP will not " - "automatically generate a Back Order.") }) - break + + # No warning if the quantity was decreased to avoid double warnings: + # The clients should call onchange_quantity too anyway if product_uos and product_uom and (product_uom != product_uos): result['product_qty'] = product_uos_qty / uos_coeff['uos_coeff'] else: result['product_qty'] = product_uos_qty - return {'value': result, 'warning': warning} + return {'value': result} def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, partner_id=False): From fbbc3a54e91e7768ecf33038154a2bdbd87505ba Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Wed, 2 Jul 2014 17:29:13 +0200 Subject: [PATCH 4/8] [FIX] RML reporting: understandable crash message When tag is misused in an RML report, logs a more explicit error --- openerp/report/render/rml2pdf/trml2pdf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/report/render/rml2pdf/trml2pdf.py b/openerp/report/render/rml2pdf/trml2pdf.py index 9ed1a14a21b..ec5e9484805 100644 --- a/openerp/report/render/rml2pdf/trml2pdf.py +++ b/openerp/report/render/rml2pdf/trml2pdf.py @@ -373,7 +373,11 @@ class _rml_canvas(object): v = utils.attr_get(node, ['x','y']) text=self._textual(node, **v) text = utils.xml2str(text) - self.canvas.drawString(text=text, **v) + try: + self.canvas.drawString(text=text, **v) + except TypeError as e: + _logger.error("Bad RML: tag requires attributes 'x' and 'y'!") + raise e def _drawCenteredString(self, node): v = utils.attr_get(node, ['x','y']) From 04eff4fe3d157774a1529c743f24b00cb2e28d93 Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Thu, 3 Jul 2014 09:36:46 +0200 Subject: [PATCH 5/8] [TYPO] Stupid typo... --- openerp/report/render/rml2pdf/trml2pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/report/render/rml2pdf/trml2pdf.py b/openerp/report/render/rml2pdf/trml2pdf.py index ec5e9484805..75bc30d4a19 100644 --- a/openerp/report/render/rml2pdf/trml2pdf.py +++ b/openerp/report/render/rml2pdf/trml2pdf.py @@ -376,7 +376,7 @@ class _rml_canvas(object): try: self.canvas.drawString(text=text, **v) except TypeError as e: - _logger.error("Bad RML: tag requires attributes 'x' and 'y'!") + _logger.error("Bad RML: tag requires attributes 'x' and 'y'!") raise e def _drawCenteredString(self, node): From bf353998f20c27eed3494a172c7afa174c20865a Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 3 Jul 2014 12:30:48 +0200 Subject: [PATCH 6/8] [FIX] res_partner: backport of rev 37bf72a Correctly take the 'use parent address' into account in the onchange. Slightly updated the view that was weird with this parameter. opw 609344 --- openerp/addons/base/res/res_partner.py | 8 +++++--- openerp/addons/base/res/res_partner_view.xml | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 30d79bd7da1..4d86c1cbf3f 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -344,6 +344,7 @@ class res_partner(osv.osv, format_address): value = {} value['title'] = False if is_company: + value['use_parent_address'] = False domain = {'title': [('domain', '=', 'partner')]} else: domain = {'title': [('domain', '=', 'contact')]} @@ -363,9 +364,10 @@ class res_partner(osv.osv, format_address): 'was never correctly set. If an existing contact starts working for a new ' 'company then a new contact should be created under that new ' 'company. You can use the "Discard" button to abandon this change.')} - parent = self.browse(cr, uid, parent_id, context=context) - address_fields = self._address_fields(cr, uid, context=context) - result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields) + if use_parent_address: + parent = self.browse(cr, uid, parent_id, context=context) + address_fields = self._address_fields(cr, uid, context=context) + result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields) else: result['value'] = {'use_parent_address': False} return result diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index fd394549f4b..724cce7bb5f 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -157,8 +157,8 @@
-