bzr revid: fp@tinyerp.com-20101015141439-ku1tse4kzox767pk
This commit is contained in:
Fabien Pinckaers
2010-10-15 16:14:39 +02:00
13 changed files with 39 additions and 30 deletions
+1 -4
View File
@@ -2389,6 +2389,7 @@ msgstr ""
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_customer_form
#: model:ir.ui.menu,name:base.menu_partner_form
#: view:res.partner:0
msgid "Customers"
msgstr "Clients"
@@ -6874,10 +6875,6 @@ msgid "Landscape"
msgstr "Paysage"
#. module: base
#: model:ir.actions.act_window,name:base.action_partner_form
#: model:ir.ui.menu,name:base.menu_base_config_partner
#: model:ir.ui.menu,name:base.menu_base_partner
#: model:ir.ui.menu,name:base.menu_partner_form
#: view:res.partner:0
#: view:res.partner.category:0
#: field:res.partner.category,partner_ids:0
+5 -2
View File
@@ -255,8 +255,10 @@ class act_window(osv.osv):
'help': fields.text('Action description',
help='Optional help text for the users with a description of the target view, such as its usage and purpose.'),
'display_menu_tip':fields.function(_get_help_status, type='boolean', method=True, string='Display Menu Tips',
help='It gives the status if the tip has to be displayed or not when a user executes an action')
help='It gives the status if the tip has to be displayed or not when a user executes an action'),
'multi': fields.boolean('Action on Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view"),
}
_defaults = {
'type': lambda *a: 'ir.actions.act_window',
'view_type': lambda *a: 'form',
@@ -265,7 +267,8 @@ class act_window(osv.osv):
'limit': lambda *a: 80,
'target': lambda *a: 'current',
'auto_refresh': lambda *a: 0,
'auto_search':lambda *a: True
'auto_search':lambda *a: True,
'multi': False,
}
act_window()
+9 -4
View File
@@ -69,9 +69,14 @@ class ir_ui_menu(osv.osv):
def create_shortcut(self, cr, uid, values, context={}):
dataobj = self.pool.get('ir.model.data')
menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', context)
shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], context)['res_id'])
action_id = self.pool.get('ir.actions.act_window').create(cr, uid, values, context)
new_context = context.copy()
for key in context:
if key.startswith('default_'):
del new_context[key]
menu_id = dataobj._get_id(cr, uid, 'base', 'menu_administration_shortcut', new_context)
shortcut_menu_id = int(dataobj.read(cr, uid, menu_id, ['res_id'], new_context)['res_id'])
action_id = self.pool.get('ir.actions.act_window').create(cr, uid, values, new_context)
menu_data = {'name':values['name'],
'sequence':10,
'action':'ir.actions.act_window,'+str(action_id),
@@ -79,7 +84,7 @@ class ir_ui_menu(osv.osv):
'icon':'STOCK_JUSTIFY_FILL'}
menu_id = self.pool.get('ir.ui.menu').create(cr, uid, menu_data)
sc_data= {'name':values['name'], 'sequence': 1,'res_id': menu_id }
sc_menu_id = self.pool.get('ir.ui.view_sc').create(cr, uid, sc_data, context)
sc_menu_id = self.pool.get('ir.ui.view_sc').create(cr, uid, sc_data, new_context)
user_groups = set(self.pool.get('res.users').read(cr, 1, uid, ['groups_id'])['groups_id'])
key = (cr.dbname, shortcut_menu_id, tuple(user_groups))
@@ -107,7 +107,7 @@
<group colspan="4">
<button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="draft"/>
<button type="object" string="_Validate" icon="gtk-apply" name="action_validate" states="draft"/>
<button type="object" string="_Cancel" icon="gtk-cancel" special="cancel" states="validated,unvalidated"/>
<button type="object" string="_Close" icon="gtk-close" special="cancel" states="validated,unvalidated"/>
</group>
</form>
</field>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

+1 -1
View File
@@ -130,7 +130,7 @@ class res_partner(osv.osv):
'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
'company_id': fields.many2one('res.company', 'Company', select=1),
}
def _default_category(self, cr, uid, context={}):
if 'category_id' in context and context['category_id']:
return [context['category_id']]
-2
View File
@@ -21,7 +21,6 @@
from osv import fields, osv
import tools
import time
class res_log(osv.osv):
_name = 'res.log'
@@ -63,7 +62,6 @@ class res_log(osv.osv):
return unread_logs
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
res = []
log_ids = super(res_log, self).search(cr, uid, args, offset, limit, order, context, count)
logs = {}
for log in self.browse(cr, uid, log_ids, context=context):
+2
View File
@@ -64,6 +64,8 @@ class _column(object):
_symbol_get = None
def __init__(self, string='unknown', required=False, readonly=False, domain=None, context={}, states=None, priority=0, change_default=False, size=None, ondelete="set null", translate=False, select=False, **args):
if not context:
context = {}
self.states = states or {}
self.string = string
self.readonly = readonly
+17 -16
View File
@@ -1723,7 +1723,6 @@ class orm_template(object):
resprint = ir_values_obj.get(cr, user, 'action',
'client_print_multi', [(self._name, False)], False,
context)
resaction = []
resaction = ir_values_obj.get(cr, user, 'action',
'client_action_multi', [(self._name, False)], False,
context)
@@ -3041,20 +3040,20 @@ class orm(orm_template):
else:
res = map(lambda x: {'id': x}, ids)
if not res:
res = map(lambda x: {'id': x}, ids)
for record in res:
for f in fields_to_read:
field_val = False
if f in self._columns.keys():
ftype = self._columns[f]._type
elif f in self._inherit_fields.keys():
ftype = self._inherit_fields[f][2]._type
else:
continue
if ftype in ('one2many', 'many2many'):
field_val = []
record.update({f:field_val})
# if not res:
# res = map(lambda x: {'id': x}, ids)
# for record in res:
# for f in fields_to_read:
# field_val = False
# if f in self._columns.keys():
# ftype = self._columns[f]._type
# elif f in self._inherit_fields.keys():
# ftype = self._inherit_fields[f][2]._type
# else:
# continue
# if ftype in ('one2many', 'many2many'):
# field_val = []
# record.update({f:field_val})
for f in fields_pre:
if f == self.CONCURRENCY_CHECK_FIELD:
@@ -3107,7 +3106,9 @@ class orm(orm_template):
for pos in val:
for record in res:
if isinstance(res2[record['id']], str): res2[record['id']] = eval(res2[record['id']]) #TOCHECK : why got string instend of dict in python2.6
record[pos] = res2[record['id']][pos]
multi_fields = res2.get(record['id'],{})
if multi_fields:
record[pos] = multi_fields.get(pos,[])
else:
for f in val:
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
+2
View File
@@ -488,6 +488,8 @@ form: module.record_id""" % (xml_id,)
if rec.get('target'):
res['target'] = rec.get('target','')
if rec.get('multi'):
res['multi'] = rec.get('multi', False)
id = self.pool.get('ir.model.data')._update(cr, self.uid, 'ir.actions.act_window', self.module, res, xml_id, noupdate=self.isnoupdate(data_node), mode=self.mode)
self.idref[xml_id] = int(id)
+1
View File
@@ -607,6 +607,7 @@ class YamlInterpreter(object):
'usage': node.usage,
'limit': node.limit,
'auto_refresh': node.auto_refresh,
'multi': getattr(node, 'multi', False),
}
self._set_group_values(node, values)