merge upstream

bzr revid: chs@openerp.com-20130702191613-djzicmgpvrhh05zi
This commit is contained in:
Christophe Simonis 2013-07-02 21:16:13 +02:00
commit 5a5d9d5941
9 changed files with 31 additions and 25 deletions

View File

@ -940,18 +940,6 @@
<field name="rate">18.89</field>
</record>
<record id="EEK" model="res.currency">
<field name="name">EEK</field>
<field name="symbol">kr</field>
<field name="rounding">0.01</field>
<field name="accuracy">4</field>
</record>
<record id="rateEEK" model="res.currency.rate">
<field name="currency_id" ref="EEK" />
<field eval="time.strftime('%Y-01-01')" name="name"/>
<field name="rate">14.41</field>
</record>
<record id="ETB" model="res.currency">
<field name="name">ETB</field>
<field name="symbol">Br</field>

View File

@ -247,6 +247,7 @@
<field name="complete_name"/>
<field name="display_name"/>
<field name="model" groups="base.group_no_one"/>
<field name="module" invisible="1"/>
<field name="res_id"/>
</tree>
</field>

View File

@ -33,7 +33,7 @@
</h1>
</div>
<div attrs="{'invisible' : [('logo','!=',False)]}" class="oe_view_nocontent oe_clear">
<p class="oe_view_nocontent_create">
<p class="oe_view_nocontent_create oe_edit_only">
Click to set your company logo.
</p>
</div>

View File

@ -330,7 +330,7 @@
<record id="ee" model="res.country">
<field name="name">Estonia</field>
<field name="code">ee</field>
<field name="currency_id" ref="EEK"/>
<field name="currency_id" ref="EUR"/>
</record>
<record id="eg" model="res.country">
<field name="name">Egypt</field>

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -1067,6 +1067,8 @@ class function(_column):
self._classic_write = True
if type=='binary':
self._symbol_get=lambda x:x and str(x)
else:
self._prefetch = True
if type == 'float':
self._symbol_c = float._symbol_c

View File

@ -385,11 +385,11 @@ class browse_record(object):
# if the field is a classic one or a many2one, we'll fetch all classic and many2one fields
if col._prefetch:
# gen the list of "local" (ie not inherited) fields which are classic or many2one
fields_to_fetch = filter(lambda x: x[1]._classic_write, self._table._columns.items())
fields_to_fetch = filter(lambda x: x[1]._classic_write and x[1]._prefetch, self._table._columns.items())
# gen the list of inherited fields
inherits = map(lambda x: (x[0], x[1][2]), self._table._inherit_fields.items())
# complete the field list with the inherited fields which are classic or many2one
fields_to_fetch += filter(lambda x: x[1]._classic_write, inherits)
fields_to_fetch += filter(lambda x: x[1]._classic_write and x[1]._prefetch, inherits)
# otherwise we fetch only that field
else:
fields_to_fetch = [(name, col)]
@ -1034,6 +1034,7 @@ class BaseModel(object):
'ondelete': field['on_delete'],
'translate': (field['translate']),
'manual': True,
'_prefetch': False,
#'select': int(field['select_level'])
}

View File

@ -116,10 +116,13 @@ def _process_text(self, txt):
result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate))
if sps:
txt = None
expr = sps.pop(0)
txt = eval(expr, self.localcontext)
if txt and isinstance(txt, basestring):
txt = tools.ustr(txt)
try:
expr = sps.pop(0)
txt = eval(expr, self.localcontext)
if txt and isinstance(txt, basestring):
txt = tools.ustr(txt)
except Exception:
_logger.error("Failed to evaluate expression [[ %s ]] with context %r while rendering report, ignored.", expr, self.localcontext)
if isinstance(txt, basestring):
result += txt
elif txt and (txt is not None) and (txt is not False):

View File

@ -196,7 +196,7 @@ class Multicorn(object):
def stop(self, graceful=True):
if self.long_polling_pid is not None:
self.worker_kill(self.long_polling_pid, signal.SIGTERM)
self.worker_kill(self.long_polling_pid, signal.SIGKILL) # FIXME make longpolling process handle SIGTERM correctly
self.long_polling_pid = None
if graceful:
_logger.info("Stopping gracefully")
@ -392,14 +392,18 @@ class WorkerCron(Worker):
interval = 60 + self.pid % 10 # chorus effect
time.sleep(interval)
def process_work(self):
rpc_request = logging.getLogger('openerp.netsvc.rpc.request')
rpc_request_flag = rpc_request.isEnabledFor(logging.DEBUG)
_logger.debug("WorkerCron (%s) polling for jobs", self.pid)
def _db_list(self):
if config['db_name']:
db_names = config['db_name'].split(',')
else:
db_names = openerp.service.db.exp_list(True)
return db_names
def process_work(self):
rpc_request = logging.getLogger('openerp.netsvc.rpc.request')
rpc_request_flag = rpc_request.isEnabledFor(logging.DEBUG)
_logger.debug("WorkerCron (%s) polling for jobs", self.pid)
db_names = self._db_list()
if len(db_names):
self.db_index = (self.db_index + 1) % len(db_names)
db_name = db_names[self.db_index]
@ -433,8 +437,15 @@ class WorkerCron(Worker):
self.db_index = 0
def start(self):
os.nice(10) # mommy always told me to be nice with others...
Worker.start(self)
self.multi.socket.close()
openerp.service.start_internal()
# chorus effect: make cron workers do not all start at first database
mct = config['max_cron_threads']
p = float(self.pid % mct) / mct
self.db_index = int(len(self._db_list()) * p)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: