diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index c1a7d55300e..c002b79ee95 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -470,5 +470,5 @@ class QuantPackage(models.Model): for quant in self._get_contained_quants(): if quant.product_id not in res: res[quant.product_id] = 0 - res[quant.product_id] += quant.qty + res[quant.product_id] += quant.quantity return res diff --git a/odoo/addons/test_new_api/__manifest__.py b/odoo/addons/test_new_api/__manifest__.py index e238f37f779..ec4bdae82bc 100644 --- a/odoo/addons/test_new_api/__manifest__.py +++ b/odoo/addons/test_new_api/__manifest__.py @@ -10,7 +10,9 @@ 'data': [ 'ir.model.access.csv', 'views.xml', - 'demo_data.xml', 'template.xml', ], + 'demo': [ + 'demo_data.xml', + ], } diff --git a/odoo/http.py b/odoo/http.py index cadf11bbd28..bcdaf5445e5 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -278,13 +278,15 @@ class WebRequest(object): _request_stack.pop() if self._cr: - if exc_type is None and not self._failed: - self._cr.commit() - if self.registry: - self.registry.signal_changes() - elif self.registry: - self.registry.reset_changes() - self._cr.close() + try: + if exc_type is None and not self._failed: + self._cr.commit() + if self.registry: + self.registry.signal_changes() + elif self.registry: + self.registry.reset_changes() + finally: + self._cr.close() # just to be sure no one tries to re-use the request self.disable_db = True self.uid = None