@@ -30,7 +30,7 @@
|
||||
<form string="Event Type">
|
||||
<field name="name" select="1"/>
|
||||
<field name="active" select="1"/>
|
||||
<field name="key" readonly="1" select="1"/>
|
||||
<field name="key" select="1"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -251,10 +251,43 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partners">
|
||||
<form string="Partners" col='1'>
|
||||
<html>
|
||||
<fieldset>
|
||||
<legend>HTML Form Example</legend>
|
||||
<div style="width: 150px; white-space: nowrap;">
|
||||
<Label for="name">
|
||||
Name:
|
||||
</Label>
|
||||
<field name="name" select="1" colspan="6"/>
|
||||
<BUTTON type="button" class="button" onclick="clickme();">Test Click</BUTTON>
|
||||
|
||||
<script type="text/javascript">
|
||||
var clickme = function() {
|
||||
alert("This is Test HTML Code in Form View");
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<newline/>
|
||||
<table width="25%%" border='1'>
|
||||
<tr>
|
||||
<td>
|
||||
<b>
|
||||
OpenERP
|
||||
</b>
|
||||
</td>
|
||||
<td>
|
||||
<i>
|
||||
Tiny
|
||||
</i>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<hr/>
|
||||
</html>
|
||||
<group col="6" colspan="4">
|
||||
<group colspan="5" col="6">
|
||||
<field name="name" select="1" colspan="6"/>
|
||||
<field name="ref" select="1"/>
|
||||
<field domain="[('domain', '=', 'partner')]" name="title"/>
|
||||
<field name="lang"/>
|
||||
|
||||
+11
-9
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -80,6 +80,7 @@ class _column(object):
|
||||
self.view_load = 0
|
||||
self.select = select
|
||||
self.selectable = True
|
||||
self.group_operator = args.get('group_operator', False)
|
||||
for a in args:
|
||||
if args[a]:
|
||||
setattr(self, a, args[a])
|
||||
@@ -177,6 +178,7 @@ class float(_column):
|
||||
self.digits = digits
|
||||
self.digits_compute = digits_compute
|
||||
|
||||
|
||||
def digits_change(self, cr):
|
||||
if self.digits_compute:
|
||||
t = self.digits_compute(cr)
|
||||
@@ -320,8 +322,8 @@ class many2one(_column):
|
||||
except except_orm:
|
||||
record_name = {}
|
||||
record_name[record] = '// Access Denied //'
|
||||
names.update(record_name)
|
||||
|
||||
names.update(record_name)
|
||||
|
||||
for r in res.keys():
|
||||
if res[r] and res[r] in names:
|
||||
res[r] = (res[r], names[res[r]])
|
||||
@@ -629,7 +631,7 @@ class function(_column):
|
||||
self._multi = multi
|
||||
if 'relation' in args:
|
||||
self._obj = args['relation']
|
||||
|
||||
|
||||
self.digits = args.get('digits', (16,2))
|
||||
self.digits_compute = args.get('digits_compute', None)
|
||||
|
||||
@@ -642,7 +644,7 @@ class function(_column):
|
||||
|
||||
if not fnct_search and not store:
|
||||
self.selectable = False
|
||||
|
||||
|
||||
if store:
|
||||
self._classic_read = True
|
||||
self._classic_write = True
|
||||
@@ -681,14 +683,14 @@ class function(_column):
|
||||
if self._type == "many2one" :
|
||||
# Filtering only integer/long values if passed
|
||||
res_ids = [x for x in res.values() if x and isinstance(x, (int,long))]
|
||||
|
||||
|
||||
if res_ids:
|
||||
obj_model = obj.pool.get(self._obj)
|
||||
dict_names = dict(obj_model.name_get(cr, user, res_ids, context))
|
||||
for r in res.keys():
|
||||
if res[r] and res[r] in dict_names:
|
||||
res[r] = (res[r], dict_names[res[r]])
|
||||
|
||||
|
||||
if self._type == 'binary' and context.get('bin_size', False):
|
||||
# convert the data returned by the function with the size of that data...
|
||||
res = dict(map( get_nice_size, res.items()))
|
||||
@@ -838,7 +840,7 @@ class dummy(function):
|
||||
|
||||
def _fnct_read(self, obj, cr, uid, ids, field_name, args, context=None):
|
||||
return {}
|
||||
|
||||
|
||||
def __init__(self, *arg, **args):
|
||||
self.arg = arg
|
||||
self._relations = []
|
||||
|
||||
+3
-6
@@ -1007,7 +1007,7 @@ class orm_template(object):
|
||||
if fields and f not in fields:
|
||||
continue
|
||||
res[f] = {'type': self._columns[f]._type}
|
||||
for arg in ('string', 'readonly', 'states', 'size', 'required',
|
||||
for arg in ('string', 'readonly', 'states', 'size', 'required', 'group_operator',
|
||||
'change_default', 'translate', 'help', 'select', 'selectable'):
|
||||
if getattr(self._columns[f], arg):
|
||||
res[f][arg] = getattr(self._columns[f], arg)
|
||||
@@ -1871,13 +1871,10 @@ class orm(orm_template):
|
||||
fields_pre = [f for f in float_int_fields if
|
||||
f == self.CONCURRENCY_CHECK_FIELD
|
||||
or (f in self._columns and getattr(self._columns[f], '_classic_write'))]
|
||||
avg_fields = context.get('avg',[])
|
||||
for f in fields_pre:
|
||||
if f not in ['id','sequence']:
|
||||
if f in avg_fields:
|
||||
flist += ',avg('+f+') as '+f
|
||||
else:
|
||||
flist += ',sum('+f+') as '+f
|
||||
operator = fget[f].get('group_operator','sum')
|
||||
flist += ','+operator+'('+f+') as '+f
|
||||
|
||||
cr.execute('select min(%s.id) as id,' % self._table + flist + ' from ' + ','.join(tables) + where_clause + ' group by '+ groupby + limit_str + offset_str, where_params)
|
||||
alldata = {}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import types
|
||||
import yaml
|
||||
import time # used to eval time.strftime expressions
|
||||
import logging
|
||||
|
||||
import pooler
|
||||
import netsvc
|
||||
import misc
|
||||
|
||||
from config import config
|
||||
|
||||
import yaml
|
||||
|
||||
logger_channel = 'tests'
|
||||
|
||||
class YamlImportException(Exception):
|
||||
|
||||
Reference in New Issue
Block a user