diff --git a/addons/document/document.py b/addons/document/document.py index eb51ad5ac57..35261b798fe 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -235,18 +235,8 @@ class document_directory(osv.osv): _parent(dir_id, path) return path - def _check_recursion(self, cr, uid, ids, context=None): - level = 100 - while len(ids): - cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')') - ids = filter(None, map(lambda x:x[0], cr.fetchall())) - if not level: - return False - level -= 1 - return True - _constraints = [ - (_check_recursion, 'Error! You cannot create recursive directories.', ['parent_id']) + (osv.osv._check_recursion, 'Error! You cannot create recursive directories.', ['parent_id']) ] def onchange_content_id(self, cr, uid, ids, ressource_type_id): diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 277b2d727e1..b548f15f7df 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -522,8 +522,8 @@ class hr_employee(osv.osv): where h.state='validate' and s.limit=False and - h.employee_id in (%s) - group by h.employee_id"""% (','.join(map(str,ids)),) ) + h.employee_id in %s + group by h.employee_id""", (tuple(ids),)) res = cr.dictfetchall() remaining = {} for r in res: diff --git a/addons/project_issue_sheet/project_issue_sheet_view.xml b/addons/project_issue_sheet/project_issue_sheet_view.xml index 6d813b44239..39ff9ca0010 100644 --- a/addons/project_issue_sheet/project_issue_sheet_view.xml +++ b/addons/project_issue_sheet/project_issue_sheet_view.xml @@ -32,6 +32,7 @@ + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 384bb3d362e..34a24354508 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1892,7 +1892,6 @@ class stock_move(osv.osv): result = { 'product_qty': 0.00 } - warning = {} if (not product_id) or (product_uos_qty <=0.0): result['product_uos_qty'] = 0.0 @@ -1900,22 +1899,15 @@ class stock_move(osv.osv): product_obj = self.pool.get('product.product') uos_coeff = product_obj.read(cr, uid, product_id, ['uos_coeff']) - - # Warn if the quantity was decreased - for move in self.read(cr, uid, ids, ['product_uos_qty']): - if product_uos_qty < move['product_uos_qty']: - warning.update({ - 'title': _('Warning: No Back Order'), - 'message': _("By changing the quantity here, you accept the " - "new quantity as complete: OpenERP will not " - "automatically generate a Back Order.") }) - break + + # No warning if the quantity was decreased to avoid double warnings: + # The clients should call onchange_quantity too anyway if product_uos and product_uom and (product_uom != product_uos): result['product_qty'] = product_uos_qty / uos_coeff['uos_coeff'] else: result['product_qty'] = product_uos_qty - return {'value': result, 'warning': warning} + return {'value': result} def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False, loc_dest_id=False, partner_id=False): diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 98f3866cebf..860d0e9ce6c 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -360,6 +360,7 @@ class res_partner(osv.osv, format_address): value = {} value['title'] = False if is_company: + value['use_parent_address'] = False domain = {'title': [('domain', '=', 'partner')]} else: domain = {'title': [('domain', '=', 'contact')]} @@ -379,9 +380,10 @@ class res_partner(osv.osv, format_address): 'was never correctly set. If an existing contact starts working for a new ' 'company then a new contact should be created under that new ' 'company. You can use the "Discard" button to abandon this change.')} - parent = self.browse(cr, uid, parent_id, context=context) - address_fields = self._address_fields(cr, uid, context=context) - result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields) + if use_parent_address: + parent = self.browse(cr, uid, parent_id, context=context) + address_fields = self._address_fields(cr, uid, context=context) + result['value'] = dict((key, value_or_id(parent[key])) for key in address_fields) else: result['value'] = {'use_parent_address': False} return result diff --git a/openerp/addons/base/res/res_partner_view.xml b/openerp/addons/base/res/res_partner_view.xml index 3382211dfa7..e658ddc0fe7 100644 --- a/openerp/addons/base/res/res_partner_view.xml +++ b/openerp/addons/base/res/res_partner_view.xml @@ -159,8 +159,8 @@
-