From b2607a624854d54f7e10ba19a934944a2cd05c51 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Wed, 22 Sep 2010 18:07:56 +0530 Subject: [PATCH 1/5] [FIX] Project_issue : Corrected data bzr revid: jvo@tinyerp.com-20100922123756-vievvziib23ulzma --- addons/project_issue/project_issue_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_issue/project_issue_data.xml b/addons/project_issue/project_issue_data.xml index 0ad753b0004..1c7f5c73c77 100644 --- a/addons/project_issue/project_issue_data.xml +++ b/addons/project_issue/project_issue_data.xml @@ -31,7 +31,7 @@ - + Version 6.0 From e7837995a5fa985e5381ef0804ed93e6255c2235 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Wed, 22 Sep 2010 11:39:33 +0200 Subject: [PATCH 2/5] [FIX] wiki: fixed an error in copy method bzr revid: olt@tinyerp.com-20100922093933-vux7rp4bxu8671ss --- addons/wiki/wiki.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 4f78b2f7c85..c0d3cebdcca 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -164,7 +164,7 @@ class wiki_wiki2(osv.osv): @param uid: the current user’s ID for security checks, @param id: Give wiki page's ID """ - return super(Wiki, self).copy_data(cr, uid, id, {'wiki_id': False}, context) + return super(wiki_wiki2, self).copy_data(cr, uid, id, {'wiki_id': False}, context) def create_history(self, cr, uid, ids, vals, context=None): history_id = False From 8f32210fe16d3b14ee80a8aa3f8fd9929edc5ba8 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Wed, 22 Sep 2010 15:06:46 +0200 Subject: [PATCH 3/5] [IMP] product: performance improvement: since we already have a browse record, there is no need to re-browse on it's id bzr revid: olt@tinyerp.com-20100922130646-q8h8u3x961b76fmo --- addons/product/product.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index eaa1df9ebf2..1b74bef87f9 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -377,23 +377,23 @@ class product_product(osv.osv): res[product.id] = (res[product.id] or 0.0) * (product.price_margin or 1.0) + product.price_extra return res - def _get_partner_code_name(self, cr, uid, ids, product_id, partner_id, context={}): - product = self.browse(cr, uid, [product_id], context)[0] + def _get_partner_code_name(self, cr, uid, ids, product, partner_id, context={}): for supinfo in product.seller_ids: if supinfo.name.id == partner_id: return {'code': supinfo.product_code, 'name': supinfo.product_name, 'variants': ''} - return {'code' : product.default_code, 'name' : product.name, 'variants': product.variants} + res = {'code': product.default_code, 'name': product.name, 'variants': product.variants} + return res def _product_code(self, cr, uid, ids, name, arg, context={}): res = {} for p in self.browse(cr, uid, ids, context): - res[p.id] = self._get_partner_code_name(cr, uid, [], p.id, context.get('partner_id', None), context)['code'] + res[p.id] = self._get_partner_code_name(cr, uid, [], p, context.get('partner_id', None), context)['code'] return res def _product_partner_ref(self, cr, uid, ids, name, arg, context={}): res = {} for p in self.browse(cr, uid, ids, context): - data = self._get_partner_code_name(cr, uid, [], p.id, context.get('partner_id', None), context) + data = self._get_partner_code_name(cr, uid, [], p, context.get('partner_id', None), context) if not data['variants']: data['variants'] = p.variants if not data['code']: From 4615bf0d371d9c93f1deecd676b5eaff927010a4 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Wed, 22 Sep 2010 16:13:42 +0200 Subject: [PATCH 4/5] [IMP] mrp: performance improvement: added store={...} for 'mrp.repair' amount computations bzr revid: olt@tinyerp.com-20100922141342-77ladsgwv6d2pxec --- addons/mrp_repair/mrp_repair.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index ddcd2ccb501..527ef5c1e55 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -45,6 +45,7 @@ class mrp_repair(osv.osv): """ res = {} cur_obj = self.pool.get('res.currency') + for repair in self.browse(cr, uid, ids): res[repair.id] = 0.0 for line in repair.operations: @@ -62,6 +63,7 @@ class mrp_repair(osv.osv): @return: Dictionary of values. """ res = {} + #return {}.fromkeys(ids, 0) cur_obj = self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') for repair in self.browse(cr, uid, ids): @@ -94,6 +96,14 @@ class mrp_repair(osv.osv): res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0)) return res + def _get_lines(self, cr, uid, ids, context=None): + if context is None: + context = {} + result = {} + for line in self.pool.get('mrp.repair.line').browse(cr, uid, ids, context=context): + result[line.repair_id.id] = True + return result.keys() + _columns = { 'name': fields.char('Repair Reference',size=24, required=True), 'product_id': fields.many2one('product.product', string='Product to Repair', required=True, readonly=True, states={'draft':[('readonly',False)]}), @@ -137,9 +147,21 @@ class mrp_repair(osv.osv): 'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired. If cheked, it will create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."), 'invoiced': fields.boolean('Invoiced', readonly=True), 'repaired': fields.boolean('Repaired', readonly=True), - 'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount'), - 'amount_tax': fields.function(_amount_tax, method=True, string='Taxes'), - 'amount_total': fields.function(_amount_total, method=True, string='Total'), + 'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount', + store={ + 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), + 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), + }), + 'amount_tax': fields.function(_amount_tax, method=True, string='Taxes', + store={ + 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), + 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), + }), + 'amount_total': fields.function(_amount_total, method=True, string='Total', + store={ + 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), + 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), + }), } _defaults = { @@ -163,7 +185,6 @@ class mrp_repair(osv.osv): }) return super(mrp_repair, self).copy(cr, uid, id, default, context) - def onchange_product_id(self, cr, uid, ids, product_id=None): """ On change of product sets some values. @param product_id: Changed product From 840fe73c6f75e2afc011b4b01d039ab9b515caf1 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Thu, 23 Sep 2010 10:47:34 +0530 Subject: [PATCH 5/5] [FIX]: crm: Removed extra field from opportunity view lp bug: https://launchpad.net/bugs/645418 fixed bzr revid: rpa@tinyerp.com-20100923051734-vhgzltyeblajc8qv --- addons/crm/crm_opportunity_view.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index aaf344043d7..e816e3f0b1d 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -220,7 +220,6 @@ -