[MERGE] forward port of branch 7.0 up to 284ca73
This commit is contained in:
commit
276d0e76b2
|
@ -198,6 +198,7 @@
|
|||
<field name="name">account.analytic.account.list.contract</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date_start" position="before">
|
||||
<field name="last_invoice_date"/>
|
||||
|
|
|
@ -37,7 +37,9 @@ class pad_common(osv.osv_memory):
|
|||
s = string.ascii_uppercase + string.digits
|
||||
salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
|
||||
#path
|
||||
path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt)
|
||||
# etherpad hardcodes pad id length limit to 50
|
||||
path = '-%s-%s' % (self._name, salt)
|
||||
path = '%s%s' % (cr.dbname.replace('_','-')[0:50 - len(path)], path)
|
||||
# contruct the url
|
||||
url = '%s/p/%s' % (pad["server"], path)
|
||||
|
||||
|
|
|
@ -504,7 +504,17 @@ class browse_record(object):
|
|||
def __getattr__(self, name):
|
||||
try:
|
||||
return self[name]
|
||||
except KeyError, e:
|
||||
except KeyError as e:
|
||||
if name in self._all_columns:
|
||||
raise ValueError(
|
||||
'Cannot fetch field "%(field)s" for "%(model)s" record '
|
||||
'with ID %(id)s, that record does not exist or has been '
|
||||
'deleted' % {
|
||||
'field': name,
|
||||
'model': self._model._name,
|
||||
'id': self._id,
|
||||
}
|
||||
)
|
||||
import sys
|
||||
exc_info = sys.exc_info()
|
||||
raise AttributeError, "Got %r while trying to get attribute %s on a %s record." % (e, name, self._table._name), exc_info[2]
|
||||
|
|
Loading…
Reference in New Issue