diff --git a/addons/crm_partner_assign/res_partner_view.xml b/addons/crm_partner_assign/res_partner_view.xml index f5a1e9aad25..3b55c70f4c7 100644 --- a/addons/crm_partner_assign/res_partner_view.xml +++ b/addons/crm_partner_assign/res_partner_view.xml @@ -170,7 +170,7 @@ res.partner - + diff --git a/addons/event/event.py b/addons/event/event.py index b3aee2493f8..e30dda7be8d 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -19,6 +19,7 @@ # ############################################################################## +from datetime import datetime, timedelta from osv import fields, osv from tools.translate import _ from openerp import SUPERUSER_ID @@ -281,6 +282,15 @@ class event_event(osv.osv): }) return {'value' : values} + def onchange_start_date(self, cr, uid, ids, date_begin=False, date_end=False, context=None): + res = {'value':{}} + if date_end: + return res + if date_begin and isinstance(date_begin, str): + date_begin = datetime.strptime(date_begin, "%Y-%m-%d %H:%M:%S") + date_end = date_begin + timedelta(hours=1) + res['value'] = {'date_end': date_end.strftime("%Y-%m-%d %H:%M:%S")} + return res # ---------------------------------------- # OpenChatter methods and notifications diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 68742754166..ccac74086ff 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -133,7 +133,7 @@ - + diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ecac11f856a..3ae27bf2c41 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -274,6 +274,17 @@ class mrp_bom(osv.osv): return {'value': {'name': prod.name, 'product_uom': prod.uom_id.id}} return {} + def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None): + res = {'value':{}} + if not product_uom or not product_id: + return res + product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + uom = self.pool.get('product.uom').browse(cr, uid, product_uom, context=context) + if uom.category_id.id != product.uom_id.category_id.id: + res['warning'] = {'title': _('Warning'), 'message': _('The Product Unit of Measure you chose has a different category than in the product form.')} + res['value'].update({'product_uom': product.uom_id.id}) + return res + def _bom_find(self, cr, uid, product_id, product_uom, properties=None): """ Finds BoM for particular product and product uom. @param product_id: Selected product. diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index a144897b1b6..9d1ae9eae8a 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -351,7 +351,7 @@