[MERGE] forward port of branch saas-2 up to revid 4968 chs@openerp.com-20131031142325-vo84hk5co2e2phg0
bzr revid: chs@openerp.com-20131031143208-4gtdju33sv0wdtcg
This commit is contained in:
commit
0e1cc663b3
|
@ -27,6 +27,7 @@ import re
|
|||
|
||||
from openerp import tools
|
||||
from openerp.osv import fields,osv
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -142,9 +143,10 @@ class ir_attachment(osv.osv):
|
|||
if attach.store_fname:
|
||||
self._file_delete(cr, uid, location, attach.store_fname)
|
||||
fname = self._file_write(cr, uid, location, value)
|
||||
super(ir_attachment, self).write(cr, uid, [id], {'store_fname': fname, 'file_size': file_size}, context=context)
|
||||
# SUPERUSER_ID as probably don't have write access, trigger during create
|
||||
super(ir_attachment, self).write(cr, SUPERUSER_ID, [id], {'store_fname': fname, 'file_size': file_size}, context=context)
|
||||
else:
|
||||
super(ir_attachment, self).write(cr, uid, [id], {'db_datas': value, 'file_size': file_size}, context=context)
|
||||
super(ir_attachment, self).write(cr, SUPERUSER_ID, [id], {'db_datas': value, 'file_size': file_size}, context=context)
|
||||
return True
|
||||
|
||||
_name = 'ir.attachment'
|
||||
|
@ -186,8 +188,6 @@ class ir_attachment(osv.osv):
|
|||
In the 'document' module, it is overriden to relax this hard rule, since
|
||||
more complex ones apply there.
|
||||
"""
|
||||
if not ids:
|
||||
return
|
||||
res_ids = {}
|
||||
if ids:
|
||||
if isinstance(ids, (int, long)):
|
||||
|
@ -290,7 +290,7 @@ class ir_attachment(osv.osv):
|
|||
return super(ir_attachment, self).unlink(cr, uid, ids, context)
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
self.check(cr, uid, [], mode='create', context=context, values=values)
|
||||
self.check(cr, uid, [], mode='write', context=context, values=values)
|
||||
if 'file_size' in values:
|
||||
del values['file_size']
|
||||
return super(ir_attachment, self).create(cr, uid, values, context)
|
||||
|
|
|
@ -102,13 +102,10 @@ class res_config_configurable(osv.osv_memory):
|
|||
res = next.action_launch(context=context)
|
||||
res['nodestroy'] = False
|
||||
return res
|
||||
# reload the client; open the first available root menu
|
||||
menu_obj = self.pool['ir.ui.menu']
|
||||
menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'reload',
|
||||
'params': {'menu_id': menu_ids and menu_ids[0] or False},
|
||||
}
|
||||
|
||||
def start(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -329,7 +329,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Search Partner">
|
||||
<field name="name"
|
||||
filter_domain="['|','|',('name','ilike',self),('parent_id','ilike',self),('ref','=',self)]"/>
|
||||
filter_domain="['|','|',('display_name','ilike',self),('ref','=',self),('email,'ilike',self)]"/>
|
||||
<filter help="My Partners" icon="terp-personal+" domain="[('user_id','=',uid)]"/>
|
||||
<separator/>
|
||||
<filter string="Persons" name="type_person" domain="[('is_company','=',0)]"/>
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
<field name="model">res.users</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Users">
|
||||
<field name="name" filter_domain="['|', ('name','ilike',self), ('login','ilike',self)]" string="User"/>
|
||||
<field name="name" filter_domain="['|', '|', ('name','ilike',self), ('login','ilike',self), ('email,'ilike',self)]" string="User"/>
|
||||
<field name="company_ids" string="Company" groups="base.group_multi_company"/>
|
||||
</search>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue