From bb5d7cf5725bb6642838fc70717cbdc8b540588c Mon Sep 17 00:00:00 2001 From: Chris Halls Date: Fri, 16 Apr 2010 16:24:29 +0100 Subject: [PATCH 01/23] [FIX] When duplicating a production order, clear existing stock moves If a production order is duplicated, it will be because someone wants to build the same item(s) again. The copy function already puts the production order back into state draft but does not delete the related stock movements and consumed products. bzr revid: chris.halls@credativ.co.uk-20100416152429-2ygxfb32lvew3bgl --- addons/mrp/mrp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index eda4f076602..0e051e7ac2e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -560,8 +560,12 @@ class mrp_production(osv.osv): default.update({ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.production'), 'move_lines' : [], - 'move_created_ids': [], - 'state': 'draft' + 'move_lines2' : [], + 'move_created_ids' : [], + 'move_created_ids2' : [], + 'product_lines' : [], + 'state': 'draft', + 'picking_id': False }) return super(mrp_production, self).copy(cr, uid, id, default, context) From 8dd9bd5477d4ad7e10e2a2956b10c669141881b8 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Wed, 30 Jun 2010 10:16:35 +0530 Subject: [PATCH 02/23] [FIX] stock-planning: onchange amount bzr revid: mra@mra-laptop-20100630044635-e6wbx4u7zvoi3tgn --- addons/stock_planning/stock_planning.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index 0c957d8b72e..ef9fa7e65dd 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -346,12 +346,13 @@ class stock_sale_forecast(osv.osv): def product_amt_change(self, cr, uid, ids, product_amt = 0.0, product_uom=False): ret={} + round_value = 1 if product_amt: coeff_def2uom = 1 val1 = self.browse(cr, uid, ids) val = val1[0] if (product_uom != val.product_id.uom_id.id): - coeff_def2uom, rounding = self._from_default_uom_factor( cr, uid, val, product_uom, {}) + coeff_def2uom, round_value = self._from_default_uom_factor( cr, uid, val, product_uom, {}) ret['product_qty'] = rounding(coeff_def2uom * product_amt/(val.product_id.product_tmpl_id.list_price), round_value) res = {'value': ret} return res From 216e257c51bffabdbe8943d74a3eab1855b79efa Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 30 Jun 2010 11:34:05 +0200 Subject: [PATCH 03/23] [IMP] account: improved help tooltips on product and product category. Thanks Ferdinand @ ChriCar for the contribution lp bug: https://launchpad.net/bugs/549715 fixed bzr revid: qdp-launchpad@tinyerp.com-20100630093405-58e1trh15i2xls2v --- addons/account/product.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/product.py b/addons/account/product.py index ce91b9b0743..188c3260dff 100644 --- a/addons/account/product.py +++ b/addons/account/product.py @@ -33,7 +33,7 @@ class product_category(osv.osv): string="Income Account", method=True, view_load=True, - help="This account will be used to value incoming stock(i.e. credit of incoming goods) for the current product category"), + help="This account will be used for invoices to value sales for the current product category"), 'property_account_expense_categ': fields.property( 'account.account', type='many2one', @@ -41,7 +41,7 @@ class product_category(osv.osv): string="Expense Account", method=True, view_load=True, - help="This account will be used to value outgoing stock(i.e. debit of outgoing goods) for the current product category"), + help="This account will be used for invoices to value expenses for the current product category"), } product_category() @@ -64,7 +64,7 @@ class product_template(osv.osv): string="Income Account", method=True, view_load=True, - help="This account will be used instead of the default one to value incoming stock for the current product"), + help="This account will be used for invoices instead of the default one to value sales for the current product"), 'property_account_expense': fields.property( 'account.account', type='many2one', @@ -72,7 +72,7 @@ class product_template(osv.osv): string="Expense Account", method=True, view_load=True, - help="This account will be used instead of the default one to value outgoing stock for the current product"), + help="This account will be used for invoices instead of the default one to value expenses for the current product"), } product_template() From 2d6a0e2329abbf2d5269fb9ccd17c80404b2fe6b Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 30 Jun 2010 15:13:07 +0530 Subject: [PATCH 04/23] [FIX]: * caldav: Export calendar with recurrent event * base_calendar: Fix wrong code in Exrule wizard bzr revid: rpa@tinyerp.com-20100630094307-n6lucf47o1ixsai4 --- addons/base_calendar/wizard/base_calendar_set_exrule.py | 9 ++++----- addons/caldav/calendar.py | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/base_calendar/wizard/base_calendar_set_exrule.py b/addons/base_calendar/wizard/base_calendar_set_exrule.py index febfb39e1ef..ab458c8f7f5 100644 --- a/addons/base_calendar/wizard/base_calendar_set_exrule.py +++ b/addons/base_calendar/wizard/base_calendar_set_exrule.py @@ -82,12 +82,11 @@ class base_calendar_set_exrule(osv.osv_memory): @param uid: the current user’s ID for security checks, @param fields: List of fields for default value @param context: A standard dictionary for contextual values - """ - crm_obj = self.pool.get('crm.meeting') - for meeting in crm_obj.browse(cr, uid, context.get('active_ids', [])): - if not meeting.rrule: - raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency after Apply Exception Rule")) + event_obj = self.pool.get(context.get('active_model')) + for event in event_obj.browse(cr, uid, context.get('active_ids', [])): + if not event.rrule: + raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency before applying Exception Rule.")) return False def compute_exrule_string(self, cr, uid, ids, context=None): diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 3e4701a08d5..409ffa6b5ad 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -277,11 +277,7 @@ class CalDAV(object): % (model_obj._table, data[map_field])) r_ids = map(lambda x: x[0], cr.fetchall()) if r_ids: - rdata = self.pool.get(model).read(cr, uid, r_ids) - event_obj = self.pool.get('basic.calendar.event') - rcal = event_obj.export_cal(cr, uid, rdata, context=context) - for revents in rcal.contents['vevent']: - ical.contents['vevent'].append(revents) + rcal = self.export_cal(cr, uid, r_ids, 'vevent', context=context) if data.get('recurrent_uid', None): uidval = openobjectid2uid(cr, data['recurrent_uid'], model) vevent.add('uid').value = uidval From 1fe3270ecc814d055fa762a6973814bf91957820 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 30 Jun 2010 15:15:10 +0530 Subject: [PATCH 05/23] [IMP]: base_calendar, crm, project_caldav: View improvements for recurrence rule and exrule bzr revid: rpa@tinyerp.com-20100630094510-0do4n1yoanaijmxu --- addons/base_calendar/base_calendar_view.xml | 9 ++- addons/crm/crm_meeting_view.xml | 7 +- addons/project_caldav/project_caldav_view.xml | 67 ++++++++++++++++--- 3 files changed, 69 insertions(+), 14 deletions(-) diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml index aa63dc696de..5f79e0f2681 100644 --- a/addons/base_calendar/base_calendar_view.xml +++ b/addons/base_calendar/base_calendar_view.xml @@ -222,10 +222,15 @@