From f478e0557b8e3bea5a0dea572b5abac13c97008c Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 23 Jul 2014 15:37:15 +0200 Subject: [PATCH 1/4] [FIX] account: the 'Customer taxes' field on the product is readonly when my product doesn't have any variant --- addons/account/product_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/product_view.xml b/addons/account/product_view.xml index 9c1b0ee39b7..44b9099a00a 100644 --- a/addons/account/product_view.xml +++ b/addons/account/product_view.xml @@ -18,7 +18,7 @@ + attrs="{'readonly':[('sale_ok','=',0)]}"/> Date: Thu, 24 Jul 2014 11:07:46 +0200 Subject: [PATCH 2/4] [FIX] website_sale: fix error in tracking_last_order which was using the field is_delivery from module delivery --- addons/website_sale/controllers/main.py | 26 +++++++++++-------- .../website_sale_delivery/controllers/main.py | 7 ++++- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index b9738e49c40..4b496c06f1e 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -765,9 +765,22 @@ class website_sale(http.Controller): product = product_obj.browse(request.cr, request.uid, id, context=request.context) return product.write({'website_size_x': x, 'website_size_y': y}) + def order_lines_2_google_api(self, order_lines): + """ Transforms a list of order lines into a dict for google analytics """ + ret = [] + for line in order_lines: + ret.append({ + 'id': line.order_id and line.order_id.id, + 'name': line.product_id.categ_id and line.product_id.categ_id.name or '-', + 'sku': line.product_id.id, + 'quantity': line.product_uom_qty, + 'price': line.price_unit, + }) + return ret + @http.route(['/shop/tracking_last_order'], type='json', auth="public") def tracking_cart(self, **post): - """ return JS code for google analytics""" + """ return data about order in JSON needed for google analytics""" cr, uid, context = request.cr, request.uid, request.context ret = {} sale_order_id = request.session.get('sale_last_order_id') @@ -779,16 +792,7 @@ class website_sale(http.Controller): 'revenue': order.amount_total, 'currency': order.currency_id.name } - ret['lines'] = [] - for line in order.order_line: - if not line.is_delivery: - ret['lines'].append({ - 'id': line.order_id and line.order_id.id, - 'name': line.product_id.categ_id and line.product_id.categ_id.name or '-', - 'sku': line.product_id.id, - 'quantity': line.product_uom_qty, - 'price': line.price_unit, - }) + ret['lines'] = self.order_lines_2_google_api(order.order_line) return ret # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/website_sale_delivery/controllers/main.py b/addons/website_sale_delivery/controllers/main.py index 93c6aa2bfaa..15bc881c364 100644 --- a/addons/website_sale_delivery/controllers/main.py +++ b/addons/website_sale_delivery/controllers/main.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- import openerp from openerp import http -from openerp import SUPERUSER_ID from openerp.http import request import openerp.addons.website_sale.controllers.main + class website_sale(openerp.addons.website_sale.controllers.main.website_sale): @http.route(['/shop/payment'], type='http', auth="public", website=True) @@ -21,3 +21,8 @@ class website_sale(openerp.addons.website_sale.controllers.main.website_sale): res = super(website_sale, self).payment(**post) return res + + def order_lines_2_google_api(self, order_lines): + """ Transforms a list of order lines into a dict for google analytics """ + order_lines_not_delivery = [line for line in order_lines if not line.is_delivery] + return super(website_sale, self).order_lines_2_google_api(order_lines_not_delivery) From b4ef87f1ec60163a6af086fe3eaf286da143736a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 24 Jul 2014 11:53:57 +0200 Subject: [PATCH 3/4] [FIX] ir_attachment: _filestore cache ignore uid replace ormcache_context by ormcache: use the context in the cache key is useless set skiparg=3 (default skiparg=2) so the uid is not used in the cache key: the filestore path is the same for all database users --- openerp/addons/base/ir/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 9cfd5041e63..42fb05a9dbe 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -69,7 +69,7 @@ class ir_attachment(osv.osv): def _storage(self, cr, uid, context=None): return self.pool['ir.config_parameter'].get_param(cr, SUPERUSER_ID, 'ir_attachment.location', 'file') - @tools.ormcache_context() + @tools.ormcache(skiparg=3) def _filestore(self, cr, uid, context=None): return tools.config.filestore(cr.dbname) From eda2f064cffd0389cac5f5eb49b92516fda3e34e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 28 Jul 2014 09:35:25 +0200 Subject: [PATCH 4/4] [FIX] stock: backport of rev 0a6d63b --- addons/mrp/mrp_view.xml | 29 +++- addons/product/product_view.xml | 267 +++++++++++++++----------------- 2 files changed, 153 insertions(+), 143 deletions(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 464a7032ed2..fdc234c6d54 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -422,7 +422,8 @@ - + + @@ -1033,12 +1034,19 @@ id="menu_mrp_production_order_action" name="Order Planning" parent="menu_mrp_planning" sequence="1"/> - + {'default_product_tmpl_id': active_id, 'search_default_product_tmpl_id': active_id} Bill of Materials mrp.bom form + + {'default_product_id': active_id, 'search_default_product_id': active_id} + Bill of Materials + mrp.bom + form + + {'search_default_product_id': [active_id]} Manufacturing Orders @@ -1048,10 +1056,23 @@ product.template.procurement product.template - +
- +
+
+
+ + product.product.procurement + product.product + + +
+ diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index b7d746c023f..fecaa91ded4 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -40,8 +40,9 @@ + - product.template.product.form + product.template.common.form product.template
@@ -128,14 +129,6 @@ - - - - - - - -
@@ -146,48 +139,27 @@ - - Product.template.product.kanban - product.template + + product.product.search + product.product + primary + - - - - - -
- -
-

- - - -

-
-
    -
  • Price:
  • -
-
-
- - - + + + + + + + + + + + + - - Products - ir.actions.act_window - product.template - kanban,tree,form - form - - - - - @@ -212,31 +184,123 @@ {'default_product_tmpl_id': active_id} - + + Product Variants + ir.actions.act_window + product.product + tree,form,kanban + form + + +

+ Click to define a new product. +

+ You must define a product for everything you buy or sell, + whether it's a physical product, a consumable or service. +

+
+
+ + Product Variants + ir.actions.act_window + product.product + tree,form,kanban + form + {'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id} + + +

+ Click to define a new product. +

+ You must define a product for everything you buy or sell, + whether it's a physical product, a consumable or service. +

+
+
- - - product.product.search - product.product + + + product.template.product.form + product.template primary - + + - - - - - - - - - - - + + Product Template + + + +
+ +
+ + + + + + +
+ + Product.template.product.kanban + product.template + + + + + + + + + +
+ +
+

+ + + +

+ + Variants + +
+
    +
  • Price:
  • +
+
+
+ + + + + + + + Products + ir.actions.act_window + product.template + kanban,tree,form + form + + + + + + + + + product.product.tree product.product @@ -278,8 +342,6 @@ - - @@ -300,79 +362,6 @@ - - Product Variants - ir.actions.act_window - product.product - tree,form,kanban - form - - -

- Click to define a new product. -

- You must define a product for everything you buy or sell, - whether it's a physical product, a consumable or service. -

-
-
- - - - - Product Variants - ir.actions.act_window - product.product - tree,form,kanban - form - {'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id} - - -

- Click to define a new product. -

- You must define a product for everything you buy or sell, - whether it's a physical product, a consumable or service. -

-
-
- - - product.template.form - product.template - - - -
- -
-
-
-
- - - product.template.form - product.template - - - - - - - -

- - Variants - -

-
-
- - - Product Variants ir.actions.act_window